Файловый менеджер - Редактировать - /home/clickysoft/public_html/jmapi5.clickysoft.net/twilio.tar
Назад
sdk/.github/ISSUE_TEMPLATE/config.yml 0000644 00000000575 15021223077 0013046 0 ustar 00 contact_links: - name: Twilio Support url: https://twilio.com/help/contact about: Get Support - name: Stack Overflow url: https://stackoverflow.com/questions/tagged/twilio-php+or+twilio+php about: Ask questions on Stack Overflow - name: Documentation url: https://www.twilio.com/docs/libraries/reference/twilio-php about: View Reference Documentation sdk/.github/workflows/test-and-deploy.yml 0000644 00000010174 15021223077 0014460 0 ustar 00 name: Test and Deploy on: push: branches: [ '*' ] tags: [ '*' ] pull_request: branches: [ main ] schedule: # Run automatically at 8AM PST Monday-Friday - cron: '0 15 * * 1-5' workflow_dispatch: jobs: test: name: Test runs-on: ubuntu-latest timeout-minutes: 20 strategy: matrix: php: [ 7.2, 7.3, 7.4, 8.0, 8.1 ] dependencies: - "lowest" - "highest" steps: - name: Checkout twilio-php uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Setup PHP Action uses: shivammathur/setup-php@2.15.0 with: php-version: ${{ matrix.php }} coverage: xdebug id: php - name: Composer webhook config run: composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} - name: Update Dependencies if: matrix.dependencies == 'lowest' run: composer update --prefer-lowest --prefer-stable -n - name: Run Tests run: make install test - name: Fix code coverage paths run: | if [ -f "coverage.xml" ]; then sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage.xml fi - name: Run Cluster Test if: (!github.event.pull_request.head.repo.fork) env: TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }} TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}} TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }} TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }} TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }} run: make cluster-test - name: Install SonarCloud scanner and run analysis uses: SonarSource/sonarcloud-github-action@master if: (github.event_name == 'pull_request' || github.ref_type == 'branch') && !github.event.pull_request.head.repo.fork && matrix.php == '8.1' && matrix.dependencies == 'highest' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} deploy: name: Deploy if: success() && github.ref_type == 'tag' needs: [ test ] runs-on: ubuntu-latest steps: - name: Checkout twilio-php uses: actions/checkout@v3 with: fetch-depth: 0 - name: Install dependencies run: composer install - name: Login to Docker Hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_AUTH_TOKEN }} # The expression strips off the shortest match from the front of the string to yield just the tag name as the output - name: Get tagged version run: echo "GITHUB_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Create GitHub Release uses: sendgrid/dx-automator/actions/release@main env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build & Push docker image run: make docker-build docker-push - name: Submit metric to Datadog uses: sendgrid/dx-automator/actions/datadog-release-metric@main env: DD_API_KEY: ${{ secrets.DATADOG_API_KEY }} notify-on-failure: name: Slack notify on failure if: failure() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref_type == 'tag') needs: [ test, deploy ] runs-on: ubuntu-latest steps: - uses: rtCamp/action-slack-notify@v2 env: SLACK_COLOR: failure SLACK_ICON_EMOJI: ':github:' SLACK_MESSAGE: ${{ format('Test *{0}*, Deploy *{1}*, {2}/{3}/actions/runs/{4}', needs.test.result, needs.deploy.result, github.server_url, github.repository, github.run_id) }} SLACK_TITLE: Action Failure - ${{ github.repository }} SLACK_USERNAME: GitHub Actions SLACK_MSG_AUTHOR: twilio-dx SLACK_FOOTER: Posted automatically using GitHub Actions SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} MSG_MINIMAL: true sdk/.github/workflows/pr-lint.yml 0000644 00000000655 15021223077 0013037 0 ustar 00 name: Lint PR on: pull_request_target: types: [ opened, edited, synchronize, reopened ] jobs: validate: name: Validate title runs-on: ubuntu-latest steps: - uses: amannn/action-semantic-pull-request@v5 with: types: | chore docs fix feat misc test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} sdk/Dockerfile-dev 0000644 00000000570 15021223077 0010074 0 ustar 00 ARG version FROM php:$version RUN curl --silent --show-error https://getcomposer.org/installer | php RUN mv composer.phar /usr/local/bin/composer RUN apt-get update -y && \ apt-get upgrade -y && \ apt-get dist-upgrade -y && \ apt-get -y autoremove && \ apt-get clean RUN apt-get install -y zip unzip git ENV COMPOSER_ALLOW_SUPERUSER=1 WORKDIR /twilio sdk/composer.json 0000644 00000001556 15021223077 0010055 0 ustar 00 { "name": "twilio/sdk", "type": "library", "description": "A PHP wrapper for Twilio's API", "keywords": ["twilio", "sms", "api"], "homepage": "https://github.com/twilio/twilio-php", "license": "MIT", "authors": [ { "name": "Twilio API Team", "email": "api@twilio.com" } ], "require": { "php": ">=7.1.0" }, "require-dev": { "guzzlehttp/guzzle": "^6.3 || ^7.0", "phpunit/phpunit": ">=7.0 < 10" }, "suggest": { "guzzlehttp/guzzle": "An HTTP client to execute the API requests" }, "autoload": { "psr-4": { "Twilio\\": "src/Twilio/" } }, "autoload-dev": { "psr-4": { "": "src/Twilio/", "Twilio\\Tests\\": "tests/Twilio/" } }, "config": { "lock": false } } sdk/Dockerfile 0000644 00000000430 15021223077 0007313 0 ustar 00 FROM php:7.4 RUN apt-get update -y && apt-get install -y zip RUN mkdir /twilio WORKDIR /twilio ENV PATH="vendor/bin:$PATH" COPY src src COPY tests tests COPY composer* ./ COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer RUN composer install --prefer-dist sdk/PULL_REQUEST_TEMPLATE.md 0000644 00000003157 15021223077 0011133 0 ustar 00 <!-- We appreciate the effort for this pull request but before that please make sure you read the contribution guidelines, then fill out the blanks below. Please format the PR title appropriately based on the type of change: <type>[!]: <description> Where <type> is one of: docs, chore, feat, fix, test, misc. Add a '!' after the type for breaking changes (e.g. feat!: new breaking feature). **All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.** Please enter each Issue number you are resolving in your PR after one of the following words [Fixes, Closes, Resolves]. This will auto-link these issues and close them when this PR is merged! e.g. Fixes #1 Closes #2 --> # Fixes # A short description of what this PR does. ### Checklist - [x] I acknowledge that all my contributions will be made under the project's license - [ ] I have made a material change to the repo (functionality, testing, spelling, grammar) - [ ] I have read the [Contribution Guidelines](https://github.com/twilio/twilio-php/blob/main/CONTRIBUTING.md) and my PR follows them - [ ] I have titled the PR appropriately - [ ] I have updated my branch with the main branch - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added the necessary documentation about the functionality in the appropriate .md file - [ ] I have added inline documentation to the code I modified If you have questions, please file a [support ticket](https://twilio.com/help/contact), or create a GitHub Issue in this repository. sdk/advanced-examples/custom-http-client.md 0000644 00000015367 15021223077 0015006 0 ustar 00 # Custom HTTP Clients for the Twilio PHP Helper Library If you are working with the Twilio PHP Helper Library and need to modify the HTTP requests that the library makes to the Twilio servers you’re in the right place. The most common place you'll need to alter the HTTP request is to connect and authenticate with an enterprise’s proxy server. We’ll provide sample code that you can drop right into your app to handle this use case. ## Connect and authenticate with a proxy server To connect and provide credentials to a proxy server between your app and Twilio, you need a way to modify the HTTP requests that the Twilio helper library makes to invoke the Twilio REST API. In PHP, the Twilio helper library uses the [cURL](http://php.net/manual/en/book.curl.php) library under the hood to make HTTP requests. The Twilio Helper Library allows you to provide your own `HttpClient` for making API requests. How do we apply this to a typical Twilio REST API example? ```php <?php $twilio = new Client($sid, $token); $message = $twilio->messages ->create( "+15558675310", array( 'body' => "Hey there!", 'from' => "+15017122661" ) ); ``` Where does `HttpClient` get created and used? Out of the box, the helper library is creating a default `RequestClient` for you, using the Twilio credentials you pass to the `init` method. However, there’s nothing stopping you from creating your own `RequestClient`. Once you have your own `RequestClient`, you can pass it to any Twilio REST API resource action you want. Here’s an example of sending an SMS message with a custom client: ```php <?php // Update the path below to your autoload.php, // see https://getcomposer.org/doc/01-basic-usage.md require_once "./vendor/autoload.php"; require_once "./MyRequestClass.php"; $dotenv = new Dotenv\Dotenv(__DIR__); $dotenv->load(); use Twilio\Rest\Client; // Your Account Sid and Auth Token from twilio.com/console $sid = getenv('ACCOUNT_SID'); $token = getenv('AUTH_TOKEN'); $proxy = getenv('PROXY'); $httpClient = new MyRequestClass($proxy); $twilio = new Client($sid, $token, null, null, $httpClient); $message = $twilio->messages ->create( "+15558675310", array( 'body' => "Hey there!", 'from' => "+15017122661" ) ); print("Message SID: {$message->sid}"); ``` ## Call Twilio through a proxy server Now that we understand how all the components fit together we can create our own `HttpClient` that can connect through a proxy server. To make this reusable, here’s a class that you can use to create this `HttpClient` whenever you need one. ```php <?php use Twilio\Http\CurlClient; use Twilio\Http\Response; class MyRequestClass extends CurlClient { protected $http = null; protected $proxy = null; /** * MyRequestClass constructor. * @param $proxy Proxy Server * @param $cainfo CA Info for the proxy */ public function __construct($proxy = null, $cainfo = null) { $this->proxy = $proxy; $this->cainfo = $cainfo; $this->http = new CurlClient(); } public function request( $method, $url, $params = array(), $data = array(), $headers = array(), $user = null, $password = null, $timeout = null): Response { // Here you can change the URL, headers and other request parameters $options = $this->options( $method, $url, $params, $data, $headers, $user, $password, $timeout ); $curl = curl_init($url); curl_setopt_array($curl, $options); if (!empty($this->proxy)) curl_setopt($curl, CURLOPT_PROXY, $this->proxy); if (!empty($this->cainfo)) curl_setopt($curl, CURLOPT_CAINFO, $this->cainfo); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, true); curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, true); $response = curl_exec($curl); $statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); $headerSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE); $head = substr($response, 0, $headerSize); $body = substr($response, $headerSize); $responseHeaders = array(); $headerLines = preg_split("/\r?\n/", $head); foreach ($headerLines as $line) { if (!preg_match("/:/", $line)) continue; list($key, $value) = explode(':', $line, 2); $responseHeaders[trim($key)] = trim($value); } curl_close($curl); if (isset($buffer) && is_resource($buffer)) { fclose($buffer); } return new Response($statusCode, $body, $responseHeaders); } } ``` In this example, we are using some environment variables loaded at the program startup to retrieve various configuration settings: - Your Twilio Account Sid and Auth Token ([found here, in the Twilio console](https://console.twilio.com)) - A proxy address in IP:Port form, e.g. `127.0.0.1:8888` Place these setting in an `.env` file like so: ```env ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx AUTH_TOKEN= your_auth_token PROXY=127.0.0.1:8888 ``` Here’s the full console program that loads the `.env` file and sends a text message to show everything fitting together. ```php <?php // Update the path below to your autoload.php, // see https://getcomposer.org/doc/01-basic-usage.md require_once "./vendor/autoload.php"; require_once "./MyRequestClass.php"; $dotenv = new Dotenv\Dotenv(__DIR__); $dotenv->load(); use Twilio\Rest\Client; // Your Account Sid and Auth Token from twilio.com/console $sid = getenv('ACCOUNT_SID'); $token = getenv('AUTH_TOKEN'); $proxy = getenv('PROXY'); $httpClient = new MyRequestClass($proxy); $twilio = new Client($sid, $token, null, null, $httpClient); $message = $twilio->messages ->create( "+15558675310", array( 'body' => "Hey there!", 'from' => "+15017122661" ) ); print("Message SID: {$message->sid}"); ``` ## What else can this technique be used for? Now that you know how to inject your own httpClient into the Twilio API request pipeline, you could use this technique to add custom HTTP headers and authorization to the requests (perhaps as required by an upstream proxy server). You could also implement your own httpClient to mock the Twilio API responses so your unit and integration tests can run without the need to make a connection to Twilio. In fact, there’s already an example online showing [how to do exactly that with Node.js and Prism](https://www.twilio.com/docs/openapi/mock-api-generation-with-twilio-openapi-spec). We can’t wait to see what you build! sdk/example/message.php 0000644 00000002175 15021223077 0011121 0 ustar 00 <?php require(__DIR__.'/../src/Twilio/autoload.php'); use Twilio\Rest\Client; $sid = getenv('TWILIO_ACCOUNT_SID'); $token = getenv('TWILIO_AUTH_TOKEN'); $client = new Client($sid, $token); // Specify the phone numbers in [E.164 format](https://www.twilio.com/docs/glossary/what-e164) (e.g., +16175551212) // This parameter determines the destination phone number for your SMS message. Format this number with a '+' and a country code $phoneNumber = "+XXXXXXXXXX"; // This must be a Twilio phone number that you own, formatted with a '+' and country code $twilioPurchasedNumber = "+XXXXXXXXXX"; // Send a text message $message = $client->messages->create( $phoneNumber, [ 'from' => $twilioPurchasedNumber, 'body' => "Hey Jenny! Good luck on the bar exam!" ] ); print("Message sent successfully with sid = " . $message->sid ."\n\n"); // Print the last 10 messages $messageList = $client->messages->read([],10); foreach ($messageList as $msg) { print("ID:: ". $msg->sid . " | " . "From:: " . $msg->from . " | " . "TO:: " . $msg->to . " | " . " Status:: " . $msg->status . " | " . " Body:: ". $msg->body ."\n"); } sdk/example/twiML.php 0000644 00000002065 15021223077 0010527 0 ustar 00 <?php require(__DIR__ . '/../vendor/autoload.php'); use Twilio\TwiML\VoiceResponse; // TwiML Say and Play $say = new \Twilio\TwiML\Voice\Say('Hello World!', [ 'voice' => 'woman' ]); $play = new \Twilio\TwiML\Voice\Play("https://api.twilio.com/cowbell.mp3", [ 'loop' => 5 ]); $twiml = new VoiceResponse(); $twiml->append($say); $twiml->append($play); print("TwiML Say and Play: \n{$twiml->asXML()}\n"); // Gather, Redirect $twimlResponse = new VoiceResponse(); $gather = $twimlResponse->gather(); $gather->setNumDigits(10); $gather->say("Press 1"); $twimlResponse->redirect("https://example.com"); print("TwiML Gather and Redirect: \n{$twimlResponse->asXML()}\n"); // Dial $twimlResponse = new VoiceResponse(); // A valid phone number formatted with a '+' and a country code (e.g., +16175551212) $callerID = '+XXXXXXXX'; $dial = $twimlResponse->dial('', [ 'callerId' => $callerID, 'action' => 'https:///example.com', 'hangupOnStar' => true, ]); $dial->conference("My Room", ["beep" => "true"]); print("TwiML Dial: \n{$twimlResponse->asXML()}\n"); sdk/example/incomingPhoneNumber.php 0000644 00000001543 15021223077 0013441 0 ustar 00 <?php require(__DIR__.'/../src/Twilio/autoload.php'); use Twilio\Rest\Client; $sid = getenv('TWILIO_ACCOUNT_SID'); $token = getenv('TWILIO_AUTH_TOKEN'); $client = new Client($sid, $token); function buyNumber(): ?Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberInstance{ // Look up some phone numbers global $client; // Specify the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the country // from which to read phone numbers, eg: "US" $numbers = $client->availablePhoneNumbers("XX")->local->read(); // Buy the first phone number if(!empty($numbers)){ $local = $numbers[0]; return $client->incomingPhoneNumbers->create(["phoneNumber" => $local->phoneNumber]); } return null; } // Get a number $number = buyNumber(); print("Twilio purchased phoneNumber: ".$number->phoneNumber."\n"); sdk/example/signingKey.php 0000644 00000001665 15021223077 0011607 0 ustar 00 <?php require(__DIR__.'/../src/Twilio/autoload.php'); require(__DIR__.'/../vendor/autoload.php'); use Twilio\Rest\Client; $sid = getenv('TWILIO_ACCOUNT_SID'); $token = getenv('TWILIO_AUTH_TOKEN'); $client = new Client($sid, $token); // Create new Signing Key $signingKey = $client->api->v2010->newSigningKeys->create(); // Switch to guzzle client as the default client $guzzleClient = new Client($signingKey->sid, $signingKey->secret, $sid, null, new \Twilio\Http\GuzzleClient(new \GuzzleHttp\Client)); // The phone number you are querying in E.164 or national format. // If the phone number is provided in national format, please also specify the country in the optional parameter CountryCode. // Otherwise, CountryCode will default to US. $number = "+XXXXXXXXXX"; // Make REST API requests $phone_number = $guzzleClient->lookups->v1->phoneNumbers($number) ->fetch([ "type" => ["carrier"] ]); print_r($phone_number->carrier); sdk/example/trunk.php 0000644 00000000552 15021223077 0010635 0 ustar 00 <?php require(__DIR__.'/../src/Twilio/autoload.php'); use Twilio\Rest\Client; $sid = getenv('TWILIO_ACCOUNT_SID'); $token = getenv('TWILIO_AUTH_TOKEN'); $client = new Client($sid, $token); // Create Trunk $trunk = $client->trunking->v1->trunks->create( [ "friendlyName" => "shiny trunk", "secure" => false ] ); print("\n".$trunk."\n"); sdk/example/record.php 0000644 00000001536 15021223077 0010753 0 ustar 00 <?php require(__DIR__.'/../src/Twilio/autoload.php'); use Twilio\Rest\Client; $sid = getenv('TWILIO_ACCOUNT_SID'); $token = getenv('TWILIO_AUTH_TOKEN'); $client = new Client($sid, $token); // Get last 10 records $recordList = $client->usage->records->read([], 10); foreach ($recordList as $record) { print_r("Record(accountSid=" . $record->accountSid . ", apiVersion=" . $record->apiVersion . ", asOf=" . $record->asOf . ", category=" . $record->category . ", count=" . $record->count . ", countUnit=" . $record->countUnit . ", description=" . $record->description . ", endDate=" . $record->endDate->format("Y-m-d H:i:s") . ", price=" . $record->price . ", priceUnit=" . $record->priceUnit . ", startDate=" . $record->startDate->format("Y-m-d H:i:s") . ", uri=" . $record->uri . ", usage=" . $record->usage . ", usageUnit=" . $record->usageUnit . "\n"); } sdk/example/call.php 0000644 00000002206 15021223077 0010403 0 ustar 00 <?php require(__DIR__.'/../src/Twilio/autoload.php'); use Twilio\Rest\Client; $sid = getenv('TWILIO_ACCOUNT_SID'); $token = getenv('TWILIO_AUTH_TOKEN'); $client = new Client($sid, $token); // The phone number, SIP address, Client identifier or SIM SID that received this call. // Phone numbers are in [E.164 format](https://www.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). // SIP addresses are formatted as name@company.com. // Client identifiers are formatted client:name. // SIM SIDs are formatted as sim:sid $to = "+XXXXXXXXXX"; // The phone number or client identifier to use as the caller id. // If using a phone number, it must be a Twilio number or a Verified outgoing caller id for your account. // If the "to" parameter is a phone number, "from" must also be a phone number. $from = "+XXXXXXXXXX"; // Make a phone call $call = $client->calls->create( $to, $from, ["url" => "https://twilio.com"] ); print("Call made successfully with sid: ".$call->sid."\n\n"); // Get some calls $callsList = $client->calls->read([],null,2); foreach ($callsList as $call) { print("Call {$call->sid}: {$call->duration} seconds\n"); } sdk/CODE_OF_CONDUCT.md 0000644 00000006263 15021223077 0010132 0 ustar 00 # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: - Using welcoming and inclusive language - Being respectful of differing viewpoints and experiences - Gracefully accepting constructive criticism - Focusing on what is best for the community - Showing empathy towards other community members Examples of unacceptable behavior by participants include: - The use of sexualized language or imagery and unwelcome sexual attention or advances - Trolling, insulting/derogatory comments, and personal or political attacks - Public or private harassment - Publishing others' private information, such as a physical or electronic address, without explicit permission - Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at open-source@twilio.com. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html [homepage]: https://www.contributor-covenant.org sdk/phpdox.xml 0000644 00000000632 15021223077 0007351 0 ustar 00 <?xml version="1.0" encoding="utf-8" ?> <phpdox xmlns="http://xml.phpdox.net/config"> <project name="twilio-php" source="${basedir}/src" workdir="${basedir}/docs/xml"> <collector backend="parser"/> <generator output="${basedir}/docs"> <build engine="html" output="api"> <file extension="html"/> </build> </generator> </project> </phpdox> sdk/sonar-project.properties 0000644 00000000533 15021223077 0012231 0 ustar 00 sonar.projectKey=twilio_twilio-php sonar.projectName=twilio-php sonar.organization=twilio sonar.sources=src/ sonar.exclusions=src/Twilio/Rest/**/*, src/Twilio/TwiML/*/*, src/Twilio/TwiML/*Response.php sonar.tests=tests/ sonar.test.exclusions=tests/Twilio/Integration/**/* # For Code Coverage analysis sonar.php.coverage.reportPaths=coverage.xml sdk/src/Twilio/autoload.php 0000644 00000012415 15021223077 0011706 0 ustar 00 <?php /* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many individuals * and is licensed under the MIT license. For more information, see * <http://www.doctrine-project.org>. */ /** * SplClassLoader implementation that implements the technical interoperability * standards for PHP 5.3 namespaces and class names. * * http://groups.google.com/group/php-standards/web/psr-0-final-proposal?pli=1 * * // Example which loads classes for the Doctrine Common package in the * // Doctrine\Common namespace. * $classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine'); * $classLoader->register(); * * @license http://www.opensource.org/licenses/mit-license.html MIT License * @author Jonathan H. Wage <jonwage@gmail.com> * @author Roman S. Borschel <roman@code-factory.org> * @author Matthew Weier O'Phinney <matthew@zend.com> * @author Kris Wallsmith <kris.wallsmith@gmail.com> * @author Fabien Potencier <fabien.potencier@symfony-project.org> */ class SplClassLoader { private $_fileExtension = '.php'; private $_namespace; private $_includePath; private $_namespaceSeparator = '\\'; /** * Creates a new <tt>SplClassLoader</tt> that loads classes of the * specified namespace. * * @param string $ns The namespace to use. * @param string $includePath The include path to search */ public function __construct($ns = null, $includePath = null) { $this->_namespace = $ns; $this->_includePath = $includePath; } /** * Sets the namespace separator used by classes in the namespace of this class loader. * * @param string $sep The separator to use. */ public function setNamespaceSeparator($sep): void { $this->_namespaceSeparator = $sep; } /** * Gets the namespace separator used by classes in the namespace of this class loader. * * @return string The separator to use. */ public function getNamespaceSeparator(): string { return $this->_namespaceSeparator; } /** * Sets the base include path for all class files in the namespace of this class loader. * * @param string $includePath */ public function setIncludePath($includePath): void { $this->_includePath = $includePath; } /** * Gets the base include path for all class files in the namespace of this class loader. * * @return string $includePath */ public function getIncludePath(): string { return $this->_includePath; } /** * Sets the file extension of class files in the namespace of this class loader. * * @param string $fileExtension */ public function setFileExtension($fileExtension): void { $this->_fileExtension = $fileExtension; } /** * Gets the file extension of class files in the namespace of this class loader. * * @return string $fileExtension */ public function getFileExtension(): string { return $this->_fileExtension; } /** * Installs this class loader on the SPL autoload stack. */ public function register(): void { \spl_autoload_register([$this, 'loadClass']); } /** * Uninstalls this class loader from the SPL autoloader stack. */ public function unregister(): void { \spl_autoload_unregister([$this, 'loadClass']); } /** * Loads the given class or interface. * * @param string $className The name of the class to load. * @return void */ public function loadClass($className): void { if (null === $this->_namespace || $this->_namespace . $this->_namespaceSeparator === \substr($className, 0, \strlen($this->_namespace . $this->_namespaceSeparator))) { $fileName = ''; $namespace = ''; if (false !== ($lastNsPos = \strripos($className, $this->_namespaceSeparator))) { $namespace = \substr($className, 0, $lastNsPos); $className = \substr($className, $lastNsPos + 1); $fileName = \str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; } $fileName .= \str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension; require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName; } } } $twilioClassLoader = new SplClassLoader('Twilio', \realpath(__DIR__ . DIRECTORY_SEPARATOR . '..')); $twilioClassLoader->register(); sdk/src/Twilio/Page.php 0000644 00000013561 15021223077 0010755 0 ustar 00 <?php namespace Twilio; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\RestException; use Twilio\Http\Response; abstract class Page implements \Iterator { protected static $metaKeys = [ 'end', 'first_page_uri', 'next_page_uri', 'last_page_uri', 'page', 'page_size', 'previous_page_uri', 'total', 'num_pages', 'start', 'uri', ]; protected $version; protected $payload; protected $solution; protected $records; abstract public function buildInstance(array $payload); public function __construct(Version $version, Response $response) { $payload = $this->processResponse($response); $this->version = $version; $this->payload = $payload; $this->solution = []; $this->records = new \ArrayIterator($this->loadPage()); } protected function processResponse(Response $response) { if ($response->getStatusCode() !== 200 && !$this->isPagingEol($response->getContent())) { $message = '[HTTP ' . $response->getStatusCode() . '] Unable to fetch page'; $code = $response->getStatusCode(); $content = $response->getContent(); $details = []; $moreInfo = ''; if (\is_array($content)) { $message .= isset($content['message']) ? ': ' . $content['message'] : ''; $code = $content['code'] ?? $code; $moreInfo = $content['more_info'] ?? ''; $details = $content['details'] ?? [] ; } throw new RestException($message, $code, $response->getStatusCode(), $moreInfo, $details); } return $response->getContent(); } protected function isPagingEol(?array $content): bool { return $content !== null && \array_key_exists('code', $content) && $content['code'] === 20006; } protected function hasMeta(string $key): bool { return \array_key_exists('meta', $this->payload) && \array_key_exists($key, $this->payload['meta']); } protected function getMeta(string $key, string $default = null): ?string { return $this->hasMeta($key) ? $this->payload['meta'][$key] : $default; } protected function loadPage(): array { $key = $this->getMeta('key'); if ($key) { return $this->payload[$key]; } $keys = \array_keys($this->payload); $key = \array_diff($keys, self::$metaKeys); $key = \array_values($key); if (\count($key) === 1) { return $this->payload[$key[0]]; } // handle end of results error code if ($this->isPagingEol($this->payload)) { return []; } throw new DeserializeException('Page Records can not be deserialized'); } public function getPreviousPageUrl(): ?string { if ($this->hasMeta('previous_page_url')) { return $this->getMeta('previous_page_url'); } else if (\array_key_exists('previous_page_uri', $this->payload) && $this->payload['previous_page_uri']) { return $this->getVersion()->getDomain()->absoluteUrl($this->payload['previous_page_uri']); } return null; } public function getNextPageUrl(): ?string { if ($this->hasMeta('next_page_url')) { return $this->getMeta('next_page_url'); } else if (\array_key_exists('next_page_uri', $this->payload) && $this->payload['next_page_uri']) { return $this->getVersion()->getDomain()->absoluteUrl($this->payload['next_page_uri']); } return null; } public function nextPage(): ?Page { if (!$this->getNextPageUrl()) { return null; } $response = $this->getVersion()->getDomain()->getClient()->request('GET', $this->getNextPageUrl()); return new static($this->getVersion(), $response, $this->solution); } public function previousPage(): ?Page { if (!$this->getPreviousPageUrl()) { return null; } $response = $this->getVersion()->getDomain()->getClient()->request('GET', $this->getPreviousPageUrl()); return new static($this->getVersion(), $response, $this->solution); } /** * (PHP 5 >= 5.0.0)<br/> * Return the current element * @link http://php.net/manual/en/iterator.current.php * @return mixed Can return any type. */ #[\ReturnTypeWillChange] public function current() { return $this->buildInstance($this->records->current()); } /** * (PHP 5 >= 5.0.0)<br/> * Move forward to next element * @link http://php.net/manual/en/iterator.next.php * @return void Any returned value is ignored. */ public function next(): void { $this->records->next(); } /** * (PHP 5 >= 5.0.0)<br/> * Return the key of the current element * @link http://php.net/manual/en/iterator.key.php * @return mixed scalar on success, or null on failure. */ #[\ReturnTypeWillChange] public function key() { return $this->records->key(); } /** * (PHP 5 >= 5.0.0)<br/> * Checks if current position is valid * @link http://php.net/manual/en/iterator.valid.php * @return bool The return value will be casted to boolean and then evaluated. * Returns true on success or false on failure. */ public function valid(): bool { return $this->records->valid(); } /** * (PHP 5 >= 5.0.0)<br/> * Rewind the Iterator to the first element * @link http://php.net/manual/en/iterator.rewind.php * @return void Any returned value is ignored. */ public function rewind(): void { $this->records->rewind(); } public function getVersion(): Version { return $this->version; } public function __toString(): string { return '[Page]'; } } sdk/src/Twilio/InstanceContext.php 0000644 00000000464 15021223077 0013210 0 ustar 00 <?php namespace Twilio; class InstanceContext { protected $version; protected $solution = []; protected $uri; public function __construct(Version $version) { $this->version = $version; } public function __toString(): string { return '[InstanceContext]'; } } sdk/src/Twilio/Domain.php 0000644 00000004105 15021223077 0011302 0 ustar 00 <?php namespace Twilio; use Twilio\Http\Response; use Twilio\Rest\Client; /** * Class Domain * Abstracts a Twilio sub domain * @package Twilio */ abstract class Domain { /** * @var Client Twilio Client */ protected $client; /** * @var string Base URL for this domain */ protected $baseUrl; /** * Construct a new Domain * @param Client $client used to communicate with Twilio */ public function __construct(Client $client) { $this->client = $client; $this->baseUrl = ''; } /** * Translate version relative URIs into absolute URLs * * @param string $uri Version relative URI * @return string Absolute URL for this domain */ public function absoluteUrl(string $uri): string { return \implode('/', [\trim($this->baseUrl, '/'), \trim($uri, '/')]); } /** * Make an HTTP request to the domain * * @param string $method HTTP Method to make the request with * @param string $uri Relative uri to make a request to * @param array $params Query string arguments * @param array $data Post form data * @param array $headers HTTP headers to send with the request * @param string $user User to authenticate as * @param string $password Password * @param int $timeout Request timeout * @return Response the response for the request */ public function request(string $method, string $uri, array $params = [], array $data = [], array $headers = [], string $user = null, string $password = null, int $timeout = null): Response { $url = $this->absoluteUrl($uri); return $this->client->request( $method, $url, $params, $data, $headers, $user, $password, $timeout ); } public function getClient(): Client { return $this->client; } public function __toString(): string { return '[Domain]'; } } sdk/src/Twilio/TwiML/GenericNode.php 0000644 00000000713 15021223077 0013252 0 ustar 00 <?php namespace Twilio\TwiML; class GenericNode extends TwiML { /** * GenericNode constructor. * * @param string $name XML element name * @param string $value XML value * @param array $attributes XML attributes */ public function __construct(string $name, ?string $value, array $attributes) { parent::__construct($name, $value, $attributes); $this->name = $name; $this->value = $value; } } sdk/src/Twilio/TwiML/Messaging/Redirect.php 0000644 00000001256 15021223077 0014551 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Messaging; use Twilio\TwiML\TwiML; class Redirect extends TwiML { /** * Redirect constructor. * * @param string $url Redirect URL * @param array $attributes Optional attributes */ public function __construct($url, $attributes = []) { parent::__construct('Redirect', $url, $attributes); } /** * Add Method attribute. * * @param string $method Redirect URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } } sdk/src/Twilio/TwiML/Messaging/Body.php 0000644 00000000611 15021223077 0013677 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Messaging; use Twilio\TwiML\TwiML; class Body extends TwiML { /** * Body constructor. * * @param string $message Message Body */ public function __construct($message) { parent::__construct('Body', $message); } } sdk/src/Twilio/TwiML/Messaging/Media.php 0000644 00000000575 15021223077 0014032 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Messaging; use Twilio\TwiML\TwiML; class Media extends TwiML { /** * Media constructor. * * @param string $url Media URL */ public function __construct($url) { parent::__construct('Media', $url); } } sdk/src/Twilio/TwiML/Messaging/Message.php 0000644 00000004167 15021223077 0014400 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Messaging; use Twilio\TwiML\TwiML; class Message extends TwiML { /** * Message constructor. * * @param string $body Message Body * @param array $attributes Optional attributes */ public function __construct($body, $attributes = []) { parent::__construct('Message', $body, $attributes); } /** * Add Body child. * * @param string $message Message Body * @return Body Child element. */ public function body($message): Body { return $this->nest(new Body($message)); } /** * Add Media child. * * @param string $url Media URL * @return Media Child element. */ public function media($url): Media { return $this->nest(new Media($url)); } /** * Add To attribute. * * @param string $to Phone Number to send Message to */ public function setTo($to): self { return $this->setAttribute('to', $to); } /** * Add From attribute. * * @param string $from Phone Number to send Message from */ public function setFrom($from): self { return $this->setAttribute('from', $from); } /** * Add Action attribute. * * @param string $action A URL specifying where Twilio should send status * callbacks for the created outbound message. */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL Method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL. Deprecated in favor of * action. */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } } sdk/src/Twilio/TwiML/Fax/Receive.php 0000644 00000003235 15021223077 0013172 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Fax; use Twilio\TwiML\TwiML; class Receive extends TwiML { /** * Receive constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('Receive', null, $attributes); } /** * Add Action attribute. * * @param string $action Receive action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Receive action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add MediaType attribute. * * @param string $mediaType The media type used to store media in the fax media * store */ public function setMediaType($mediaType): self { return $this->setAttribute('mediaType', $mediaType); } /** * Add PageSize attribute. * * @param string $pageSize What size to interpret received pages as */ public function setPageSize($pageSize): self { return $this->setAttribute('pageSize', $pageSize); } /** * Add StoreMedia attribute. * * @param bool $storeMedia Whether or not to store received media in the fax * media store */ public function setStoreMedia($storeMedia): self { return $this->setAttribute('storeMedia', $storeMedia); } } sdk/src/Twilio/TwiML/Video/Room.php 0000644 00000000572 15021223077 0013055 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Video; use Twilio\TwiML\TwiML; class Room extends TwiML { /** * Room constructor. * * @param string $name Room name */ public function __construct($name) { parent::__construct('Room', $name); } } sdk/src/Twilio/TwiML/Voice/Sim.php 0000644 00000000572 15021223077 0012670 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Sim extends TwiML { /** * Sim constructor. * * @param string $simSid SIM SID */ public function __construct($simSid) { parent::__construct('Sim', $simSid); } } sdk/src/Twilio/TwiML/Voice/Prompt.php 0000644 00000004765 15021223077 0013431 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Prompt extends TwiML { /** * Prompt constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('Prompt', null, $attributes); } /** * Add Say child. * * @param string $message Message to say * @param array $attributes Optional attributes * @return Say Child element. */ public function say($message, $attributes = []): Say { return $this->nest(new Say($message, $attributes)); } /** * Add Play child. * * @param string $url Media URL * @param array $attributes Optional attributes * @return Play Child element. */ public function play($url = null, $attributes = []): Play { return $this->nest(new Play($url, $attributes)); } /** * Add Pause child. * * @param array $attributes Optional attributes * @return Pause Child element. */ public function pause($attributes = []): Pause { return $this->nest(new Pause($attributes)); } /** * Add For_ attribute. * * @param string $for_ Name of the payment source data element */ public function setFor_($for_): self { return $this->setAttribute('for_', $for_); } /** * Add ErrorType attribute. * * @param string[] $errorType Type of error */ public function setErrorType($errorType): self { return $this->setAttribute('errorType', $errorType); } /** * Add CardType attribute. * * @param string[] $cardType Type of the credit card */ public function setCardType($cardType): self { return $this->setAttribute('cardType', $cardType); } /** * Add Attempt attribute. * * @param int[] $attempt Current attempt count */ public function setAttempt($attempt): self { return $this->setAttribute('attempt', $attempt); } /** * Add RequireMatchingInputs attribute. * * @param bool $requireMatchingInputs Require customer to input requested * information twice and verify matching. */ public function setRequireMatchingInputs($requireMatchingInputs): self { return $this->setAttribute('requireMatchingInputs', $requireMatchingInputs); } } sdk/src/Twilio/TwiML/Voice/SsmlProsody.php 0000644 00000010347 15021223077 0014437 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlProsody extends TwiML { /** * SsmlProsody constructor. * * @param string $words Words to speak * @param array $attributes Optional attributes */ public function __construct($words, $attributes = []) { parent::__construct('prosody', $words, $attributes); } /** * Add Break child. * * @param array $attributes Optional attributes * @return SsmlBreak Child element. */ public function break_($attributes = []): SsmlBreak { return $this->nest(new SsmlBreak($attributes)); } /** * Add Emphasis child. * * @param string $words Words to emphasize * @param array $attributes Optional attributes * @return SsmlEmphasis Child element. */ public function emphasis($words, $attributes = []): SsmlEmphasis { return $this->nest(new SsmlEmphasis($words, $attributes)); } /** * Add Lang child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlLang Child element. */ public function lang($words, $attributes = []): SsmlLang { return $this->nest(new SsmlLang($words, $attributes)); } /** * Add P child. * * @param string $words Words to speak * @return SsmlP Child element. */ public function p($words): SsmlP { return $this->nest(new SsmlP($words)); } /** * Add Phoneme child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlPhoneme Child element. */ public function phoneme($words, $attributes = []): SsmlPhoneme { return $this->nest(new SsmlPhoneme($words, $attributes)); } /** * Add Prosody child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlProsody Child element. */ public function prosody($words, $attributes = []): SsmlProsody { return $this->nest(new SsmlProsody($words, $attributes)); } /** * Add S child. * * @param string $words Words to speak * @return SsmlS Child element. */ public function s($words): SsmlS { return $this->nest(new SsmlS($words)); } /** * Add Say-As child. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes * @return SsmlSayAs Child element. */ public function say_As($words, $attributes = []): SsmlSayAs { return $this->nest(new SsmlSayAs($words, $attributes)); } /** * Add Sub child. * * @param string $words Words to be substituted * @param array $attributes Optional attributes * @return SsmlSub Child element. */ public function sub($words, $attributes = []): SsmlSub { return $this->nest(new SsmlSub($words, $attributes)); } /** * Add W child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlW Child element. */ public function w($words, $attributes = []): SsmlW { return $this->nest(new SsmlW($words, $attributes)); } /** * Add Volume attribute. * * @param string $volume Specify the volume, available values: default, silent, * x-soft, soft, medium, loud, x-loud, +ndB, -ndB */ public function setVolume($volume): self { return $this->setAttribute('volume', $volume); } /** * Add Rate attribute. * * @param string $rate Specify the rate, available values: x-slow, slow, * medium, fast, x-fast, n% */ public function setRate($rate): self { return $this->setAttribute('rate', $rate); } /** * Add Pitch attribute. * * @param string $pitch Specify the pitch, available values: default, x-low, * low, medium, high, x-high, +n%, -n% */ public function setPitch($pitch): self { return $this->setAttribute('pitch', $pitch); } } sdk/src/Twilio/TwiML/Voice/Redirect.php 0000644 00000001252 15021223077 0013675 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Redirect extends TwiML { /** * Redirect constructor. * * @param string $url Redirect URL * @param array $attributes Optional attributes */ public function __construct($url, $attributes = []) { parent::__construct('Redirect', $url, $attributes); } /** * Add Method attribute. * * @param string $method Redirect URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } } sdk/src/Twilio/TwiML/Voice/SsmlEmphasis.php 0000644 00000006221 15021223077 0014545 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlEmphasis extends TwiML { /** * SsmlEmphasis constructor. * * @param string $words Words to emphasize * @param array $attributes Optional attributes */ public function __construct($words, $attributes = []) { parent::__construct('emphasis', $words, $attributes); } /** * Add Break child. * * @param array $attributes Optional attributes * @return SsmlBreak Child element. */ public function break_($attributes = []): SsmlBreak { return $this->nest(new SsmlBreak($attributes)); } /** * Add Emphasis child. * * @param string $words Words to emphasize * @param array $attributes Optional attributes * @return SsmlEmphasis Child element. */ public function emphasis($words, $attributes = []): SsmlEmphasis { return $this->nest(new SsmlEmphasis($words, $attributes)); } /** * Add Lang child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlLang Child element. */ public function lang($words, $attributes = []): SsmlLang { return $this->nest(new SsmlLang($words, $attributes)); } /** * Add Phoneme child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlPhoneme Child element. */ public function phoneme($words, $attributes = []): SsmlPhoneme { return $this->nest(new SsmlPhoneme($words, $attributes)); } /** * Add Prosody child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlProsody Child element. */ public function prosody($words, $attributes = []): SsmlProsody { return $this->nest(new SsmlProsody($words, $attributes)); } /** * Add Say-As child. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes * @return SsmlSayAs Child element. */ public function say_As($words, $attributes = []): SsmlSayAs { return $this->nest(new SsmlSayAs($words, $attributes)); } /** * Add Sub child. * * @param string $words Words to be substituted * @param array $attributes Optional attributes * @return SsmlSub Child element. */ public function sub($words, $attributes = []): SsmlSub { return $this->nest(new SsmlSub($words, $attributes)); } /** * Add W child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlW Child element. */ public function w($words, $attributes = []): SsmlW { return $this->nest(new SsmlW($words, $attributes)); } /** * Add Level attribute. * * @param string $level Specify the degree of emphasis */ public function setLevel($level): self { return $this->setAttribute('level', $level); } } sdk/src/Twilio/TwiML/Voice/ReferSip.php 0000644 00000000604 15021223077 0013653 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class ReferSip extends TwiML { /** * ReferSip constructor. * * @param string $sipUrl SIP URL */ public function __construct($sipUrl) { parent::__construct('Sip', $sipUrl); } } sdk/src/Twilio/TwiML/Voice/Leave.php 0000644 00000000512 15021223077 0013166 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Leave extends TwiML { /** * Leave constructor. */ public function __construct() { parent::__construct('Leave', null); } } sdk/src/Twilio/TwiML/Voice/Config.php 0000644 00000001514 15021223077 0013342 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Config extends TwiML { /** * Config constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('Config', null, $attributes); } /** * Add Name attribute. * * @param string $name The name of the custom config */ public function setName($name): self { return $this->setAttribute('name', $name); } /** * Add Value attribute. * * @param string $value The value of the custom config */ public function setValue($value): self { return $this->setAttribute('value', $value); } } sdk/src/Twilio/TwiML/Voice/Play.php 0000644 00000001554 15021223077 0013046 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Play extends TwiML { /** * Play constructor. * * @param string $url Media URL * @param array $attributes Optional attributes */ public function __construct($url = null, $attributes = []) { parent::__construct('Play', $url, $attributes); } /** * Add Loop attribute. * * @param int $loop Times to loop media */ public function setLoop($loop): self { return $this->setAttribute('loop', $loop); } /** * Add Digits attribute. * * @param string $digits Play DTMF tones for digits */ public function setDigits($digits): self { return $this->setAttribute('digits', $digits); } } sdk/src/Twilio/TwiML/Voice/SsmlW.php 0000644 00000005157 15021223077 0013211 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlW extends TwiML { /** * SsmlW constructor. * * @param string $words Words to speak * @param array $attributes Optional attributes */ public function __construct($words, $attributes = []) { parent::__construct('w', $words, $attributes); } /** * Add Break child. * * @param array $attributes Optional attributes * @return SsmlBreak Child element. */ public function break_($attributes = []): SsmlBreak { return $this->nest(new SsmlBreak($attributes)); } /** * Add Emphasis child. * * @param string $words Words to emphasize * @param array $attributes Optional attributes * @return SsmlEmphasis Child element. */ public function emphasis($words, $attributes = []): SsmlEmphasis { return $this->nest(new SsmlEmphasis($words, $attributes)); } /** * Add Phoneme child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlPhoneme Child element. */ public function phoneme($words, $attributes = []): SsmlPhoneme { return $this->nest(new SsmlPhoneme($words, $attributes)); } /** * Add Prosody child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlProsody Child element. */ public function prosody($words, $attributes = []): SsmlProsody { return $this->nest(new SsmlProsody($words, $attributes)); } /** * Add Say-As child. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes * @return SsmlSayAs Child element. */ public function say_As($words, $attributes = []): SsmlSayAs { return $this->nest(new SsmlSayAs($words, $attributes)); } /** * Add Sub child. * * @param string $words Words to be substituted * @param array $attributes Optional attributes * @return SsmlSub Child element. */ public function sub($words, $attributes = []): SsmlSub { return $this->nest(new SsmlSub($words, $attributes)); } /** * Add Role attribute. * * @param string $role Customize the pronunciation of words by specifying the * word’s part of speech or alternate meaning */ public function setRole($role): self { return $this->setAttribute('role', $role); } } sdk/src/Twilio/TwiML/Voice/Task.php 0000644 00000001620 15021223077 0013035 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Task extends TwiML { /** * Task constructor. * * @param string $body TaskRouter task attributes * @param array $attributes Optional attributes */ public function __construct($body, $attributes = []) { parent::__construct('Task', $body, $attributes); } /** * Add Priority attribute. * * @param int $priority Task priority */ public function setPriority($priority): self { return $this->setAttribute('priority', $priority); } /** * Add Timeout attribute. * * @param int $timeout Timeout associated with task */ public function setTimeout($timeout): self { return $this->setAttribute('timeout', $timeout); } } sdk/src/Twilio/TwiML/Voice/SsmlP.php 0000644 00000006045 15021223077 0013177 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlP extends TwiML { /** * SsmlP constructor. * * @param string $words Words to speak */ public function __construct($words) { parent::__construct('p', $words); } /** * Add Break child. * * @param array $attributes Optional attributes * @return SsmlBreak Child element. */ public function break_($attributes = []): SsmlBreak { return $this->nest(new SsmlBreak($attributes)); } /** * Add Emphasis child. * * @param string $words Words to emphasize * @param array $attributes Optional attributes * @return SsmlEmphasis Child element. */ public function emphasis($words, $attributes = []): SsmlEmphasis { return $this->nest(new SsmlEmphasis($words, $attributes)); } /** * Add Lang child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlLang Child element. */ public function lang($words, $attributes = []): SsmlLang { return $this->nest(new SsmlLang($words, $attributes)); } /** * Add Phoneme child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlPhoneme Child element. */ public function phoneme($words, $attributes = []): SsmlPhoneme { return $this->nest(new SsmlPhoneme($words, $attributes)); } /** * Add Prosody child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlProsody Child element. */ public function prosody($words, $attributes = []): SsmlProsody { return $this->nest(new SsmlProsody($words, $attributes)); } /** * Add S child. * * @param string $words Words to speak * @return SsmlS Child element. */ public function s($words): SsmlS { return $this->nest(new SsmlS($words)); } /** * Add Say-As child. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes * @return SsmlSayAs Child element. */ public function say_As($words, $attributes = []): SsmlSayAs { return $this->nest(new SsmlSayAs($words, $attributes)); } /** * Add Sub child. * * @param string $words Words to be substituted * @param array $attributes Optional attributes * @return SsmlSub Child element. */ public function sub($words, $attributes = []): SsmlSub { return $this->nest(new SsmlSub($words, $attributes)); } /** * Add W child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlW Child element. */ public function w($words, $attributes = []): SsmlW { return $this->nest(new SsmlW($words, $attributes)); } } sdk/src/Twilio/TwiML/Voice/Queue.php 0000644 00000002604 15021223077 0013222 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Queue extends TwiML { /** * Queue constructor. * * @param string $name Queue name * @param array $attributes Optional attributes */ public function __construct($name, $attributes = []) { parent::__construct('Queue', $name, $attributes); } /** * Add Url attribute. * * @param string $url Action URL */ public function setUrl($url): self { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add ReservationSid attribute. * * @param string $reservationSid TaskRouter Reservation SID */ public function setReservationSid($reservationSid): self { return $this->setAttribute('reservationSid', $reservationSid); } /** * Add PostWorkActivitySid attribute. * * @param string $postWorkActivitySid TaskRouter Activity SID */ public function setPostWorkActivitySid($postWorkActivitySid): self { return $this->setAttribute('postWorkActivitySid', $postWorkActivitySid); } } sdk/src/Twilio/TwiML/Voice/Number.php 0000644 00000011741 15021223077 0013370 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Number extends TwiML { /** * Number constructor. * * @param string $phoneNumber Phone Number to dial * @param array $attributes Optional attributes */ public function __construct($phoneNumber, $attributes = []) { parent::__construct('Number', $phoneNumber, $attributes); } /** * Add SendDigits attribute. * * @param string $sendDigits DTMF tones to play when the call is answered */ public function setSendDigits($sendDigits): self { return $this->setAttribute('sendDigits', $sendDigits); } /** * Add Url attribute. * * @param string $url TwiML URL */ public function setUrl($url): self { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method TwiML URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add StatusCallbackEvent attribute. * * @param string[] $statusCallbackEvent Events to call status callback */ public function setStatusCallbackEvent($statusCallbackEvent): self { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status callback URL method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } /** * Add Byoc attribute. * * @param string $byoc BYOC trunk SID (Beta) */ public function setByoc($byoc): self { return $this->setAttribute('byoc', $byoc); } /** * Add MachineDetection attribute. * * @param string $machineDetection Enable machine detection or end of greeting * detection */ public function setMachineDetection($machineDetection): self { return $this->setAttribute('machineDetection', $machineDetection); } /** * Add AmdStatusCallbackMethod attribute. * * @param string $amdStatusCallbackMethod HTTP Method to use with * amd_status_callback */ public function setAmdStatusCallbackMethod($amdStatusCallbackMethod): self { return $this->setAttribute('amdStatusCallbackMethod', $amdStatusCallbackMethod); } /** * Add AmdStatusCallback attribute. * * @param string $amdStatusCallback The URL we should call to send amd status * information to your application */ public function setAmdStatusCallback($amdStatusCallback): self { return $this->setAttribute('amdStatusCallback', $amdStatusCallback); } /** * Add MachineDetectionTimeout attribute. * * @param int $machineDetectionTimeout Number of seconds to wait for machine * detection */ public function setMachineDetectionTimeout($machineDetectionTimeout): self { return $this->setAttribute('machineDetectionTimeout', $machineDetectionTimeout); } /** * Add MachineDetectionSpeechThreshold attribute. * * @param int $machineDetectionSpeechThreshold Number of milliseconds for * measuring stick for the length * of the speech activity */ public function setMachineDetectionSpeechThreshold($machineDetectionSpeechThreshold): self { return $this->setAttribute('machineDetectionSpeechThreshold', $machineDetectionSpeechThreshold); } /** * Add MachineDetectionSpeechEndThreshold attribute. * * @param int $machineDetectionSpeechEndThreshold Number of milliseconds of * silence after speech activity */ public function setMachineDetectionSpeechEndThreshold($machineDetectionSpeechEndThreshold): self { return $this->setAttribute('machineDetectionSpeechEndThreshold', $machineDetectionSpeechEndThreshold); } /** * Add MachineDetectionSilenceTimeout attribute. * * @param int $machineDetectionSilenceTimeout Number of milliseconds of initial * silence */ public function setMachineDetectionSilenceTimeout($machineDetectionSilenceTimeout): self { return $this->setAttribute('machineDetectionSilenceTimeout', $machineDetectionSilenceTimeout); } } sdk/src/Twilio/TwiML/Voice/Refer.php 0000644 00000002033 15021223077 0013175 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Refer extends TwiML { /** * Refer constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('Refer', null, $attributes); } /** * Add Sip child. * * @param string $sipUrl SIP URL * @return ReferSip Child element. */ public function sip($sipUrl): ReferSip { return $this->nest(new ReferSip($sipUrl)); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } } sdk/src/Twilio/TwiML/Voice/SsmlBreak.php 0000644 00000001714 15021223077 0014022 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlBreak extends TwiML { /** * SsmlBreak constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('break', null, $attributes); } /** * Add Strength attribute. * * @param string $strength Set a pause based on strength */ public function setStrength($strength): self { return $this->setAttribute('strength', $strength); } /** * Add Time attribute. * * @param string $time Set a pause to a specific length of time in seconds or * milliseconds, available values: [number]s, [number]ms */ public function setTime($time): self { return $this->setAttribute('time', $time); } } sdk/src/Twilio/TwiML/Voice/Stop.php 0000644 00000001477 15021223077 0013072 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Stop extends TwiML { /** * Stop constructor. */ public function __construct() { parent::__construct('Stop', null); } /** * Add Stream child. * * @param array $attributes Optional attributes * @return Stream Child element. */ public function stream($attributes = []): Stream { return $this->nest(new Stream($attributes)); } /** * Add Siprec child. * * @param array $attributes Optional attributes * @return Siprec Child element. */ public function siprec($attributes = []): Siprec { return $this->nest(new Siprec($attributes)); } } sdk/src/Twilio/TwiML/Voice/Sip.php 0000644 00000011631 15021223077 0012671 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Sip extends TwiML { /** * Sip constructor. * * @param string $sipUrl SIP URL * @param array $attributes Optional attributes */ public function __construct($sipUrl, $attributes = []) { parent::__construct('Sip', $sipUrl, $attributes); } /** * Add Username attribute. * * @param string $username SIP Username */ public function setUsername($username): self { return $this->setAttribute('username', $username); } /** * Add Password attribute. * * @param string $password SIP Password */ public function setPassword($password): self { return $this->setAttribute('password', $password); } /** * Add Url attribute. * * @param string $url Action URL */ public function setUrl($url): self { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add StatusCallbackEvent attribute. * * @param string[] $statusCallbackEvent Status callback events */ public function setStatusCallbackEvent($statusCallbackEvent): self { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status callback URL method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } /** * Add MachineDetection attribute. * * @param string $machineDetection Enable machine detection or end of greeting * detection */ public function setMachineDetection($machineDetection): self { return $this->setAttribute('machineDetection', $machineDetection); } /** * Add AmdStatusCallbackMethod attribute. * * @param string $amdStatusCallbackMethod HTTP Method to use with * amd_status_callback */ public function setAmdStatusCallbackMethod($amdStatusCallbackMethod): self { return $this->setAttribute('amdStatusCallbackMethod', $amdStatusCallbackMethod); } /** * Add AmdStatusCallback attribute. * * @param string $amdStatusCallback The URL we should call to send amd status * information to your application */ public function setAmdStatusCallback($amdStatusCallback): self { return $this->setAttribute('amdStatusCallback', $amdStatusCallback); } /** * Add MachineDetectionTimeout attribute. * * @param int $machineDetectionTimeout Number of seconds to wait for machine * detection */ public function setMachineDetectionTimeout($machineDetectionTimeout): self { return $this->setAttribute('machineDetectionTimeout', $machineDetectionTimeout); } /** * Add MachineDetectionSpeechThreshold attribute. * * @param int $machineDetectionSpeechThreshold Number of milliseconds for * measuring stick for the length * of the speech activity */ public function setMachineDetectionSpeechThreshold($machineDetectionSpeechThreshold): self { return $this->setAttribute('machineDetectionSpeechThreshold', $machineDetectionSpeechThreshold); } /** * Add MachineDetectionSpeechEndThreshold attribute. * * @param int $machineDetectionSpeechEndThreshold Number of milliseconds of * silence after speech activity */ public function setMachineDetectionSpeechEndThreshold($machineDetectionSpeechEndThreshold): self { return $this->setAttribute('machineDetectionSpeechEndThreshold', $machineDetectionSpeechEndThreshold); } /** * Add MachineDetectionSilenceTimeout attribute. * * @param int $machineDetectionSilenceTimeout Number of milliseconds of initial * silence */ public function setMachineDetectionSilenceTimeout($machineDetectionSilenceTimeout): self { return $this->setAttribute('machineDetectionSilenceTimeout', $machineDetectionSilenceTimeout); } } sdk/src/Twilio/TwiML/Voice/Identity.php 0000644 00000000670 15021223077 0013730 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Identity extends TwiML { /** * Identity constructor. * * @param string $clientIdentity Identity of the client to dial */ public function __construct($clientIdentity) { parent::__construct('Identity', $clientIdentity); } } sdk/src/Twilio/TwiML/Voice/SsmlLang.php 0000644 00000007063 15021223077 0013662 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlLang extends TwiML { /** * SsmlLang constructor. * * @param string $words Words to speak * @param array $attributes Optional attributes */ public function __construct($words, $attributes = []) { parent::__construct('lang', $words, $attributes); } /** * Add Break child. * * @param array $attributes Optional attributes * @return SsmlBreak Child element. */ public function break_($attributes = []): SsmlBreak { return $this->nest(new SsmlBreak($attributes)); } /** * Add Emphasis child. * * @param string $words Words to emphasize * @param array $attributes Optional attributes * @return SsmlEmphasis Child element. */ public function emphasis($words, $attributes = []): SsmlEmphasis { return $this->nest(new SsmlEmphasis($words, $attributes)); } /** * Add Lang child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlLang Child element. */ public function lang($words, $attributes = []): SsmlLang { return $this->nest(new SsmlLang($words, $attributes)); } /** * Add P child. * * @param string $words Words to speak * @return SsmlP Child element. */ public function p($words): SsmlP { return $this->nest(new SsmlP($words)); } /** * Add Phoneme child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlPhoneme Child element. */ public function phoneme($words, $attributes = []): SsmlPhoneme { return $this->nest(new SsmlPhoneme($words, $attributes)); } /** * Add Prosody child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlProsody Child element. */ public function prosody($words, $attributes = []): SsmlProsody { return $this->nest(new SsmlProsody($words, $attributes)); } /** * Add S child. * * @param string $words Words to speak * @return SsmlS Child element. */ public function s($words): SsmlS { return $this->nest(new SsmlS($words)); } /** * Add Say-As child. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes * @return SsmlSayAs Child element. */ public function say_As($words, $attributes = []): SsmlSayAs { return $this->nest(new SsmlSayAs($words, $attributes)); } /** * Add Sub child. * * @param string $words Words to be substituted * @param array $attributes Optional attributes * @return SsmlSub Child element. */ public function sub($words, $attributes = []): SsmlSub { return $this->nest(new SsmlSub($words, $attributes)); } /** * Add W child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlW Child element. */ public function w($words, $attributes = []): SsmlW { return $this->nest(new SsmlW($words, $attributes)); } /** * Add Xml:Lang attribute. * * @param string $xmlLang Specify the language */ public function setXmlLang($xmlLang): self { return $this->setAttribute('xml:Lang', $xmlLang); } } sdk/src/Twilio/TwiML/Voice/Conference.php 0000644 00000013361 15021223077 0014207 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Conference extends TwiML { /** * Conference constructor. * * @param string $name Conference name * @param array $attributes Optional attributes */ public function __construct($name, $attributes = []) { parent::__construct('Conference', $name, $attributes); } /** * Add Muted attribute. * * @param bool $muted Join the conference muted */ public function setMuted($muted): self { return $this->setAttribute('muted', $muted); } /** * Add Beep attribute. * * @param string $beep Play beep when joining */ public function setBeep($beep): self { return $this->setAttribute('beep', $beep); } /** * Add StartConferenceOnEnter attribute. * * @param bool $startConferenceOnEnter Start the conference on enter */ public function setStartConferenceOnEnter($startConferenceOnEnter): self { return $this->setAttribute('startConferenceOnEnter', $startConferenceOnEnter); } /** * Add EndConferenceOnExit attribute. * * @param bool $endConferenceOnExit End the conferenceon exit */ public function setEndConferenceOnExit($endConferenceOnExit): self { return $this->setAttribute('endConferenceOnExit', $endConferenceOnExit); } /** * Add WaitUrl attribute. * * @param string $waitUrl Wait URL */ public function setWaitUrl($waitUrl): self { return $this->setAttribute('waitUrl', $waitUrl); } /** * Add WaitMethod attribute. * * @param string $waitMethod Wait URL method */ public function setWaitMethod($waitMethod): self { return $this->setAttribute('waitMethod', $waitMethod); } /** * Add MaxParticipants attribute. * * @param int $maxParticipants Maximum number of participants */ public function setMaxParticipants($maxParticipants): self { return $this->setAttribute('maxParticipants', $maxParticipants); } /** * Add Record attribute. * * @param string $record Record the conference */ public function setRecord($record): self { return $this->setAttribute('record', $record); } /** * Add Region attribute. * * @param string $region Conference region */ public function setRegion($region): self { return $this->setAttribute('region', $region); } /** * Add Coach attribute. * * @param string $coach Call coach */ public function setCoach($coach): self { return $this->setAttribute('coach', $coach); } /** * Add Trim attribute. * * @param string $trim Trim the conference recording */ public function setTrim($trim): self { return $this->setAttribute('trim', $trim); } /** * Add StatusCallbackEvent attribute. * * @param string[] $statusCallbackEvent Events to call status callback URL */ public function setStatusCallbackEvent($statusCallbackEvent): self { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status callback URL method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } /** * Add RecordingStatusCallback attribute. * * @param string $recordingStatusCallback Recording status callback URL */ public function setRecordingStatusCallback($recordingStatusCallback): self { return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); } /** * Add RecordingStatusCallbackMethod attribute. * * @param string $recordingStatusCallbackMethod Recording status callback URL * method */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); } /** * Add RecordingStatusCallbackEvent attribute. * * @param string[] $recordingStatusCallbackEvent Recording status callback * events */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); } /** * Add EventCallbackUrl attribute. * * @param string $eventCallbackUrl Event callback URL */ public function setEventCallbackUrl($eventCallbackUrl): self { return $this->setAttribute('eventCallbackUrl', $eventCallbackUrl); } /** * Add JitterBufferSize attribute. * * @param string $jitterBufferSize Size of jitter buffer for participant */ public function setJitterBufferSize($jitterBufferSize): self { return $this->setAttribute('jitterBufferSize', $jitterBufferSize); } /** * Add ParticipantLabel attribute. * * @param string $participantLabel A label for participant */ public function setParticipantLabel($participantLabel): self { return $this->setAttribute('participantLabel', $participantLabel); } } sdk/src/Twilio/TwiML/Voice/Parameter.php 0000644 00000001533 15021223077 0014056 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Parameter extends TwiML { /** * Parameter constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('Parameter', null, $attributes); } /** * Add Name attribute. * * @param string $name The name of the custom parameter */ public function setName($name): self { return $this->setAttribute('name', $name); } /** * Add Value attribute. * * @param string $value The value of the custom parameter */ public function setValue($value): self { return $this->setAttribute('value', $value); } } sdk/src/Twilio/TwiML/Voice/Siprec.php 0000644 00000003620 15021223077 0013362 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Siprec extends TwiML { /** * Siprec constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('Siprec', null, $attributes); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = []): Parameter { return $this->nest(new Parameter($attributes)); } /** * Add Name attribute. * * @param string $name Friendly name given to SIPREC */ public function setName($name): self { return $this->setAttribute('name', $name); } /** * Add ConnectorName attribute. * * @param string $connectorName Unique name for Connector */ public function setConnectorName($connectorName): self { return $this->setAttribute('connectorName', $connectorName); } /** * Add Track attribute. * * @param string $track Track to be streamed to remote service */ public function setTrack($track): self { return $this->setAttribute('track', $track); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status Callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status Callback URL method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } } sdk/src/Twilio/TwiML/Voice/Enqueue.php 0000644 00000004135 15021223077 0013546 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Enqueue extends TwiML { /** * Enqueue constructor. * * @param string $name Friendly name * @param array $attributes Optional attributes */ public function __construct($name = null, $attributes = []) { parent::__construct('Enqueue', $name, $attributes); } /** * Add Task child. * * @param string $body TaskRouter task attributes * @param array $attributes Optional attributes * @return Task Child element. */ public function task($body, $attributes = []): Task { return $this->nest(new Task($body, $attributes)); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add MaxQueueSize attribute. * * @param int $maxQueueSize Maximum size of queue */ public function setMaxQueueSize($maxQueueSize): self { return $this->setAttribute('maxQueueSize', $maxQueueSize); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add WaitUrl attribute. * * @param string $waitUrl Wait URL */ public function setWaitUrl($waitUrl): self { return $this->setAttribute('waitUrl', $waitUrl); } /** * Add WaitUrlMethod attribute. * * @param string $waitUrlMethod Wait URL method */ public function setWaitUrlMethod($waitUrlMethod): self { return $this->setAttribute('waitUrlMethod', $waitUrlMethod); } /** * Add WorkflowSid attribute. * * @param string $workflowSid TaskRouter Workflow SID */ public function setWorkflowSid($workflowSid): self { return $this->setAttribute('workflowSid', $workflowSid); } } sdk/src/Twilio/TwiML/Voice/Gather.php 0000644 00000013407 15021223077 0013353 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Gather extends TwiML { /** * Gather constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('Gather', null, $attributes); } /** * Add Say child. * * @param string $message Message to say * @param array $attributes Optional attributes * @return Say Child element. */ public function say($message, $attributes = []): Say { return $this->nest(new Say($message, $attributes)); } /** * Add Pause child. * * @param array $attributes Optional attributes * @return Pause Child element. */ public function pause($attributes = []): Pause { return $this->nest(new Pause($attributes)); } /** * Add Play child. * * @param string $url Media URL * @param array $attributes Optional attributes * @return Play Child element. */ public function play($url = null, $attributes = []): Play { return $this->nest(new Play($url, $attributes)); } /** * Add Input attribute. * * @param string[] $input Input type Twilio should accept */ public function setInput($input): self { return $this->setAttribute('input', $input); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add Timeout attribute. * * @param int $timeout Time to wait to gather input */ public function setTimeout($timeout): self { return $this->setAttribute('timeout', $timeout); } /** * Add SpeechTimeout attribute. * * @param string $speechTimeout Time to wait to gather speech input and it * should be either auto or a positive integer. */ public function setSpeechTimeout($speechTimeout): self { return $this->setAttribute('speechTimeout', $speechTimeout); } /** * Add MaxSpeechTime attribute. * * @param int $maxSpeechTime Max allowed time for speech input */ public function setMaxSpeechTime($maxSpeechTime): self { return $this->setAttribute('maxSpeechTime', $maxSpeechTime); } /** * Add ProfanityFilter attribute. * * @param bool $profanityFilter Profanity Filter on speech */ public function setProfanityFilter($profanityFilter): self { return $this->setAttribute('profanityFilter', $profanityFilter); } /** * Add FinishOnKey attribute. * * @param string $finishOnKey Finish gather on key */ public function setFinishOnKey($finishOnKey): self { return $this->setAttribute('finishOnKey', $finishOnKey); } /** * Add NumDigits attribute. * * @param int $numDigits Number of digits to collect */ public function setNumDigits($numDigits): self { return $this->setAttribute('numDigits', $numDigits); } /** * Add PartialResultCallback attribute. * * @param string $partialResultCallback Partial result callback URL */ public function setPartialResultCallback($partialResultCallback): self { return $this->setAttribute('partialResultCallback', $partialResultCallback); } /** * Add PartialResultCallbackMethod attribute. * * @param string $partialResultCallbackMethod Partial result callback URL method */ public function setPartialResultCallbackMethod($partialResultCallbackMethod): self { return $this->setAttribute('partialResultCallbackMethod', $partialResultCallbackMethod); } /** * Add Language attribute. * * @param string $language Language to use */ public function setLanguage($language): self { return $this->setAttribute('language', $language); } /** * Add Hints attribute. * * @param string $hints Speech recognition hints */ public function setHints($hints): self { return $this->setAttribute('hints', $hints); } /** * Add BargeIn attribute. * * @param bool $bargeIn Stop playing media upon speech */ public function setBargeIn($bargeIn): self { return $this->setAttribute('bargeIn', $bargeIn); } /** * Add Debug attribute. * * @param bool $debug Allow debug for gather */ public function setDebug($debug): self { return $this->setAttribute('debug', $debug); } /** * Add ActionOnEmptyResult attribute. * * @param bool $actionOnEmptyResult Force webhook to the action URL event if * there is no input */ public function setActionOnEmptyResult($actionOnEmptyResult): self { return $this->setAttribute('actionOnEmptyResult', $actionOnEmptyResult); } /** * Add SpeechModel attribute. * * @param string $speechModel Specify the model that is best suited for your * use case */ public function setSpeechModel($speechModel): self { return $this->setAttribute('speechModel', $speechModel); } /** * Add Enhanced attribute. * * @param bool $enhanced Use enhanced speech model */ public function setEnhanced($enhanced): self { return $this->setAttribute('enhanced', $enhanced); } } sdk/src/Twilio/TwiML/Voice/Application.php 0000644 00000005562 15021223077 0014407 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Application extends TwiML { /** * Application constructor. * * @param string $applicationSid Application sid * @param array $attributes Optional attributes */ public function __construct($applicationSid = null, $attributes = []) { parent::__construct('Application', $applicationSid, $attributes); } /** * Add ApplicationSid child. * * @param string $sid Application sid to dial * @return ApplicationSid Child element. */ public function applicationSid($sid): ApplicationSid { return $this->nest(new ApplicationSid($sid)); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = []): Parameter { return $this->nest(new Parameter($attributes)); } /** * Add Url attribute. * * @param string $url TwiML URL */ public function setUrl($url): self { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method TwiML URL Method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add StatusCallbackEvent attribute. * * @param string[] $statusCallbackEvent Events to trigger status callback */ public function setStatusCallbackEvent($statusCallbackEvent): self { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status Callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status Callback URL Method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } /** * Add CustomerId attribute. * * @param string $customerId Identity of the customer calling application */ public function setCustomerId($customerId): self { return $this->setAttribute('customerId', $customerId); } /** * Add CopyParentTo attribute. * * @param bool $copyParentTo Copy parent call To field to called application * side, otherwise use the application sid as To field */ public function setCopyParentTo($copyParentTo): self { return $this->setAttribute('copyParentTo', $copyParentTo); } } sdk/src/Twilio/TwiML/Voice/Echo_.php 0000644 00000000510 15021223077 0013145 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Echo_ extends TwiML { /** * Echo constructor. */ public function __construct() { parent::__construct('Echo', null); } } sdk/src/Twilio/TwiML/Voice/Sms.php 0000644 00000002776 15021223077 0012712 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Sms extends TwiML { /** * Sms constructor. * * @param string $message Message body * @param array $attributes Optional attributes */ public function __construct($message, $attributes = []) { parent::__construct('Sms', $message, $attributes); } /** * Add To attribute. * * @param string $to Number to send message to */ public function setTo($to): self { return $this->setAttribute('to', $to); } /** * Add From attribute. * * @param string $from Number to send message from */ public function setFrom($from): self { return $this->setAttribute('from', $from); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } } sdk/src/Twilio/TwiML/Voice/Room.php 0000644 00000001463 15021223077 0013054 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Room extends TwiML { /** * Room constructor. * * @param string $name Room name * @param array $attributes Optional attributes */ public function __construct($name, $attributes = []) { parent::__construct('Room', $name, $attributes); } /** * Add ParticipantIdentity attribute. * * @param string $participantIdentity Participant identity when connecting to * the Room */ public function setParticipantIdentity($participantIdentity): self { return $this->setAttribute('participantIdentity', $participantIdentity); } } sdk/src/Twilio/TwiML/Voice/Dial.php 0000644 00000016605 15021223077 0013015 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Dial extends TwiML { /** * Dial constructor. * * @param string $number Phone number to dial * @param array $attributes Optional attributes */ public function __construct($number = null, $attributes = []) { parent::__construct('Dial', $number, $attributes); } /** * Add Client child. * * @param string $identity Client identity * @param array $attributes Optional attributes * @return Client Child element. */ public function client($identity = null, $attributes = []): Client { return $this->nest(new Client($identity, $attributes)); } /** * Add Conference child. * * @param string $name Conference name * @param array $attributes Optional attributes * @return Conference Child element. */ public function conference($name, $attributes = []): Conference { return $this->nest(new Conference($name, $attributes)); } /** * Add Number child. * * @param string $phoneNumber Phone Number to dial * @param array $attributes Optional attributes * @return Number Child element. */ public function number($phoneNumber, $attributes = []): Number { return $this->nest(new Number($phoneNumber, $attributes)); } /** * Add Queue child. * * @param string $name Queue name * @param array $attributes Optional attributes * @return Queue Child element. */ public function queue($name, $attributes = []): Queue { return $this->nest(new Queue($name, $attributes)); } /** * Add Sim child. * * @param string $simSid SIM SID * @return Sim Child element. */ public function sim($simSid): Sim { return $this->nest(new Sim($simSid)); } /** * Add Sip child. * * @param string $sipUrl SIP URL * @param array $attributes Optional attributes * @return Sip Child element. */ public function sip($sipUrl, $attributes = []): Sip { return $this->nest(new Sip($sipUrl, $attributes)); } /** * Add Application child. * * @param string $applicationSid Application sid * @param array $attributes Optional attributes * @return Application Child element. */ public function application($applicationSid = null, $attributes = []): Application { return $this->nest(new Application($applicationSid, $attributes)); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add Timeout attribute. * * @param int $timeout Time to wait for answer */ public function setTimeout($timeout): self { return $this->setAttribute('timeout', $timeout); } /** * Add HangupOnStar attribute. * * @param bool $hangupOnStar Hangup call on star press */ public function setHangupOnStar($hangupOnStar): self { return $this->setAttribute('hangupOnStar', $hangupOnStar); } /** * Add TimeLimit attribute. * * @param int $timeLimit Max time length */ public function setTimeLimit($timeLimit): self { return $this->setAttribute('timeLimit', $timeLimit); } /** * Add CallerId attribute. * * @param string $callerId Caller ID to display */ public function setCallerId($callerId): self { return $this->setAttribute('callerId', $callerId); } /** * Add Record attribute. * * @param string $record Record the call */ public function setRecord($record): self { return $this->setAttribute('record', $record); } /** * Add Trim attribute. * * @param string $trim Trim the recording */ public function setTrim($trim): self { return $this->setAttribute('trim', $trim); } /** * Add RecordingStatusCallback attribute. * * @param string $recordingStatusCallback Recording status callback URL */ public function setRecordingStatusCallback($recordingStatusCallback): self { return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); } /** * Add RecordingStatusCallbackMethod attribute. * * @param string $recordingStatusCallbackMethod Recording status callback URL * method */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); } /** * Add RecordingStatusCallbackEvent attribute. * * @param string[] $recordingStatusCallbackEvent Recording status callback * events */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); } /** * Add AnswerOnBridge attribute. * * @param bool $answerOnBridge Preserve the ringing behavior of the inbound * call until the Dialed call picks up */ public function setAnswerOnBridge($answerOnBridge): self { return $this->setAttribute('answerOnBridge', $answerOnBridge); } /** * Add RingTone attribute. * * @param string $ringTone Ringtone allows you to override the ringback tone * that Twilio will play back to the caller while * executing the Dial */ public function setRingTone($ringTone): self { return $this->setAttribute('ringTone', $ringTone); } /** * Add RecordingTrack attribute. * * @param string $recordingTrack To indicate which audio track should be * recorded */ public function setRecordingTrack($recordingTrack): self { return $this->setAttribute('recordingTrack', $recordingTrack); } /** * Add Sequential attribute. * * @param bool $sequential Used to determine if child TwiML nouns should be * dialed in order, one after the other (sequential) or * dial all at once (parallel). Default is false, * parallel */ public function setSequential($sequential): self { return $this->setAttribute('sequential', $sequential); } /** * Add ReferUrl attribute. * * @param string $referUrl Webhook that will receive future SIP REFER requests */ public function setReferUrl($referUrl): self { return $this->setAttribute('referUrl', $referUrl); } /** * Add ReferMethod attribute. * * @param string $referMethod The HTTP method to use for the refer Webhook */ public function setReferMethod($referMethod): self { return $this->setAttribute('referMethod', $referMethod); } } sdk/src/Twilio/TwiML/Voice/Hangup.php 0000644 00000001130 15021223077 0013351 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Hangup extends TwiML { /** * Hangup constructor. */ public function __construct() { parent::__construct('Hangup', null); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = []): Parameter { return $this->nest(new Parameter($attributes)); } } sdk/src/Twilio/TwiML/Voice/SsmlSayAs.php 0000644 00000002007 15021223077 0014012 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlSayAs extends TwiML { /** * SsmlSayAs constructor. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes */ public function __construct($words, $attributes = []) { parent::__construct('say-as', $words, $attributes); } /** * Add Interpret-As attribute. * * @param string $interpretAs Specify the type of words are spoken */ public function setInterpretAs($interpretAs): self { return $this->setAttribute('interpret-as', $interpretAs); } /** * Add Format attribute. * * @param string $format Specify the format of the date when interpret-as is * set to date */ public function setFormat($format): self { return $this->setAttribute('format', $format); } } sdk/src/Twilio/TwiML/Voice/Say.php 0000644 00000007670 15021223077 0012702 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Say extends TwiML { /** * Say constructor. * * @param string $message Message to say * @param array $attributes Optional attributes */ public function __construct($message, $attributes = []) { parent::__construct('Say', $message, $attributes); } /** * Add Break child. * * @param array $attributes Optional attributes * @return SsmlBreak Child element. */ public function break_($attributes = []): SsmlBreak { return $this->nest(new SsmlBreak($attributes)); } /** * Add Emphasis child. * * @param string $words Words to emphasize * @param array $attributes Optional attributes * @return SsmlEmphasis Child element. */ public function emphasis($words, $attributes = []): SsmlEmphasis { return $this->nest(new SsmlEmphasis($words, $attributes)); } /** * Add Lang child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlLang Child element. */ public function lang($words, $attributes = []): SsmlLang { return $this->nest(new SsmlLang($words, $attributes)); } /** * Add P child. * * @param string $words Words to speak * @return SsmlP Child element. */ public function p($words): SsmlP { return $this->nest(new SsmlP($words)); } /** * Add Phoneme child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlPhoneme Child element. */ public function phoneme($words, $attributes = []): SsmlPhoneme { return $this->nest(new SsmlPhoneme($words, $attributes)); } /** * Add Prosody child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlProsody Child element. */ public function prosody($words, $attributes = []): SsmlProsody { return $this->nest(new SsmlProsody($words, $attributes)); } /** * Add S child. * * @param string $words Words to speak * @return SsmlS Child element. */ public function s($words): SsmlS { return $this->nest(new SsmlS($words)); } /** * Add Say-As child. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes * @return SsmlSayAs Child element. */ public function say_As($words, $attributes = []): SsmlSayAs { return $this->nest(new SsmlSayAs($words, $attributes)); } /** * Add Sub child. * * @param string $words Words to be substituted * @param array $attributes Optional attributes * @return SsmlSub Child element. */ public function sub($words, $attributes = []): SsmlSub { return $this->nest(new SsmlSub($words, $attributes)); } /** * Add W child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlW Child element. */ public function w($words, $attributes = []): SsmlW { return $this->nest(new SsmlW($words, $attributes)); } /** * Add Voice attribute. * * @param string $voice Voice to use */ public function setVoice($voice): self { return $this->setAttribute('voice', $voice); } /** * Add Loop attribute. * * @param int $loop Times to loop message */ public function setLoop($loop): self { return $this->setAttribute('loop', $loop); } /** * Add Language attribute. * * @param string $language Message language */ public function setLanguage($language): self { return $this->setAttribute('language', $language); } } sdk/src/Twilio/TwiML/Voice/SsmlSub.php 0000644 00000001432 15021223077 0013524 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlSub extends TwiML { /** * SsmlSub constructor. * * @param string $words Words to be substituted * @param array $attributes Optional attributes */ public function __construct($words, $attributes = []) { parent::__construct('sub', $words, $attributes); } /** * Add Alias attribute. * * @param string $alias Substitute a different word (or pronunciation) for * selected text such as an acronym or abbreviation */ public function setAlias($alias): self { return $this->setAttribute('alias', $alias); } } sdk/src/Twilio/TwiML/Voice/ApplicationSid.php 0000644 00000000642 15021223077 0015041 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class ApplicationSid extends TwiML { /** * ApplicationSid constructor. * * @param string $sid Application sid to dial */ public function __construct($sid) { parent::__construct('ApplicationSid', $sid); } } sdk/src/Twilio/TwiML/Voice/SsmlPhoneme.php 0000644 00000001643 15021223077 0014372 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlPhoneme extends TwiML { /** * SsmlPhoneme constructor. * * @param string $words Words to speak * @param array $attributes Optional attributes */ public function __construct($words, $attributes = []) { parent::__construct('phoneme', $words, $attributes); } /** * Add Alphabet attribute. * * @param string $alphabet Specify the phonetic alphabet */ public function setAlphabet($alphabet): self { return $this->setAttribute('alphabet', $alphabet); } /** * Add Ph attribute. * * @param string $ph Specifiy the phonetic symbols for pronunciation */ public function setPh($ph): self { return $this->setAttribute('ph', $ph); } } sdk/src/Twilio/TwiML/Voice/Pause.php 0000644 00000001170 15021223077 0013210 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Pause extends TwiML { /** * Pause constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('Pause', null, $attributes); } /** * Add Length attribute. * * @param int $length Length in seconds to pause */ public function setLength($length): self { return $this->setAttribute('length', $length); } } sdk/src/Twilio/TwiML/Voice/Start.php 0000644 00000002463 15021223077 0013236 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Start extends TwiML { /** * Start constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('Start', null, $attributes); } /** * Add Stream child. * * @param array $attributes Optional attributes * @return Stream Child element. */ public function stream($attributes = []): Stream { return $this->nest(new Stream($attributes)); } /** * Add Siprec child. * * @param array $attributes Optional attributes * @return Siprec Child element. */ public function siprec($attributes = []): Siprec { return $this->nest(new Siprec($attributes)); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } } sdk/src/Twilio/TwiML/Voice/Record.php 0000644 00000006720 15021223077 0013357 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Record extends TwiML { /** * Record constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('Record', null, $attributes); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add Timeout attribute. * * @param int $timeout Timeout to begin recording */ public function setTimeout($timeout): self { return $this->setAttribute('timeout', $timeout); } /** * Add FinishOnKey attribute. * * @param string $finishOnKey Finish recording on key */ public function setFinishOnKey($finishOnKey): self { return $this->setAttribute('finishOnKey', $finishOnKey); } /** * Add MaxLength attribute. * * @param int $maxLength Max time to record in seconds */ public function setMaxLength($maxLength): self { return $this->setAttribute('maxLength', $maxLength); } /** * Add PlayBeep attribute. * * @param bool $playBeep Play beep */ public function setPlayBeep($playBeep): self { return $this->setAttribute('playBeep', $playBeep); } /** * Add Trim attribute. * * @param string $trim Trim the recording */ public function setTrim($trim): self { return $this->setAttribute('trim', $trim); } /** * Add RecordingStatusCallback attribute. * * @param string $recordingStatusCallback Status callback URL */ public function setRecordingStatusCallback($recordingStatusCallback): self { return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); } /** * Add RecordingStatusCallbackMethod attribute. * * @param string $recordingStatusCallbackMethod Status callback URL method */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); } /** * Add RecordingStatusCallbackEvent attribute. * * @param string[] $recordingStatusCallbackEvent Recording status callback * events */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); } /** * Add Transcribe attribute. * * @param bool $transcribe Transcribe the recording */ public function setTranscribe($transcribe): self { return $this->setAttribute('transcribe', $transcribe); } /** * Add TranscribeCallback attribute. * * @param string $transcribeCallback Transcribe callback URL */ public function setTranscribeCallback($transcribeCallback): self { return $this->setAttribute('transcribeCallback', $transcribeCallback); } } sdk/src/Twilio/TwiML/Voice/Stream.php 0000644 00000004174 15021223077 0013375 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Stream extends TwiML { /** * Stream constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('Stream', null, $attributes); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = []): Parameter { return $this->nest(new Parameter($attributes)); } /** * Add Name attribute. * * @param string $name Friendly name given to the Stream */ public function setName($name): self { return $this->setAttribute('name', $name); } /** * Add ConnectorName attribute. * * @param string $connectorName Unique name for Stream Connector */ public function setConnectorName($connectorName): self { return $this->setAttribute('connectorName', $connectorName); } /** * Add Url attribute. * * @param string $url URL of the remote service where the Stream is routed */ public function setUrl($url): self { return $this->setAttribute('url', $url); } /** * Add Track attribute. * * @param string $track Track to be streamed to remote service */ public function setTrack($track): self { return $this->setAttribute('track', $track); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status Callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status Callback URL method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } } sdk/src/Twilio/TwiML/Voice/VirtualAgent.php 0000644 00000005014 15021223077 0014541 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class VirtualAgent extends TwiML { /** * VirtualAgent constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('VirtualAgent', null, $attributes); } /** * Add Config child. * * @param array $attributes Optional attributes * @return Config Child element. */ public function config($attributes = []): Config { return $this->nest(new Config($attributes)); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = []): Parameter { return $this->nest(new Parameter($attributes)); } /** * Add ConnectorName attribute. * * @param string $connectorName Defines the conversation profile Dialogflow * needs to use */ public function setConnectorName($connectorName): self { return $this->setAttribute('connectorName', $connectorName); } /** * Add Language attribute. * * @param string $language Language to be used by Dialogflow to transcribe * speech */ public function setLanguage($language): self { return $this->setAttribute('language', $language); } /** * Add SentimentAnalysis attribute. * * @param bool $sentimentAnalysis Whether sentiment analysis needs to be * enabled or not */ public function setSentimentAnalysis($sentimentAnalysis): self { return $this->setAttribute('sentimentAnalysis', $sentimentAnalysis); } /** * Add StatusCallback attribute. * * @param string $statusCallback URL to post status callbacks from Twilio */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod HTTP method to use when requesting the * status callback URL */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } } sdk/src/Twilio/TwiML/Voice/Pay.php 0000644 00000013532 15021223077 0012671 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Pay extends TwiML { /** * Pay constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('Pay', null, $attributes); } /** * Add Prompt child. * * @param array $attributes Optional attributes * @return Prompt Child element. */ public function prompt($attributes = []): Prompt { return $this->nest(new Prompt($attributes)); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = []): Parameter { return $this->nest(new Parameter($attributes)); } /** * Add Input attribute. * * @param string $input Input type Twilio should accept */ public function setInput($input): self { return $this->setAttribute('input', $input); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add BankAccountType attribute. * * @param string $bankAccountType Bank account type for ach transactions. If * set, payment method attribute must be * provided and value should be set to * ach-debit. defaults to consumer-checking */ public function setBankAccountType($bankAccountType): self { return $this->setAttribute('bankAccountType', $bankAccountType); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status callback method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } /** * Add Timeout attribute. * * @param int $timeout Time to wait to gather input */ public function setTimeout($timeout): self { return $this->setAttribute('timeout', $timeout); } /** * Add MaxAttempts attribute. * * @param int $maxAttempts Maximum number of allowed retries when gathering * input */ public function setMaxAttempts($maxAttempts): self { return $this->setAttribute('maxAttempts', $maxAttempts); } /** * Add SecurityCode attribute. * * @param bool $securityCode Prompt for security code */ public function setSecurityCode($securityCode): self { return $this->setAttribute('securityCode', $securityCode); } /** * Add PostalCode attribute. * * @param string $postalCode Prompt for postal code and it should be true/false * or default postal code */ public function setPostalCode($postalCode): self { return $this->setAttribute('postalCode', $postalCode); } /** * Add MinPostalCodeLength attribute. * * @param int $minPostalCodeLength Prompt for minimum postal code length */ public function setMinPostalCodeLength($minPostalCodeLength): self { return $this->setAttribute('minPostalCodeLength', $minPostalCodeLength); } /** * Add PaymentConnector attribute. * * @param string $paymentConnector Unique name for payment connector */ public function setPaymentConnector($paymentConnector): self { return $this->setAttribute('paymentConnector', $paymentConnector); } /** * Add PaymentMethod attribute. * * @param string $paymentMethod Payment method to be used. defaults to * credit-card */ public function setPaymentMethod($paymentMethod): self { return $this->setAttribute('paymentMethod', $paymentMethod); } /** * Add TokenType attribute. * * @param string $tokenType Type of token */ public function setTokenType($tokenType): self { return $this->setAttribute('tokenType', $tokenType); } /** * Add ChargeAmount attribute. * * @param string $chargeAmount Amount to process. If value is greater than 0 * then make the payment else create a payment token */ public function setChargeAmount($chargeAmount): self { return $this->setAttribute('chargeAmount', $chargeAmount); } /** * Add Currency attribute. * * @param string $currency Currency of the amount attribute */ public function setCurrency($currency): self { return $this->setAttribute('currency', $currency); } /** * Add Description attribute. * * @param string $description Details regarding the payment */ public function setDescription($description): self { return $this->setAttribute('description', $description); } /** * Add ValidCardTypes attribute. * * @param string[] $validCardTypes Comma separated accepted card types */ public function setValidCardTypes($validCardTypes): self { return $this->setAttribute('validCardTypes', $validCardTypes); } /** * Add Language attribute. * * @param string $language Language to use */ public function setLanguage($language): self { return $this->setAttribute('language', $language); } } sdk/src/Twilio/TwiML/Voice/Autopilot.php 0000644 00000000645 15021223077 0014121 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Autopilot extends TwiML { /** * Autopilot constructor. * * @param string $name Autopilot assistant sid or unique name */ public function __construct($name) { parent::__construct('Autopilot', $name); } } sdk/src/Twilio/TwiML/Voice/Connect.php 0000644 00000004236 15021223077 0013532 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Connect extends TwiML { /** * Connect constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('Connect', null, $attributes); } /** * Add Room child. * * @param string $name Room name * @param array $attributes Optional attributes * @return Room Child element. */ public function room($name, $attributes = []): Room { return $this->nest(new Room($name, $attributes)); } /** * Add Autopilot child. * * @param string $name Autopilot assistant sid or unique name * @return Autopilot Child element. */ public function autopilot($name): Autopilot { return $this->nest(new Autopilot($name)); } /** * Add Stream child. * * @param array $attributes Optional attributes * @return Stream Child element. */ public function stream($attributes = []): Stream { return $this->nest(new Stream($attributes)); } /** * Add VirtualAgent child. * * @param array $attributes Optional attributes * @return VirtualAgent Child element. */ public function virtualAgent($attributes = []): VirtualAgent { return $this->nest(new VirtualAgent($attributes)); } /** * Add Conversation child. * * @param array $attributes Optional attributes * @return Conversation Child element. */ public function conversation($attributes = []): Conversation { return $this->nest(new Conversation($attributes)); } /** * Add Action attribute. * * @param string $action Action URL */ public function setAction($action): self { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } } sdk/src/Twilio/TwiML/Voice/Conversation.php 0000644 00000010414 15021223077 0014606 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Conversation extends TwiML { /** * Conversation constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('Conversation', null, $attributes); } /** * Add ServiceInstanceSid attribute. * * @param string $serviceInstanceSid Service instance Sid */ public function setServiceInstanceSid($serviceInstanceSid): self { return $this->setAttribute('serviceInstanceSid', $serviceInstanceSid); } /** * Add InboundAutocreation attribute. * * @param bool $inboundAutocreation Inbound autocreation */ public function setInboundAutocreation($inboundAutocreation): self { return $this->setAttribute('inboundAutocreation', $inboundAutocreation); } /** * Add RoutingAssignmentTimeout attribute. * * @param int $routingAssignmentTimeout Routing assignment timeout */ public function setRoutingAssignmentTimeout($routingAssignmentTimeout): self { return $this->setAttribute('routingAssignmentTimeout', $routingAssignmentTimeout); } /** * Add InboundTimeout attribute. * * @param int $inboundTimeout Inbound timeout */ public function setInboundTimeout($inboundTimeout): self { return $this->setAttribute('inboundTimeout', $inboundTimeout); } /** * Add Url attribute. * * @param string $url TwiML URL */ public function setUrl($url): self { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method TwiML URL method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add Record attribute. * * @param string $record Record */ public function setRecord($record): self { return $this->setAttribute('record', $record); } /** * Add Trim attribute. * * @param string $trim Trim */ public function setTrim($trim): self { return $this->setAttribute('trim', $trim); } /** * Add RecordingStatusCallback attribute. * * @param string $recordingStatusCallback Recording status callback URL */ public function setRecordingStatusCallback($recordingStatusCallback): self { return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); } /** * Add RecordingStatusCallbackMethod attribute. * * @param string $recordingStatusCallbackMethod Recording status callback URL * method */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); } /** * Add RecordingStatusCallbackEvent attribute. * * @param string[] $recordingStatusCallbackEvent Recording status callback * events */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status callback URL method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } /** * Add StatusCallbackEvent attribute. * * @param string[] $statusCallbackEvent Events to call status callback URL */ public function setStatusCallbackEvent($statusCallbackEvent): self { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } } sdk/src/Twilio/TwiML/Voice/Client.php 0000644 00000004365 15021223077 0013362 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Client extends TwiML { /** * Client constructor. * * @param string $identity Client identity * @param array $attributes Optional attributes */ public function __construct($identity = null, $attributes = []) { parent::__construct('Client', $identity, $attributes); } /** * Add Identity child. * * @param string $clientIdentity Identity of the client to dial * @return Identity Child element. */ public function identity($clientIdentity): Identity { return $this->nest(new Identity($clientIdentity)); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = []): Parameter { return $this->nest(new Parameter($attributes)); } /** * Add Url attribute. * * @param string $url Client URL */ public function setUrl($url): self { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method Client URL Method */ public function setMethod($method): self { return $this->setAttribute('method', $method); } /** * Add StatusCallbackEvent attribute. * * @param string[] $statusCallbackEvent Events to trigger status callback */ public function setStatusCallbackEvent($statusCallbackEvent): self { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status Callback URL */ public function setStatusCallback($statusCallback): self { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status Callback URL Method */ public function setStatusCallbackMethod($statusCallbackMethod): self { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } } sdk/src/Twilio/TwiML/Voice/SsmlS.php 0000644 00000005516 15021223077 0013204 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlS extends TwiML { /** * SsmlS constructor. * * @param string $words Words to speak */ public function __construct($words) { parent::__construct('s', $words); } /** * Add Break child. * * @param array $attributes Optional attributes * @return SsmlBreak Child element. */ public function break_($attributes = []): SsmlBreak { return $this->nest(new SsmlBreak($attributes)); } /** * Add Emphasis child. * * @param string $words Words to emphasize * @param array $attributes Optional attributes * @return SsmlEmphasis Child element. */ public function emphasis($words, $attributes = []): SsmlEmphasis { return $this->nest(new SsmlEmphasis($words, $attributes)); } /** * Add Lang child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlLang Child element. */ public function lang($words, $attributes = []): SsmlLang { return $this->nest(new SsmlLang($words, $attributes)); } /** * Add Phoneme child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlPhoneme Child element. */ public function phoneme($words, $attributes = []): SsmlPhoneme { return $this->nest(new SsmlPhoneme($words, $attributes)); } /** * Add Prosody child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlProsody Child element. */ public function prosody($words, $attributes = []): SsmlProsody { return $this->nest(new SsmlProsody($words, $attributes)); } /** * Add Say-As child. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes * @return SsmlSayAs Child element. */ public function say_As($words, $attributes = []): SsmlSayAs { return $this->nest(new SsmlSayAs($words, $attributes)); } /** * Add Sub child. * * @param string $words Words to be substituted * @param array $attributes Optional attributes * @return SsmlSub Child element. */ public function sub($words, $attributes = []): SsmlSub { return $this->nest(new SsmlSub($words, $attributes)); } /** * Add W child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlW Child element. */ public function w($words, $attributes = []): SsmlW { return $this->nest(new SsmlW($words, $attributes)); } } sdk/src/Twilio/TwiML/Voice/Reject.php 0000644 00000001577 15021223077 0013362 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Reject extends TwiML { /** * Reject constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = []) { parent::__construct('Reject', null, $attributes); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = []): Parameter { return $this->nest(new Parameter($attributes)); } /** * Add Reason attribute. * * @param string $reason Rejection reason */ public function setReason($reason): self { return $this->setAttribute('reason', $reason); } } sdk/src/Twilio/TwiML/FaxResponse.php 0000644 00000001107 15021223077 0013323 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML; class FaxResponse extends TwiML { /** * FaxResponse constructor. */ public function __construct() { parent::__construct('Response', null); } /** * Add Receive child. * * @param array $attributes Optional attributes * @return Fax\Receive Child element. */ public function receive($attributes = []): Fax\Receive { return $this->nest(new Fax\Receive($attributes)); } } sdk/src/Twilio/TwiML/MessagingResponse.php 0000644 00000001762 15021223077 0014531 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML; class MessagingResponse extends TwiML { /** * MessagingResponse constructor. */ public function __construct() { parent::__construct('Response', null); } /** * Add Message child. * * @param string $body Message Body * @param array $attributes Optional attributes * @return Messaging\Message Child element. */ public function message($body, $attributes = []): Messaging\Message { return $this->nest(new Messaging\Message($body, $attributes)); } /** * Add Redirect child. * * @param string $url Redirect URL * @param array $attributes Optional attributes * @return Messaging\Redirect Child element. */ public function redirect($url, $attributes = []): Messaging\Redirect { return $this->nest(new Messaging\Redirect($url, $attributes)); } } sdk/src/Twilio/TwiML/VoiceResponse.php 0000644 00000013153 15021223077 0013656 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML; class VoiceResponse extends TwiML { /** * VoiceResponse constructor. */ public function __construct() { parent::__construct('Response', null); } /** * Add Connect child. * * @param array $attributes Optional attributes * @return Voice\Connect Child element. */ public function connect($attributes = []): Voice\Connect { return $this->nest(new Voice\Connect($attributes)); } /** * Add Dial child. * * @param string $number Phone number to dial * @param array $attributes Optional attributes * @return Voice\Dial Child element. */ public function dial($number = null, $attributes = []): Voice\Dial { return $this->nest(new Voice\Dial($number, $attributes)); } /** * Add Echo child. * * @return Voice\Echo_ Child element. */ public function echo_(): Voice\Echo_ { return $this->nest(new Voice\Echo_()); } /** * Add Enqueue child. * * @param string $name Friendly name * @param array $attributes Optional attributes * @return Voice\Enqueue Child element. */ public function enqueue($name = null, $attributes = []): Voice\Enqueue { return $this->nest(new Voice\Enqueue($name, $attributes)); } /** * Add Gather child. * * @param array $attributes Optional attributes * @return Voice\Gather Child element. */ public function gather($attributes = []): Voice\Gather { return $this->nest(new Voice\Gather($attributes)); } /** * Add Hangup child. * * @return Voice\Hangup Child element. */ public function hangup(): Voice\Hangup { return $this->nest(new Voice\Hangup()); } /** * Add Leave child. * * @return Voice\Leave Child element. */ public function leave(): Voice\Leave { return $this->nest(new Voice\Leave()); } /** * Add Pause child. * * @param array $attributes Optional attributes * @return Voice\Pause Child element. */ public function pause($attributes = []): Voice\Pause { return $this->nest(new Voice\Pause($attributes)); } /** * Add Play child. * * @param string $url Media URL * @param array $attributes Optional attributes * @return Voice\Play Child element. */ public function play($url = null, $attributes = []): Voice\Play { return $this->nest(new Voice\Play($url, $attributes)); } /** * Add Queue child. * * @param string $name Queue name * @param array $attributes Optional attributes * @return Voice\Queue Child element. */ public function queue($name, $attributes = []): Voice\Queue { return $this->nest(new Voice\Queue($name, $attributes)); } /** * Add Record child. * * @param array $attributes Optional attributes * @return Voice\Record Child element. */ public function record($attributes = []): Voice\Record { return $this->nest(new Voice\Record($attributes)); } /** * Add Redirect child. * * @param string $url Redirect URL * @param array $attributes Optional attributes * @return Voice\Redirect Child element. */ public function redirect($url, $attributes = []): Voice\Redirect { return $this->nest(new Voice\Redirect($url, $attributes)); } /** * Add Reject child. * * @param array $attributes Optional attributes * @return Voice\Reject Child element. */ public function reject($attributes = []): Voice\Reject { return $this->nest(new Voice\Reject($attributes)); } /** * Add Say child. * * @param string $message Message to say * @param array $attributes Optional attributes * @return Voice\Say Child element. */ public function say($message, $attributes = []): Voice\Say { return $this->nest(new Voice\Say($message, $attributes)); } /** * Add Sms child. * * @param string $message Message body * @param array $attributes Optional attributes * @return Voice\Sms Child element. */ public function sms($message, $attributes = []): Voice\Sms { return $this->nest(new Voice\Sms($message, $attributes)); } /** * Add Pay child. * * @param array $attributes Optional attributes * @return Voice\Pay Child element. */ public function pay($attributes = []): Voice\Pay { return $this->nest(new Voice\Pay($attributes)); } /** * Add Prompt child. * * @param array $attributes Optional attributes * @return Voice\Prompt Child element. */ public function prompt($attributes = []): Voice\Prompt { return $this->nest(new Voice\Prompt($attributes)); } /** * Add Start child. * * @param array $attributes Optional attributes * @return Voice\Start Child element. */ public function start($attributes = []): Voice\Start { return $this->nest(new Voice\Start($attributes)); } /** * Add Stop child. * * @return Voice\Stop Child element. */ public function stop(): Voice\Stop { return $this->nest(new Voice\Stop()); } /** * Add Refer child. * * @param array $attributes Optional attributes * @return Voice\Refer Child element. */ public function refer($attributes = []): Voice\Refer { return $this->nest(new Voice\Refer($attributes)); } } sdk/src/Twilio/TwiML/TwiML.php 0000644 00000006722 15021223077 0012072 0 ustar 00 <?php namespace Twilio\TwiML; use DOMDocument; use DOMElement; /** * @property $name string XML element name * @property $attributes array XML attributes * @property $value string XML body * @property $children TwiML[] nested TwiML elements */ abstract class TwiML { protected $name; protected $attributes; protected $children; /** * TwiML constructor. * * @param string $name XML element name * @param string $value XML value * @param array $attributes XML attributes */ public function __construct(string $name, string $value = null, array $attributes = []) { $this->name = $name; $this->attributes = $attributes; $this->children = []; if ($value !== null) { $this->children[] = $value; } } /** * Add a TwiML element. * * @param TwiML|string $twiml TwiML element to add * @return TwiML $this */ public function append($twiml): TwiML { $this->children[] = $twiml; return $this; } /** * Add a TwiML element. * * @param TwiML $twiml TwiML element to add * @return TwiML added TwiML element */ public function nest(TwiML $twiml): TwiML { $this->children[] = $twiml; return $twiml; } /** * Set TwiML attribute. * * @param string $key name of attribute * @param string $value value of attribute * @return static $this */ public function setAttribute(string $key, string $value): TwiML { $this->attributes[$key] = $value; return $this; } /** * @param string $name XML element name * @param string $value XML value * @param array $attributes XML attributes * @return TwiML */ public function addChild(string $name, string $value = null, array $attributes = []): TwiML { return $this->nest(new GenericNode($name, $value, $attributes)); } /** * Convert TwiML to XML string. * * @return string TwiML XML representation */ public function asXML(): string { return (string)$this; } /** * Convert TwiML to XML string. * * @return string TwiML XML representation */ public function __toString(): string { return $this->xml()->saveXML(); } /** * Build TwiML element. * * @param TwiML $twiml TwiML element to convert to XML * @param DOMDocument $document XML document for the element * @return DOMElement $element */ private function buildElement(TwiML $twiml, DOMDocument $document): DOMElement { $element = $document->createElement($twiml->name); foreach ($twiml->attributes as $name => $value) { if (\is_bool($value)) { $value = ($value === true) ? 'true' : 'false'; } $element->setAttribute($name, $value); } foreach ($twiml->children as $child) { if (\is_string($child)) { $element->appendChild($document->createTextNode($child)); } else { $element->appendChild($this->buildElement($child, $document)); } } return $element; } /** * Build XML element. * * @return DOMDocument Build TwiML element */ private function xml(): DOMDocument { $document = new DOMDocument('1.0', 'UTF-8'); $document->appendChild($this->buildElement($this, $document)); return $document; } } sdk/src/Twilio/Deserialize.php 0000644 00000002440 15021223077 0012333 0 ustar 00 <?php namespace Twilio; use Twilio\Base\PhoneNumberCapabilities; class Deserialize { /** * Deserialize a string date into a DateTime object * * @param string $s A date or date and time, can be iso8601, rfc2822, * YYYY-MM-DD format. * @return \DateTime|string DateTime corresponding to the input string, in UTC time. */ public static function dateTime(?string $s) { try { if ($s) { return new \DateTime($s, new \DateTimeZone('UTC')); } } catch (\Exception $e) { // no-op } return $s; } /** * Deserialize an array into a PhoneNumberCapabilities object * * @param array|null $arr An array * @return PhoneNumberCapabilities|array PhoneNumberCapabilities object corresponding to the input array. */ public static function phoneNumberCapabilities(?array $arr) { try { if ($arr) { $required = ["mms", "sms", "voice", "fax"]; if (count(array_intersect($required, array_keys($arr))) > 0) { return new PhoneNumberCapabilities($arr); } } } catch (\Exception $e) { // no-op } return $arr; } } sdk/src/Twilio/Base/PhoneNumberCapabilities.php 0000644 00000003272 15021223077 0015505 0 ustar 00 <?php namespace Twilio\Base; use Twilio\Exceptions\TwilioException; use Twilio\Values; /** * @property bool $mms * @property bool $sms * @property bool $voice * @property bool $fax */ class PhoneNumberCapabilities { protected $mms; protected $sms; protected $voice; protected $fax; public function __construct(array $capabilities) { $this->mms = Values::array_get($capabilities, 'mms', "false"); $this->sms = Values::array_get($capabilities, 'sms', "false"); $this->voice = Values::array_get($capabilities, 'voice', "false"); $this->fax = Values::array_get($capabilities, 'fax', "false"); } /** * Access the mms */ public function getMms(): bool { return $this->mms; } /** * Access the sms */ public function getSms(): bool { return $this->sms; } /** * Access the voice */ public function getVoice(): bool { return $this->voice; } /** * Access the fax */ public function getFax(): bool { return $this->fax; } public function __get(string $name) { if (\property_exists($this, $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } public function __toString(): string { return "[Twilio.Base.PhoneNumberCapabilities " . "( mms: " . json_encode($this->mms) . ", sms: " . json_encode($this->sms) . ", voice: " . json_encode($this->voice) . ", fax: " . json_encode($this->fax) . " )]"; } } sdk/src/Twilio/Base/BaseClient.php 0000644 00000026253 15021223077 0012766 0 ustar 00 <?php namespace Twilio\Base; use Twilio\Exceptions\ConfigurationException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Client as HttpClient; use Twilio\Http\CurlClient; use Twilio\Rest\Api; use Twilio\Security\RequestValidator; use Twilio\VersionInfo; /** * @property \Twilio\Rest\Api\V2010\AccountInstance $account * @property Api $api */ class BaseClient { const ENV_ACCOUNT_SID = 'TWILIO_ACCOUNT_SID'; const ENV_AUTH_TOKEN = 'TWILIO_AUTH_TOKEN'; const ENV_REGION = 'TWILIO_REGION'; const ENV_EDGE = 'TWILIO_EDGE'; const DEFAULT_REGION = 'us1'; const ENV_LOG = 'TWILIO_LOG_LEVEL'; protected $username; protected $password; protected $accountSid; protected $region; protected $edge; protected $httpClient; protected $environment; protected $userAgentExtensions; protected $logLevel; protected $_account; /** * Initializes the Twilio Client * * @param string $username Username to authenticate with * @param string $password Password to authenticate with * @param string $accountSid Account SID to authenticate with, defaults to * $username * @param string $region Region to send requests to, defaults to 'us1' if Edge * provided * @param HttpClient $httpClient HttpClient, defaults to CurlClient * @param mixed[] $environment Environment to look for auth details, defaults * to $_ENV * @param string[] $userAgentExtensions Additions to the user agent string * @throws ConfigurationException If valid authentication is not present */ public function __construct( string $username = null, string $password = null, string $accountSid = null, string $region = null, HttpClient $httpClient = null, array $environment = null, array $userAgentExtensions = null ) { $this->environment = $environment ?: \getenv(); $this->username = $this->getArg($username, self::ENV_ACCOUNT_SID); $this->password = $this->getArg($password, self::ENV_AUTH_TOKEN); $this->region = $this->getArg($region, self::ENV_REGION); $this->edge = $this->getArg(null, self::ENV_EDGE); $this->logLevel = $this->getArg(null, self::ENV_LOG); $this->userAgentExtensions = $userAgentExtensions ?: []; if (!$this->username || !$this->password) { throw new ConfigurationException('Credentials are required to create a Client'); } $this->accountSid = $accountSid ?: $this->username; if ($httpClient) { $this->httpClient = $httpClient; } else { $this->httpClient = new CurlClient(); } } /** * Determines argument value accounting for environment variables. * * @param string $arg The constructor argument * @param string $envVar The environment variable name * @return ?string Argument value */ public function getArg(?string $arg, string $envVar): ?string { if ($arg) { return $arg; } if (\array_key_exists($envVar, $this->environment)) { return $this->environment[$envVar]; } return null; } /** * Makes a request to the Twilio API using the configured http client * Authentication information is automatically added if none is provided * * @param string $method HTTP Method * @param string $uri Fully qualified url * @param string[] $params Query string parameters * @param string[] $data POST body data * @param string[] $headers HTTP Headers * @param string $username User for Authentication * @param string $password Password for Authentication * @param int $timeout Timeout in seconds * @return \Twilio\Http\Response Response from the Twilio API */ public function request( string $method, string $uri, array $params = [], array $data = [], array $headers = [], string $username = null, string $password = null, int $timeout = null ): \Twilio\Http\Response{ $username = $username ?: $this->username; $password = $password ?: $this->password; $logLevel = (getenv('DEBUG_HTTP_TRAFFIC') === 'true' ? 'debug' : $this->getLogLevel()); $headers['User-Agent'] = 'twilio-php/' . VersionInfo::string() . ' (' . php_uname("s") . ' ' . php_uname("m") . ')' . ' PHP/' . PHP_VERSION; $headers['Accept-Charset'] = 'utf-8'; if ($this->userAgentExtensions) { $headers['User-Agent'] .= ' ' . implode(' ', $this->userAgentExtensions); } if (!\array_key_exists('Accept', $headers)) { $headers['Accept'] = 'application/json'; } $uri = $this->buildUri($uri); if ($logLevel === 'debug') { error_log('-- BEGIN Twilio API Request --'); error_log('Request Method: ' . $method); $u = parse_url($uri); if (isset($u['path'])) { error_log('Request URL: ' . $u['path']); } if (isset($u['query']) && strlen($u['query']) > 0) { error_log('Query Params: ' . $u['query']); } error_log('Request Headers: '); foreach ($headers as $key => $value) { if (strpos(strtolower($key), 'authorization') === false) { error_log("$key: $value"); } } error_log('-- END Twilio API Request --'); } $response = $this->getHttpClient()->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); if ($logLevel === 'debug') { error_log('Status Code: ' . $response->getStatusCode()); error_log('Response Headers:'); $responseHeaders = $response->getHeaders(); foreach ($responseHeaders as $key => $value) { error_log("$key: $value"); } } return $response; } /** * Build the final request uri * * @param string $uri The original request uri * @return string Request uri */ public function buildUri(string $uri): string { if ($this->region == null && $this->edge == null) { return $uri; } $parsedUrl = \parse_url($uri); $pieces = \explode('.', $parsedUrl['host']); $product = $pieces[0]; $domain = \implode('.', \array_slice($pieces, -2)); $newEdge = $this->edge; $newRegion = $this->region; if (count($pieces) == 4) { // product.region.twilio.com $newRegion = $newRegion ?: $pieces[1]; } elseif (count($pieces) == 5) { // product.edge.region.twilio.com $newEdge = $newEdge ?: $pieces[1]; $newRegion = $newRegion ?: $pieces[2]; } if ($newEdge != null && $newRegion == null) { $newRegion = self::DEFAULT_REGION; } $parsedUrl['host'] = \implode('.', \array_filter([$product, $newEdge, $newRegion, $domain])); return RequestValidator::unparse_url($parsedUrl); } /** * Magic getter to lazy load domains * * @param string $name Domain to return * @return \Twilio\Domain The requested domain * @throws TwilioException For unknown domains */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown domain ' . $name); } /** * Magic call to lazy load contexts * * @param string $name Context to return * @param mixed[] $arguments Context to return * @return \Twilio\InstanceContext The requested context * @throws TwilioException For unknown contexts */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Client ' . $this->getAccountSid() . ']'; } /** * Validates connection to new SSL certificate endpoint * * @param CurlClient $client * @throws TwilioException if request fails */ public function validateSslCertificate(CurlClient $client): void { $response = $client->request('GET', 'https://tls-test.twilio.com:443'); if ($response->getStatusCode() < 200 || $response->getStatusCode() > 300) { throw new TwilioException('Failed to validate SSL certificate'); } } /** * @return \Twilio\Rest\Api\V2010\AccountContext Account provided as the * authenticating account */ public function getAccount(): \Twilio\Rest\Api\V2010\AccountContext { return $this->api->v2010->account; } /** * Retrieve the Username * * @return string Current Username */ public function getUsername(): string { return $this->username; } /** * Retrieve the Password * * @return string Current Password */ public function getPassword(): string { return $this->password; } /** * Retrieve the AccountSid * * @return string Current AccountSid */ public function getAccountSid(): string { return $this->accountSid; } /** * Retrieve the Region * * @return string Current Region */ public function getRegion(): string { return $this->region; } /** * Retrieve the Edge * * @return string Current Edge */ public function getEdge(): string { return $this->edge; } /** * Set Edge * * @param string $uri Edge to use, unsets the Edge when called with no arguments */ public function setEdge(string $edge = null): void { $this->edge = $this->getArg($edge, self::ENV_EDGE); } /** * Retrieve the HttpClient * * @return HttpClient Current HttpClient */ public function getHttpClient(): HttpClient { return $this->httpClient; } /** * Set the HttpClient * * @param HttpClient $httpClient HttpClient to use */ public function setHttpClient(HttpClient $httpClient): void { $this->httpClient = $httpClient; } /** * Retrieve the log level * * @return ?string Current log level */ public function getLogLevel(): ?string { return $this->logLevel; } /** * Set log level to debug * * @param string $logLevel log level to use */ public function setLogLevel(string $logLevel = null): void { $this->logLevel = $this->getArg($logLevel, self::ENV_LOG); } } sdk/src/Twilio/Exceptions/ConfigurationException.php 0000644 00000000140 15021223077 0016675 0 ustar 00 <?php namespace Twilio\Exceptions; class ConfigurationException extends TwilioException { } sdk/src/Twilio/Exceptions/RestException.php 0000644 00000002756 15021223077 0015022 0 ustar 00 <?php namespace Twilio\Exceptions; class RestException extends TwilioException { protected $statusCode; protected $details; protected $moreInfo; /** * Construct the exception. Note: The message is NOT binary safe. * @link http://php.net/manual/en/exception.construct.php * @param string $message [optional] The Exception message to throw. * @param int $code [optional] The Exception code. * @param int $statusCode [optional] The HTTP Status code. * @param string $moreInfo [optional] More information about the error. * @param array $details [optional] Additional details about the error. * @since 5.1.0 */ public function __construct(string $message, int $code, int $statusCode, string $moreInfo = '', array $details = []) { $this->statusCode = $statusCode; $this->moreInfo = $moreInfo; $this->details = $details; parent::__construct($message, $code); } /** * Get the HTTP Status Code of the RestException * @return int HTTP Status Code */ public function getStatusCode(): int { return $this->statusCode; } /** * Get more information of the RestException * @return string More error information */ public function getMoreInfo(): string { return $this->moreInfo; } /** * Get the details of the RestException * @return exception details */ public function getDetails(): array { return $this->details; } } sdk/src/Twilio/Exceptions/EnvironmentException.php 0000644 00000000136 15021223077 0016377 0 ustar 00 <?php namespace Twilio\Exceptions; class EnvironmentException extends TwilioException { } sdk/src/Twilio/Exceptions/HttpException.php 0000644 00000000127 15021223077 0015012 0 ustar 00 <?php namespace Twilio\Exceptions; class HttpException extends TwilioException { } sdk/src/Twilio/Exceptions/TwimlException.php 0000644 00000000130 15021223077 0015161 0 ustar 00 <?php namespace Twilio\Exceptions; class TwimlException extends TwilioException { } sdk/src/Twilio/Exceptions/TwilioException.php 0000644 00000000124 15021223077 0015337 0 ustar 00 <?php namespace Twilio\Exceptions; class TwilioException extends \Exception { } sdk/src/Twilio/Exceptions/DeserializeException.php 0000644 00000000136 15021223077 0016333 0 ustar 00 <?php namespace Twilio\Exceptions; class DeserializeException extends TwilioException { } sdk/src/Twilio/Rest/RoutesBase.php 0000644 00000004522 15021223077 0013067 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Routes\V2; /** * @property \Twilio\Rest\Routes\V2 $v2 */ class RoutesBase extends Domain { protected $_v2; /** * Construct the Routes Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://routes.twilio.com'; } /** * @return V2 Version v2 of routes */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Routes]'; } } sdk/src/Twilio/Rest/Supersim/V1/SmsCommandList.php 0000644 00000015206 15021223077 0016006 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SmsCommandList extends ListResource { /** * Construct the SmsCommandList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/SmsCommands'; } /** * Create the SmsCommandInstance * * @param string $sim The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) to send the SMS Command to. * @param string $payload The message body of the SMS Command. * @param array|Options $options Optional Arguments * @return SmsCommandInstance Created SmsCommandInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $sim, string $payload, array $options = []): SmsCommandInstance { $options = new Values($options); $data = Values::of([ 'Sim' => $sim, 'Payload' => $payload, 'CallbackMethod' => $options['callbackMethod'], 'CallbackUrl' => $options['callbackUrl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SmsCommandInstance( $this->version, $payload ); } /** * Reads SmsCommandInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SmsCommandInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SmsCommandInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SmsCommandInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SmsCommandPage Page of SmsCommandInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SmsCommandPage { $options = new Values($options); $params = Values::of([ 'Sim' => $options['sim'], 'Status' => $options['status'], 'Direction' => $options['direction'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SmsCommandPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SmsCommandInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SmsCommandPage Page of SmsCommandInstance */ public function getPage(string $targetUrl): SmsCommandPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SmsCommandPage($this->version, $response, $this->solution); } /** * Constructs a SmsCommandContext * * @param string $sid The SID of the SMS Command resource to fetch. */ public function getContext( string $sid ): SmsCommandContext { return new SmsCommandContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SmsCommandList]'; } } sdk/src/Twilio/Rest/Supersim/V1/IpCommandContext.php 0000644 00000003731 15021223077 0016325 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class IpCommandContext extends InstanceContext { /** * Initialize the IpCommandContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the IP Command resource to fetch. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/IpCommands/' . \rawurlencode($sid) .''; } /** * Fetch the IpCommandInstance * * @return IpCommandInstance Fetched IpCommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpCommandInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new IpCommandInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.IpCommandContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/FleetList.php 0000644 00000015571 15021223077 0015011 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class FleetList extends ListResource { /** * Construct the FleetList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Fleets'; } /** * Create the FleetInstance * * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. * @param array|Options $options Optional Arguments * @return FleetInstance Created FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $networkAccessProfile, array $options = []): FleetInstance { $options = new Values($options); $data = Values::of([ 'NetworkAccessProfile' => $networkAccessProfile, 'UniqueName' => $options['uniqueName'], 'DataEnabled' => Serialize::booleanToString($options['dataEnabled']), 'DataLimit' => $options['dataLimit'], 'IpCommandsUrl' => $options['ipCommandsUrl'], 'IpCommandsMethod' => $options['ipCommandsMethod'], 'SmsCommandsEnabled' => Serialize::booleanToString($options['smsCommandsEnabled']), 'SmsCommandsUrl' => $options['smsCommandsUrl'], 'SmsCommandsMethod' => $options['smsCommandsMethod'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FleetInstance( $this->version, $payload ); } /** * Reads FleetInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FleetInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams FleetInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FleetInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FleetPage Page of FleetInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FleetPage { $options = new Values($options); $params = Values::of([ 'NetworkAccessProfile' => $options['networkAccessProfile'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FleetPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FleetInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FleetPage Page of FleetInstance */ public function getPage(string $targetUrl): FleetPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FleetPage($this->version, $response, $this->solution); } /** * Constructs a FleetContext * * @param string $sid The SID of the Fleet resource to fetch. */ public function getContext( string $sid ): FleetContext { return new FleetContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.FleetList]'; } } sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdateList.php 0000644 00000012361 15021223077 0016707 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SettingsUpdateList extends ListResource { /** * Construct the SettingsUpdateList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/SettingsUpdates'; } /** * Reads SettingsUpdateInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SettingsUpdateInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SettingsUpdateInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SettingsUpdateInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SettingsUpdatePage Page of SettingsUpdateInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SettingsUpdatePage { $options = new Values($options); $params = Values::of([ 'Sim' => $options['sim'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SettingsUpdatePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SettingsUpdateInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SettingsUpdatePage Page of SettingsUpdateInstance */ public function getPage(string $targetUrl): SettingsUpdatePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SettingsUpdatePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SettingsUpdateList]'; } } sdk/src/Twilio/Rest/Supersim/V1/EsimProfileOptions.php 0000644 00000022117 15021223077 0016702 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Options; use Twilio\Values; abstract class EsimProfileOptions { /** * @param string $callbackUrl The URL we should call using the `callback_method` when the status of the eSIM Profile changes. At this stage of the eSIM Profile pilot, the a request to the URL will only be called when the ESimProfile resource changes from `reserving` to `available`. * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * @param bool $generateMatchingId When set to `true`, a value for `Eid` does not need to be provided. Instead, when the eSIM profile is reserved, a matching ID will be generated and returned via the `matching_id` property. This identifies the specific eSIM profile that can be used by any capable device to claim and download the profile. * @param string $eid Identifier of the eUICC that will claim the eSIM Profile. * @return CreateEsimProfileOptions Options builder */ public static function create( string $callbackUrl = Values::NONE, string $callbackMethod = Values::NONE, bool $generateMatchingId = Values::BOOL_NONE, string $eid = Values::NONE ): CreateEsimProfileOptions { return new CreateEsimProfileOptions( $callbackUrl, $callbackMethod, $generateMatchingId, $eid ); } /** * @param string $eid List the eSIM Profiles that have been associated with an EId. * @param string $simSid Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. * @param string $status List the eSIM Profiles that are in a given status. * @return ReadEsimProfileOptions Options builder */ public static function read( string $eid = Values::NONE, string $simSid = Values::NONE, string $status = Values::NONE ): ReadEsimProfileOptions { return new ReadEsimProfileOptions( $eid, $simSid, $status ); } } class CreateEsimProfileOptions extends Options { /** * @param string $callbackUrl The URL we should call using the `callback_method` when the status of the eSIM Profile changes. At this stage of the eSIM Profile pilot, the a request to the URL will only be called when the ESimProfile resource changes from `reserving` to `available`. * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * @param bool $generateMatchingId When set to `true`, a value for `Eid` does not need to be provided. Instead, when the eSIM profile is reserved, a matching ID will be generated and returned via the `matching_id` property. This identifies the specific eSIM profile that can be used by any capable device to claim and download the profile. * @param string $eid Identifier of the eUICC that will claim the eSIM Profile. */ public function __construct( string $callbackUrl = Values::NONE, string $callbackMethod = Values::NONE, bool $generateMatchingId = Values::BOOL_NONE, string $eid = Values::NONE ) { $this->options['callbackUrl'] = $callbackUrl; $this->options['callbackMethod'] = $callbackMethod; $this->options['generateMatchingId'] = $generateMatchingId; $this->options['eid'] = $eid; } /** * The URL we should call using the `callback_method` when the status of the eSIM Profile changes. At this stage of the eSIM Profile pilot, the a request to the URL will only be called when the ESimProfile resource changes from `reserving` to `available`. * * @param string $callbackUrl The URL we should call using the `callback_method` when the status of the eSIM Profile changes. At this stage of the eSIM Profile pilot, the a request to the URL will only be called when the ESimProfile resource changes from `reserving` to `available`. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * When set to `true`, a value for `Eid` does not need to be provided. Instead, when the eSIM profile is reserved, a matching ID will be generated and returned via the `matching_id` property. This identifies the specific eSIM profile that can be used by any capable device to claim and download the profile. * * @param bool $generateMatchingId When set to `true`, a value for `Eid` does not need to be provided. Instead, when the eSIM profile is reserved, a matching ID will be generated and returned via the `matching_id` property. This identifies the specific eSIM profile that can be used by any capable device to claim and download the profile. * @return $this Fluent Builder */ public function setGenerateMatchingId(bool $generateMatchingId): self { $this->options['generateMatchingId'] = $generateMatchingId; return $this; } /** * Identifier of the eUICC that will claim the eSIM Profile. * * @param string $eid Identifier of the eUICC that will claim the eSIM Profile. * @return $this Fluent Builder */ public function setEid(string $eid): self { $this->options['eid'] = $eid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.CreateEsimProfileOptions ' . $options . ']'; } } class ReadEsimProfileOptions extends Options { /** * @param string $eid List the eSIM Profiles that have been associated with an EId. * @param string $simSid Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. * @param string $status List the eSIM Profiles that are in a given status. */ public function __construct( string $eid = Values::NONE, string $simSid = Values::NONE, string $status = Values::NONE ) { $this->options['eid'] = $eid; $this->options['simSid'] = $simSid; $this->options['status'] = $status; } /** * List the eSIM Profiles that have been associated with an EId. * * @param string $eid List the eSIM Profiles that have been associated with an EId. * @return $this Fluent Builder */ public function setEid(string $eid): self { $this->options['eid'] = $eid; return $this; } /** * Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. * * @param string $simSid Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. * @return $this Fluent Builder */ public function setSimSid(string $simSid): self { $this->options['simSid'] = $simSid; return $this; } /** * List the eSIM Profiles that are in a given status. * * @param string $status List the eSIM Profiles that are in a given status. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadEsimProfileOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/IpCommandList.php 0000644 00000016107 15021223077 0015615 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class IpCommandList extends ListResource { /** * Construct the IpCommandList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/IpCommands'; } /** * Create the IpCommandInstance * * @param string $sim The `sid` or `unique_name` of the [Super SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) to send the IP Command to. * @param string $payload The data that will be sent to the device. The payload cannot exceed 1300 bytes. If the PayloadType is set to text, the payload is encoded in UTF-8. If PayloadType is set to binary, the payload is encoded in Base64. * @param int $devicePort The device port to which the IP Command will be sent. * @param array|Options $options Optional Arguments * @return IpCommandInstance Created IpCommandInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $sim, string $payload, int $devicePort, array $options = []): IpCommandInstance { $options = new Values($options); $data = Values::of([ 'Sim' => $sim, 'Payload' => $payload, 'DevicePort' => $devicePort, 'PayloadType' => $options['payloadType'], 'CallbackUrl' => $options['callbackUrl'], 'CallbackMethod' => $options['callbackMethod'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IpCommandInstance( $this->version, $payload ); } /** * Reads IpCommandInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpCommandInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams IpCommandInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of IpCommandInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return IpCommandPage Page of IpCommandInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): IpCommandPage { $options = new Values($options); $params = Values::of([ 'Sim' => $options['sim'], 'SimIccid' => $options['simIccid'], 'Status' => $options['status'], 'Direction' => $options['direction'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new IpCommandPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpCommandInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return IpCommandPage Page of IpCommandInstance */ public function getPage(string $targetUrl): IpCommandPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpCommandPage($this->version, $response, $this->solution); } /** * Constructs a IpCommandContext * * @param string $sid The SID of the IP Command resource to fetch. */ public function getContext( string $sid ): IpCommandContext { return new IpCommandContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.IpCommandList]'; } } sdk/src/Twilio/Rest/Supersim/V1/SmsCommandContext.php 0000644 00000003743 15021223077 0016522 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class SmsCommandContext extends InstanceContext { /** * Initialize the SmsCommandContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the SMS Command resource to fetch. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/SmsCommands/' . \rawurlencode($sid) .''; } /** * Fetch the SmsCommandInstance * * @return SmsCommandInstance Fetched SmsCommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SmsCommandInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SmsCommandInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.SmsCommandContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/SmsCommandInstance.php 0000644 00000007651 15021223077 0016644 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $simSid * @property string|null $payload * @property string $status * @property string $direction * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class SmsCommandInstance extends InstanceResource { /** * Initialize the SmsCommandInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the SMS Command resource to fetch. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'payload' => Values::array_get($payload, 'payload'), 'status' => Values::array_get($payload, 'status'), 'direction' => Values::array_get($payload, 'direction'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SmsCommandContext Context for this SmsCommandInstance */ protected function proxy(): SmsCommandContext { if (!$this->context) { $this->context = new SmsCommandContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the SmsCommandInstance * * @return SmsCommandInstance Fetched SmsCommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SmsCommandInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.SmsCommandInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/IpCommandPage.php 0000644 00000003036 15021223077 0015553 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class IpCommandPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return IpCommandInstance \Twilio\Rest\Supersim\V1\IpCommandInstance */ public function buildInstance(array $payload): IpCommandInstance { return new IpCommandInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.IpCommandPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkOptions.php 0000644 00000007465 15021223077 0016126 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Options; use Twilio\Values; abstract class NetworkOptions { /** * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read. * @param string $mcc The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read. * @param string $mnc The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read. * @return ReadNetworkOptions Options builder */ public static function read( string $isoCountry = Values::NONE, string $mcc = Values::NONE, string $mnc = Values::NONE ): ReadNetworkOptions { return new ReadNetworkOptions( $isoCountry, $mcc, $mnc ); } } class ReadNetworkOptions extends Options { /** * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read. * @param string $mcc The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read. * @param string $mnc The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read. */ public function __construct( string $isoCountry = Values::NONE, string $mcc = Values::NONE, string $mnc = Values::NONE ) { $this->options['isoCountry'] = $isoCountry; $this->options['mcc'] = $mcc; $this->options['mnc'] = $mnc; } /** * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read. * * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read. * @return $this Fluent Builder */ public function setIsoCountry(string $isoCountry): self { $this->options['isoCountry'] = $isoCountry; return $this; } /** * The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read. * * @param string $mcc The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read. * @return $this Fluent Builder */ public function setMcc(string $mcc): self { $this->options['mcc'] = $mcc; return $this; } /** * The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read. * * @param string $mnc The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read. * @return $this Fluent Builder */ public function setMnc(string $mnc): self { $this->options['mnc'] = $mnc; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadNetworkOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/EsimProfileList.php 0000644 00000014776 15021223077 0016176 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class EsimProfileList extends ListResource { /** * Construct the EsimProfileList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/ESimProfiles'; } /** * Create the EsimProfileInstance * * @param array|Options $options Optional Arguments * @return EsimProfileInstance Created EsimProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): EsimProfileInstance { $options = new Values($options); $data = Values::of([ 'CallbackUrl' => $options['callbackUrl'], 'CallbackMethod' => $options['callbackMethod'], 'GenerateMatchingId' => Serialize::booleanToString($options['generateMatchingId']), 'Eid' => $options['eid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new EsimProfileInstance( $this->version, $payload ); } /** * Reads EsimProfileInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EsimProfileInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams EsimProfileInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EsimProfileInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EsimProfilePage Page of EsimProfileInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EsimProfilePage { $options = new Values($options); $params = Values::of([ 'Eid' => $options['eid'], 'SimSid' => $options['simSid'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EsimProfilePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EsimProfileInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EsimProfilePage Page of EsimProfileInstance */ public function getPage(string $targetUrl): EsimProfilePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EsimProfilePage($this->version, $response, $this->solution); } /** * Constructs a EsimProfileContext * * @param string $sid The SID of the eSIM Profile resource to fetch. */ public function getContext( string $sid ): EsimProfileContext { return new EsimProfileContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.EsimProfileList]'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileInstance.php 0000644 00000011046 15021223077 0020670 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Supersim\V1\NetworkAccessProfile\NetworkAccessProfileNetworkList; /** * @property string|null $sid * @property string|null $uniqueName * @property string|null $accountSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class NetworkAccessProfileInstance extends InstanceResource { protected $_networks; /** * Initialize the NetworkAccessProfileInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Network Access Profile resource to fetch. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return NetworkAccessProfileContext Context for this NetworkAccessProfileInstance */ protected function proxy(): NetworkAccessProfileContext { if (!$this->context) { $this->context = new NetworkAccessProfileContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the NetworkAccessProfileInstance * * @return NetworkAccessProfileInstance Fetched NetworkAccessProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NetworkAccessProfileInstance { return $this->proxy()->fetch(); } /** * Update the NetworkAccessProfileInstance * * @param array|Options $options Optional Arguments * @return NetworkAccessProfileInstance Updated NetworkAccessProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): NetworkAccessProfileInstance { return $this->proxy()->update($options); } /** * Access the networks */ protected function getNetworks(): NetworkAccessProfileNetworkList { return $this->proxy()->networks; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.NetworkAccessProfileInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/SimContext.php 0000644 00000011761 15021223077 0015210 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Supersim\V1\Sim\BillingPeriodList; use Twilio\Rest\Supersim\V1\Sim\SimIpAddressList; /** * @property BillingPeriodList $billingPeriods * @property SimIpAddressList $simIpAddresses */ class SimContext extends InstanceContext { protected $_billingPeriods; protected $_simIpAddresses; /** * Initialize the SimContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Sim resource to fetch. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Sims/' . \rawurlencode($sid) .''; } /** * Fetch the SimInstance * * @return SimInstance Fetched SimInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SimInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SimInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the SimInstance * * @param array|Options $options Optional Arguments * @return SimInstance Updated SimInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SimInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'Status' => $options['status'], 'Fleet' => $options['fleet'], 'CallbackUrl' => $options['callbackUrl'], 'CallbackMethod' => $options['callbackMethod'], 'AccountSid' => $options['accountSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SimInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the billingPeriods */ protected function getBillingPeriods(): BillingPeriodList { if (!$this->_billingPeriods) { $this->_billingPeriods = new BillingPeriodList( $this->version, $this->solution['sid'] ); } return $this->_billingPeriods; } /** * Access the simIpAddresses */ protected function getSimIpAddresses(): SimIpAddressList { if (!$this->_simIpAddresses) { $this->_simIpAddresses = new SimIpAddressList( $this->version, $this->solution['sid'] ); } return $this->_simIpAddresses; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.SimContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkContext.php 0000644 00000005501 15021223077 0026215 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1\NetworkAccessProfile; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class NetworkAccessProfileNetworkContext extends InstanceContext { /** * Initialize the NetworkAccessProfileNetworkContext * * @param Version $version Version that contains the resource * @param string $networkAccessProfileSid The unique string that identifies the Network Access Profile resource. * @param string $sid The SID of the Network resource to be removed from the Network Access Profile resource. */ public function __construct( Version $version, $networkAccessProfileSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'networkAccessProfileSid' => $networkAccessProfileSid, 'sid' => $sid, ]; $this->uri = '/NetworkAccessProfiles/' . \rawurlencode($networkAccessProfileSid) .'/Networks/' . \rawurlencode($sid) .''; } /** * Delete the NetworkAccessProfileNetworkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the NetworkAccessProfileNetworkInstance * * @return NetworkAccessProfileNetworkInstance Fetched NetworkAccessProfileNetworkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NetworkAccessProfileNetworkInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new NetworkAccessProfileNetworkInstance( $this->version, $payload, $this->solution['networkAccessProfileSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkInstance.php 0000644 00000010624 15021223077 0026337 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1\NetworkAccessProfile; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string|null $networkAccessProfileSid * @property string|null $friendlyName * @property string|null $isoCountry * @property array[]|null $identifiers * @property string|null $url */ class NetworkAccessProfileNetworkInstance extends InstanceResource { /** * Initialize the NetworkAccessProfileNetworkInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $networkAccessProfileSid The unique string that identifies the Network Access Profile resource. * @param string $sid The SID of the Network resource to be removed from the Network Access Profile resource. */ public function __construct(Version $version, array $payload, string $networkAccessProfileSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'networkAccessProfileSid' => Values::array_get($payload, 'network_access_profile_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'identifiers' => Values::array_get($payload, 'identifiers'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['networkAccessProfileSid' => $networkAccessProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return NetworkAccessProfileNetworkContext Context for this NetworkAccessProfileNetworkInstance */ protected function proxy(): NetworkAccessProfileNetworkContext { if (!$this->context) { $this->context = new NetworkAccessProfileNetworkContext( $this->version, $this->solution['networkAccessProfileSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the NetworkAccessProfileNetworkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the NetworkAccessProfileNetworkInstance * * @return NetworkAccessProfileNetworkInstance Fetched NetworkAccessProfileNetworkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NetworkAccessProfileNetworkInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkPage.php 0000644 00000003340 15021223077 0025444 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1\NetworkAccessProfile; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NetworkAccessProfileNetworkPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return NetworkAccessProfileNetworkInstance \Twilio\Rest\Supersim\V1\NetworkAccessProfile\NetworkAccessProfileNetworkInstance */ public function buildInstance(array $payload): NetworkAccessProfileNetworkInstance { return new NetworkAccessProfileNetworkInstance($this->version, $payload, $this->solution['networkAccessProfileSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkList.php 0000644 00000015242 15021223077 0025507 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1\NetworkAccessProfile; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class NetworkAccessProfileNetworkList extends ListResource { /** * Construct the NetworkAccessProfileNetworkList * * @param Version $version Version that contains the resource * @param string $networkAccessProfileSid The unique string that identifies the Network Access Profile resource. */ public function __construct( Version $version, string $networkAccessProfileSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'networkAccessProfileSid' => $networkAccessProfileSid, ]; $this->uri = '/NetworkAccessProfiles/' . \rawurlencode($networkAccessProfileSid) .'/Networks'; } /** * Create the NetworkAccessProfileNetworkInstance * * @param string $network The SID of the Network resource to be added to the Network Access Profile resource. * @return NetworkAccessProfileNetworkInstance Created NetworkAccessProfileNetworkInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $network): NetworkAccessProfileNetworkInstance { $data = Values::of([ 'Network' => $network, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new NetworkAccessProfileNetworkInstance( $this->version, $payload, $this->solution['networkAccessProfileSid'] ); } /** * Reads NetworkAccessProfileNetworkInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return NetworkAccessProfileNetworkInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams NetworkAccessProfileNetworkInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of NetworkAccessProfileNetworkInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return NetworkAccessProfileNetworkPage Page of NetworkAccessProfileNetworkInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): NetworkAccessProfileNetworkPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new NetworkAccessProfileNetworkPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of NetworkAccessProfileNetworkInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return NetworkAccessProfileNetworkPage Page of NetworkAccessProfileNetworkInstance */ public function getPage(string $targetUrl): NetworkAccessProfileNetworkPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new NetworkAccessProfileNetworkPage($this->version, $response, $this->solution); } /** * Constructs a NetworkAccessProfileNetworkContext * * @param string $sid The SID of the Network resource to be removed from the Network Access Profile resource. */ public function getContext( string $sid ): NetworkAccessProfileNetworkContext { return new NetworkAccessProfileNetworkContext( $this->version, $this->solution['networkAccessProfileSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkList]'; } } sdk/src/Twilio/Rest/Supersim/V1/SimList.php 0000644 00000014410 15021223077 0014471 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SimList extends ListResource { /** * Construct the SimList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Sims'; } /** * Create the SimInstance * * @param string $iccid The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) of the Super SIM to be added to your Account. * @param string $registrationCode The 10-digit code required to claim the Super SIM for your Account. * @return SimInstance Created SimInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $iccid, string $registrationCode): SimInstance { $data = Values::of([ 'Iccid' => $iccid, 'RegistrationCode' => $registrationCode, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SimInstance( $this->version, $payload ); } /** * Reads SimInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SimInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SimInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SimInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SimPage Page of SimInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SimPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'Fleet' => $options['fleet'], 'Iccid' => $options['iccid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SimPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SimInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SimPage Page of SimInstance */ public function getPage(string $targetUrl): SimPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SimPage($this->version, $response, $this->solution); } /** * Constructs a SimContext * * @param string $sid The SID of the Sim resource to fetch. */ public function getContext( string $sid ): SimContext { return new SimContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SimList]'; } } sdk/src/Twilio/Rest/Supersim/V1/EsimProfilePage.php 0000644 00000003052 15021223077 0016120 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EsimProfilePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return EsimProfileInstance \Twilio\Rest\Supersim\V1\EsimProfileInstance */ public function buildInstance(array $payload): EsimProfileInstance { return new EsimProfileInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.EsimProfilePage]'; } } sdk/src/Twilio/Rest/Supersim/V1/FleetOptions.php 0000644 00000053170 15021223077 0015526 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Options; use Twilio\Values; abstract class FleetOptions { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @param bool $dataEnabled Defines whether SIMs in the Fleet are capable of using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to `true`. * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). * @param string $ipCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @param string $ipCommandsMethod A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @param bool $smsCommandsEnabled Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands. Defaults to `true`. * @param string $smsCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @param string $smsCommandsMethod A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @return CreateFleetOptions Options builder */ public static function create( string $uniqueName = Values::NONE, bool $dataEnabled = Values::BOOL_NONE, int $dataLimit = Values::INT_NONE, string $ipCommandsUrl = Values::NONE, string $ipCommandsMethod = Values::NONE, bool $smsCommandsEnabled = Values::BOOL_NONE, string $smsCommandsUrl = Values::NONE, string $smsCommandsMethod = Values::NONE ): CreateFleetOptions { return new CreateFleetOptions( $uniqueName, $dataEnabled, $dataLimit, $ipCommandsUrl, $ipCommandsMethod, $smsCommandsEnabled, $smsCommandsUrl, $smsCommandsMethod ); } /** * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to. * @return ReadFleetOptions Options builder */ public static function read( string $networkAccessProfile = Values::NONE ): ReadFleetOptions { return new ReadFleetOptions( $networkAccessProfile ); } /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. * @param string $ipCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @param string $ipCommandsMethod A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @param string $smsCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @param string $smsCommandsMethod A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). * @return UpdateFleetOptions Options builder */ public static function update( string $uniqueName = Values::NONE, string $networkAccessProfile = Values::NONE, string $ipCommandsUrl = Values::NONE, string $ipCommandsMethod = Values::NONE, string $smsCommandsUrl = Values::NONE, string $smsCommandsMethod = Values::NONE, int $dataLimit = Values::INT_NONE ): UpdateFleetOptions { return new UpdateFleetOptions( $uniqueName, $networkAccessProfile, $ipCommandsUrl, $ipCommandsMethod, $smsCommandsUrl, $smsCommandsMethod, $dataLimit ); } } class CreateFleetOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @param bool $dataEnabled Defines whether SIMs in the Fleet are capable of using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to `true`. * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). * @param string $ipCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @param string $ipCommandsMethod A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @param bool $smsCommandsEnabled Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands. Defaults to `true`. * @param string $smsCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @param string $smsCommandsMethod A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. */ public function __construct( string $uniqueName = Values::NONE, bool $dataEnabled = Values::BOOL_NONE, int $dataLimit = Values::INT_NONE, string $ipCommandsUrl = Values::NONE, string $ipCommandsMethod = Values::NONE, bool $smsCommandsEnabled = Values::BOOL_NONE, string $smsCommandsUrl = Values::NONE, string $smsCommandsMethod = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['dataEnabled'] = $dataEnabled; $this->options['dataLimit'] = $dataLimit; $this->options['ipCommandsUrl'] = $ipCommandsUrl; $this->options['ipCommandsMethod'] = $ipCommandsMethod; $this->options['smsCommandsEnabled'] = $smsCommandsEnabled; $this->options['smsCommandsUrl'] = $smsCommandsUrl; $this->options['smsCommandsMethod'] = $smsCommandsMethod; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Defines whether SIMs in the Fleet are capable of using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to `true`. * * @param bool $dataEnabled Defines whether SIMs in the Fleet are capable of using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to `true`. * @return $this Fluent Builder */ public function setDataEnabled(bool $dataEnabled): self { $this->options['dataEnabled'] = $dataEnabled; return $this; } /** * The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). * * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). * @return $this Fluent Builder */ public function setDataLimit(int $dataLimit): self { $this->options['dataLimit'] = $dataLimit; return $this; } /** * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * * @param string $ipCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @return $this Fluent Builder */ public function setIpCommandsUrl(string $ipCommandsUrl): self { $this->options['ipCommandsUrl'] = $ipCommandsUrl; return $this; } /** * A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * * @param string $ipCommandsMethod A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @return $this Fluent Builder */ public function setIpCommandsMethod(string $ipCommandsMethod): self { $this->options['ipCommandsMethod'] = $ipCommandsMethod; return $this; } /** * Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands. Defaults to `true`. * * @param bool $smsCommandsEnabled Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands. Defaults to `true`. * @return $this Fluent Builder */ public function setSmsCommandsEnabled(bool $smsCommandsEnabled): self { $this->options['smsCommandsEnabled'] = $smsCommandsEnabled; return $this; } /** * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * * @param string $smsCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @return $this Fluent Builder */ public function setSmsCommandsUrl(string $smsCommandsUrl): self { $this->options['smsCommandsUrl'] = $smsCommandsUrl; return $this; } /** * A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * * @param string $smsCommandsMethod A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @return $this Fluent Builder */ public function setSmsCommandsMethod(string $smsCommandsMethod): self { $this->options['smsCommandsMethod'] = $smsCommandsMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.CreateFleetOptions ' . $options . ']'; } } class ReadFleetOptions extends Options { /** * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to. */ public function __construct( string $networkAccessProfile = Values::NONE ) { $this->options['networkAccessProfile'] = $networkAccessProfile; } /** * The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to. * * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to. * @return $this Fluent Builder */ public function setNetworkAccessProfile(string $networkAccessProfile): self { $this->options['networkAccessProfile'] = $networkAccessProfile; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadFleetOptions ' . $options . ']'; } } class UpdateFleetOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. * @param string $ipCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @param string $ipCommandsMethod A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @param string $smsCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @param string $smsCommandsMethod A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). */ public function __construct( string $uniqueName = Values::NONE, string $networkAccessProfile = Values::NONE, string $ipCommandsUrl = Values::NONE, string $ipCommandsMethod = Values::NONE, string $smsCommandsUrl = Values::NONE, string $smsCommandsMethod = Values::NONE, int $dataLimit = Values::INT_NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['networkAccessProfile'] = $networkAccessProfile; $this->options['ipCommandsUrl'] = $ipCommandsUrl; $this->options['ipCommandsMethod'] = $ipCommandsMethod; $this->options['smsCommandsUrl'] = $smsCommandsUrl; $this->options['smsCommandsMethod'] = $smsCommandsMethod; $this->options['dataLimit'] = $dataLimit; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. * * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. * @return $this Fluent Builder */ public function setNetworkAccessProfile(string $networkAccessProfile): self { $this->options['networkAccessProfile'] = $networkAccessProfile; return $this; } /** * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * * @param string $ipCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @return $this Fluent Builder */ public function setIpCommandsUrl(string $ipCommandsUrl): self { $this->options['ipCommandsUrl'] = $ipCommandsUrl; return $this; } /** * A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * * @param string $ipCommandsMethod A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @return $this Fluent Builder */ public function setIpCommandsMethod(string $ipCommandsMethod): self { $this->options['ipCommandsMethod'] = $ipCommandsMethod; return $this; } /** * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * * @param string $smsCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. * @return $this Fluent Builder */ public function setSmsCommandsUrl(string $smsCommandsUrl): self { $this->options['smsCommandsUrl'] = $smsCommandsUrl; return $this; } /** * A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * * @param string $smsCommandsMethod A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. * @return $this Fluent Builder */ public function setSmsCommandsMethod(string $smsCommandsMethod): self { $this->options['smsCommandsMethod'] = $smsCommandsMethod; return $this; } /** * The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). * * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). * @return $this Fluent Builder */ public function setDataLimit(int $dataLimit): self { $this->options['dataLimit'] = $dataLimit; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.UpdateFleetOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/FleetPage.php 0000644 00000003006 15021223077 0014740 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FleetPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FleetInstance \Twilio\Rest\Supersim\V1\FleetInstance */ public function buildInstance(array $payload): FleetInstance { return new FleetInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.FleetPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/EsimProfileContext.php 0000644 00000003755 15021223077 0016702 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class EsimProfileContext extends InstanceContext { /** * Initialize the EsimProfileContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the eSIM Profile resource to fetch. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/ESimProfiles/' . \rawurlencode($sid) .''; } /** * Fetch the EsimProfileInstance * * @return EsimProfileInstance Fetched EsimProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EsimProfileInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new EsimProfileInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.EsimProfileContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/IpCommandInstance.php 0000644 00000010500 15021223077 0016435 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $simSid * @property string|null $simIccid * @property string $status * @property string $direction * @property string|null $deviceIp * @property int|null $devicePort * @property string $payloadType * @property string|null $payload * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class IpCommandInstance extends InstanceResource { /** * Initialize the IpCommandInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the IP Command resource to fetch. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'simIccid' => Values::array_get($payload, 'sim_iccid'), 'status' => Values::array_get($payload, 'status'), 'direction' => Values::array_get($payload, 'direction'), 'deviceIp' => Values::array_get($payload, 'device_ip'), 'devicePort' => Values::array_get($payload, 'device_port'), 'payloadType' => Values::array_get($payload, 'payload_type'), 'payload' => Values::array_get($payload, 'payload'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return IpCommandContext Context for this IpCommandInstance */ protected function proxy(): IpCommandContext { if (!$this->context) { $this->context = new IpCommandContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the IpCommandInstance * * @return IpCommandInstance Fetched IpCommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpCommandInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.IpCommandInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkList.php 0000644 00000012761 15021223077 0015401 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class NetworkList extends ListResource { /** * Construct the NetworkList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Networks'; } /** * Reads NetworkInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return NetworkInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams NetworkInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of NetworkInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return NetworkPage Page of NetworkInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): NetworkPage { $options = new Values($options); $params = Values::of([ 'IsoCountry' => $options['isoCountry'], 'Mcc' => $options['mcc'], 'Mnc' => $options['mnc'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new NetworkPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of NetworkInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return NetworkPage Page of NetworkInstance */ public function getPage(string $targetUrl): NetworkPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new NetworkPage($this->version, $response, $this->solution); } /** * Constructs a NetworkContext * * @param string $sid The SID of the Network resource to fetch. */ public function getContext( string $sid ): NetworkContext { return new NetworkContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.NetworkList]'; } } sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdateOptions.php 0000644 00000005326 15021223077 0017432 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Options; use Twilio\Values; abstract class SettingsUpdateOptions { /** * @param string $sim Filter the Settings Updates by a Super SIM's SID or UniqueName. * @param string $status Filter the Settings Updates by status. Can be `scheduled`, `in-progress`, `successful`, or `failed`. * @return ReadSettingsUpdateOptions Options builder */ public static function read( string $sim = Values::NONE, string $status = Values::NONE ): ReadSettingsUpdateOptions { return new ReadSettingsUpdateOptions( $sim, $status ); } } class ReadSettingsUpdateOptions extends Options { /** * @param string $sim Filter the Settings Updates by a Super SIM's SID or UniqueName. * @param string $status Filter the Settings Updates by status. Can be `scheduled`, `in-progress`, `successful`, or `failed`. */ public function __construct( string $sim = Values::NONE, string $status = Values::NONE ) { $this->options['sim'] = $sim; $this->options['status'] = $status; } /** * Filter the Settings Updates by a Super SIM's SID or UniqueName. * * @param string $sim Filter the Settings Updates by a Super SIM's SID or UniqueName. * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * Filter the Settings Updates by status. Can be `scheduled`, `in-progress`, `successful`, or `failed`. * * @param string $status Filter the Settings Updates by status. Can be `scheduled`, `in-progress`, `successful`, or `failed`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadSettingsUpdateOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkContext.php 0000644 00000003704 15021223077 0016107 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class NetworkContext extends InstanceContext { /** * Initialize the NetworkContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Network resource to fetch. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Networks/' . \rawurlencode($sid) .''; } /** * Fetch the NetworkInstance * * @return NetworkInstance Fetched NetworkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NetworkInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new NetworkInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.NetworkContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/EsimProfileInstance.php 0000644 00000010742 15021223077 0017014 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $iccid * @property string|null $simSid * @property string $status * @property string|null $eid * @property string|null $smdpPlusAddress * @property string|null $matchingId * @property string|null $activationCode * @property string|null $errorCode * @property string|null $errorMessage * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class EsimProfileInstance extends InstanceResource { /** * Initialize the EsimProfileInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the eSIM Profile resource to fetch. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'iccid' => Values::array_get($payload, 'iccid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'status' => Values::array_get($payload, 'status'), 'eid' => Values::array_get($payload, 'eid'), 'smdpPlusAddress' => Values::array_get($payload, 'smdp_plus_address'), 'matchingId' => Values::array_get($payload, 'matching_id'), 'activationCode' => Values::array_get($payload, 'activation_code'), 'errorCode' => Values::array_get($payload, 'error_code'), 'errorMessage' => Values::array_get($payload, 'error_message'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EsimProfileContext Context for this EsimProfileInstance */ protected function proxy(): EsimProfileContext { if (!$this->context) { $this->context = new EsimProfileContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the EsimProfileInstance * * @return EsimProfileInstance Fetched EsimProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EsimProfileInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.EsimProfileInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkInstance.php 0000644 00000006670 15021223077 0016234 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string|null $friendlyName * @property string|null $url * @property string|null $isoCountry * @property array[]|null $identifiers */ class NetworkInstance extends InstanceResource { /** * Initialize the NetworkInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Network resource to fetch. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'url' => Values::array_get($payload, 'url'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'identifiers' => Values::array_get($payload, 'identifiers'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return NetworkContext Context for this NetworkInstance */ protected function proxy(): NetworkContext { if (!$this->context) { $this->context = new NetworkContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the NetworkInstance * * @return NetworkInstance Fetched NetworkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NetworkInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.NetworkInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/FleetInstance.php 0000644 00000012025 15021223077 0015631 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $sid * @property string|null $uniqueName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property bool|null $dataEnabled * @property int|null $dataLimit * @property string $dataMetering * @property bool|null $smsCommandsEnabled * @property string|null $smsCommandsUrl * @property string|null $smsCommandsMethod * @property string|null $networkAccessProfileSid * @property string|null $ipCommandsUrl * @property string|null $ipCommandsMethod */ class FleetInstance extends InstanceResource { /** * Initialize the FleetInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Fleet resource to fetch. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'dataEnabled' => Values::array_get($payload, 'data_enabled'), 'dataLimit' => Values::array_get($payload, 'data_limit'), 'dataMetering' => Values::array_get($payload, 'data_metering'), 'smsCommandsEnabled' => Values::array_get($payload, 'sms_commands_enabled'), 'smsCommandsUrl' => Values::array_get($payload, 'sms_commands_url'), 'smsCommandsMethod' => Values::array_get($payload, 'sms_commands_method'), 'networkAccessProfileSid' => Values::array_get($payload, 'network_access_profile_sid'), 'ipCommandsUrl' => Values::array_get($payload, 'ip_commands_url'), 'ipCommandsMethod' => Values::array_get($payload, 'ip_commands_method'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FleetContext Context for this FleetInstance */ protected function proxy(): FleetContext { if (!$this->context) { $this->context = new FleetContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the FleetInstance * * @return FleetInstance Fetched FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FleetInstance { return $this->proxy()->fetch(); } /** * Update the FleetInstance * * @param array|Options $options Optional Arguments * @return FleetInstance Updated FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FleetInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.FleetInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/Sim/BillingPeriodInstance.php 0000644 00000005717 15021223077 0020057 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1\Sim; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $simSid * @property \DateTime|null $startTime * @property \DateTime|null $endTime * @property string $periodType * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class BillingPeriodInstance extends InstanceResource { /** * Initialize the BillingPeriodInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $simSid The SID of the Super SIM to list Billing Periods for. */ public function __construct(Version $version, array $payload, string $simSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'periodType' => Values::array_get($payload, 'period_type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['simSid' => $simSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.BillingPeriodInstance]'; } } sdk/src/Twilio/Rest/Supersim/V1/Sim/SimIpAddressInstance.php 0000644 00000004363 15021223077 0017657 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1\Sim; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $ipAddress * @property string $ipAddressVersion */ class SimIpAddressInstance extends InstanceResource { /** * Initialize the SimIpAddressInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $simSid The SID of the Super SIM to list IP Addresses for. */ public function __construct(Version $version, array $payload, string $simSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'ipAddress' => Values::array_get($payload, 'ip_address'), 'ipAddressVersion' => Values::array_get($payload, 'ip_address_version'), ]; $this->solution = ['simSid' => $simSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SimIpAddressInstance]'; } } sdk/src/Twilio/Rest/Supersim/V1/Sim/SimIpAddressList.php 0000644 00000012034 15021223077 0017020 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1\Sim; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SimIpAddressList extends ListResource { /** * Construct the SimIpAddressList * * @param Version $version Version that contains the resource * @param string $simSid The SID of the Super SIM to list IP Addresses for. */ public function __construct( Version $version, string $simSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'simSid' => $simSid, ]; $this->uri = '/Sims/' . \rawurlencode($simSid) .'/IpAddresses'; } /** * Reads SimIpAddressInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SimIpAddressInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SimIpAddressInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SimIpAddressInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SimIpAddressPage Page of SimIpAddressInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SimIpAddressPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SimIpAddressPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SimIpAddressInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SimIpAddressPage Page of SimIpAddressInstance */ public function getPage(string $targetUrl): SimIpAddressPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SimIpAddressPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SimIpAddressList]'; } } sdk/src/Twilio/Rest/Supersim/V1/Sim/BillingPeriodList.php 0000644 00000012062 15021223077 0017215 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1\Sim; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class BillingPeriodList extends ListResource { /** * Construct the BillingPeriodList * * @param Version $version Version that contains the resource * @param string $simSid The SID of the Super SIM to list Billing Periods for. */ public function __construct( Version $version, string $simSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'simSid' => $simSid, ]; $this->uri = '/Sims/' . \rawurlencode($simSid) .'/BillingPeriods'; } /** * Reads BillingPeriodInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BillingPeriodInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams BillingPeriodInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BillingPeriodInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BillingPeriodPage Page of BillingPeriodInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BillingPeriodPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BillingPeriodPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BillingPeriodInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BillingPeriodPage Page of BillingPeriodInstance */ public function getPage(string $targetUrl): BillingPeriodPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BillingPeriodPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.BillingPeriodList]'; } } sdk/src/Twilio/Rest/Supersim/V1/Sim/SimIpAddressPage.php 0000644 00000003123 15021223077 0016760 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1\Sim; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SimIpAddressPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SimIpAddressInstance \Twilio\Rest\Supersim\V1\Sim\SimIpAddressInstance */ public function buildInstance(array $payload): SimIpAddressInstance { return new SimIpAddressInstance($this->version, $payload, $this->solution['simSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SimIpAddressPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/Sim/BillingPeriodPage.php 0000644 00000003131 15021223077 0017153 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1\Sim; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BillingPeriodPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return BillingPeriodInstance \Twilio\Rest\Supersim\V1\Sim\BillingPeriodInstance */ public function buildInstance(array $payload): BillingPeriodInstance { return new BillingPeriodInstance($this->version, $payload, $this->solution['simSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.BillingPeriodPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/SmsCommandOptions.php 0000644 00000015610 15021223077 0016525 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Options; use Twilio\Values; abstract class SmsCommandOptions { /** * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * @param string $callbackUrl The URL we should call using the `callback_method` after we have sent the command. * @return CreateSmsCommandOptions Options builder */ public static function create( string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE ): CreateSmsCommandOptions { return new CreateSmsCommandOptions( $callbackMethod, $callbackUrl ); } /** * @param string $sim The SID or unique name of the Sim resource that SMS Command was sent to or from. * @param string $status The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. * @param string $direction The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. * @return ReadSmsCommandOptions Options builder */ public static function read( string $sim = Values::NONE, string $status = Values::NONE, string $direction = Values::NONE ): ReadSmsCommandOptions { return new ReadSmsCommandOptions( $sim, $status, $direction ); } } class CreateSmsCommandOptions extends Options { /** * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * @param string $callbackUrl The URL we should call using the `callback_method` after we have sent the command. */ public function __construct( string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE ) { $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; } /** * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The URL we should call using the `callback_method` after we have sent the command. * * @param string $callbackUrl The URL we should call using the `callback_method` after we have sent the command. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.CreateSmsCommandOptions ' . $options . ']'; } } class ReadSmsCommandOptions extends Options { /** * @param string $sim The SID or unique name of the Sim resource that SMS Command was sent to or from. * @param string $status The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. * @param string $direction The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. */ public function __construct( string $sim = Values::NONE, string $status = Values::NONE, string $direction = Values::NONE ) { $this->options['sim'] = $sim; $this->options['status'] = $status; $this->options['direction'] = $direction; } /** * The SID or unique name of the Sim resource that SMS Command was sent to or from. * * @param string $sim The SID or unique name of the Sim resource that SMS Command was sent to or from. * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. * * @param string $status The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. * * @param string $direction The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. * @return $this Fluent Builder */ public function setDirection(string $direction): self { $this->options['direction'] = $direction; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadSmsCommandOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdateInstance.php 0000644 00000005456 15021223077 0017547 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $iccid * @property string|null $simSid * @property string $status * @property array[]|null $packages * @property \DateTime|null $dateCompleted * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class SettingsUpdateInstance extends InstanceResource { /** * Initialize the SettingsUpdateInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'iccid' => Values::array_get($payload, 'iccid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'status' => Values::array_get($payload, 'status'), 'packages' => Values::array_get($payload, 'packages'), 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SettingsUpdateInstance]'; } } sdk/src/Twilio/Rest/Supersim/V1/UsageRecordInstance.php 0000644 00000006053 15021223077 0017001 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $simSid * @property string|null $networkSid * @property string|null $fleetSid * @property string|null $isoCountry * @property array|null $period * @property int|null $dataUpload * @property int|null $dataDownload * @property int|null $dataTotal * @property string|null $dataTotalBilled * @property string|null $billedUnit */ class UsageRecordInstance extends InstanceResource { /** * Initialize the UsageRecordInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'networkSid' => Values::array_get($payload, 'network_sid'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'period' => Values::array_get($payload, 'period'), 'dataUpload' => Values::array_get($payload, 'data_upload'), 'dataDownload' => Values::array_get($payload, 'data_download'), 'dataTotal' => Values::array_get($payload, 'data_total'), 'dataTotalBilled' => Values::array_get($payload, 'data_total_billed'), 'billedUnit' => Values::array_get($payload, 'billed_unit'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.UsageRecordInstance]'; } } sdk/src/Twilio/Rest/Supersim/V1/UsageRecordOptions.php 0000644 00000022742 15021223077 0016673 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Options; use Twilio\Values; abstract class UsageRecordOptions { /** * @param string $sim SID or unique name of a Sim resource. Only show UsageRecords representing usage incurred by this Super SIM. * @param string $fleet SID or unique name of a Fleet resource. Only show UsageRecords representing usage for Super SIMs belonging to this Fleet resource at the time the usage occurred. * @param string $network SID of a Network resource. Only show UsageRecords representing usage on this network. * @param string $isoCountry Alpha-2 ISO Country Code. Only show UsageRecords representing usage in this country. * @param string $group Dimension over which to aggregate usage records. Can be: `sim`, `fleet`, `network`, `isoCountry`. Default is to not aggregate across any of these dimensions, UsageRecords will be aggregated into the time buckets described by the `Granularity` parameter. * @param string $granularity Time-based grouping that UsageRecords should be aggregated by. Can be: `hour`, `day`, or `all`. Default is `all`. `all` returns one UsageRecord that describes the usage for the entire period. * @param \DateTime $startTime Only include usage that occurred at or after this time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is one month before the `end_time`. * @param \DateTime $endTime Only include usage that occurred before this time (exclusive), specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is the current time. * @return ReadUsageRecordOptions Options builder */ public static function read( string $sim = Values::NONE, string $fleet = Values::NONE, string $network = Values::NONE, string $isoCountry = Values::NONE, string $group = Values::NONE, string $granularity = Values::NONE, \DateTime $startTime = null, \DateTime $endTime = null ): ReadUsageRecordOptions { return new ReadUsageRecordOptions( $sim, $fleet, $network, $isoCountry, $group, $granularity, $startTime, $endTime ); } } class ReadUsageRecordOptions extends Options { /** * @param string $sim SID or unique name of a Sim resource. Only show UsageRecords representing usage incurred by this Super SIM. * @param string $fleet SID or unique name of a Fleet resource. Only show UsageRecords representing usage for Super SIMs belonging to this Fleet resource at the time the usage occurred. * @param string $network SID of a Network resource. Only show UsageRecords representing usage on this network. * @param string $isoCountry Alpha-2 ISO Country Code. Only show UsageRecords representing usage in this country. * @param string $group Dimension over which to aggregate usage records. Can be: `sim`, `fleet`, `network`, `isoCountry`. Default is to not aggregate across any of these dimensions, UsageRecords will be aggregated into the time buckets described by the `Granularity` parameter. * @param string $granularity Time-based grouping that UsageRecords should be aggregated by. Can be: `hour`, `day`, or `all`. Default is `all`. `all` returns one UsageRecord that describes the usage for the entire period. * @param \DateTime $startTime Only include usage that occurred at or after this time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is one month before the `end_time`. * @param \DateTime $endTime Only include usage that occurred before this time (exclusive), specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is the current time. */ public function __construct( string $sim = Values::NONE, string $fleet = Values::NONE, string $network = Values::NONE, string $isoCountry = Values::NONE, string $group = Values::NONE, string $granularity = Values::NONE, \DateTime $startTime = null, \DateTime $endTime = null ) { $this->options['sim'] = $sim; $this->options['fleet'] = $fleet; $this->options['network'] = $network; $this->options['isoCountry'] = $isoCountry; $this->options['group'] = $group; $this->options['granularity'] = $granularity; $this->options['startTime'] = $startTime; $this->options['endTime'] = $endTime; } /** * SID or unique name of a Sim resource. Only show UsageRecords representing usage incurred by this Super SIM. * * @param string $sim SID or unique name of a Sim resource. Only show UsageRecords representing usage incurred by this Super SIM. * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * SID or unique name of a Fleet resource. Only show UsageRecords representing usage for Super SIMs belonging to this Fleet resource at the time the usage occurred. * * @param string $fleet SID or unique name of a Fleet resource. Only show UsageRecords representing usage for Super SIMs belonging to this Fleet resource at the time the usage occurred. * @return $this Fluent Builder */ public function setFleet(string $fleet): self { $this->options['fleet'] = $fleet; return $this; } /** * SID of a Network resource. Only show UsageRecords representing usage on this network. * * @param string $network SID of a Network resource. Only show UsageRecords representing usage on this network. * @return $this Fluent Builder */ public function setNetwork(string $network): self { $this->options['network'] = $network; return $this; } /** * Alpha-2 ISO Country Code. Only show UsageRecords representing usage in this country. * * @param string $isoCountry Alpha-2 ISO Country Code. Only show UsageRecords representing usage in this country. * @return $this Fluent Builder */ public function setIsoCountry(string $isoCountry): self { $this->options['isoCountry'] = $isoCountry; return $this; } /** * Dimension over which to aggregate usage records. Can be: `sim`, `fleet`, `network`, `isoCountry`. Default is to not aggregate across any of these dimensions, UsageRecords will be aggregated into the time buckets described by the `Granularity` parameter. * * @param string $group Dimension over which to aggregate usage records. Can be: `sim`, `fleet`, `network`, `isoCountry`. Default is to not aggregate across any of these dimensions, UsageRecords will be aggregated into the time buckets described by the `Granularity` parameter. * @return $this Fluent Builder */ public function setGroup(string $group): self { $this->options['group'] = $group; return $this; } /** * Time-based grouping that UsageRecords should be aggregated by. Can be: `hour`, `day`, or `all`. Default is `all`. `all` returns one UsageRecord that describes the usage for the entire period. * * @param string $granularity Time-based grouping that UsageRecords should be aggregated by. Can be: `hour`, `day`, or `all`. Default is `all`. `all` returns one UsageRecord that describes the usage for the entire period. * @return $this Fluent Builder */ public function setGranularity(string $granularity): self { $this->options['granularity'] = $granularity; return $this; } /** * Only include usage that occurred at or after this time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is one month before the `end_time`. * * @param \DateTime $startTime Only include usage that occurred at or after this time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is one month before the `end_time`. * @return $this Fluent Builder */ public function setStartTime(\DateTime $startTime): self { $this->options['startTime'] = $startTime; return $this; } /** * Only include usage that occurred before this time (exclusive), specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is the current time. * * @param \DateTime $endTime Only include usage that occurred before this time (exclusive), specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is the current time. * @return $this Fluent Builder */ public function setEndTime(\DateTime $endTime): self { $this->options['endTime'] = $endTime; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadUsageRecordOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileList.php 0000644 00000014301 15021223077 0020034 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class NetworkAccessProfileList extends ListResource { /** * Construct the NetworkAccessProfileList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/NetworkAccessProfiles'; } /** * Create the NetworkAccessProfileInstance * * @param array|Options $options Optional Arguments * @return NetworkAccessProfileInstance Created NetworkAccessProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): NetworkAccessProfileInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'Networks' => Serialize::map($options['networks'], function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new NetworkAccessProfileInstance( $this->version, $payload ); } /** * Reads NetworkAccessProfileInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return NetworkAccessProfileInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams NetworkAccessProfileInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of NetworkAccessProfileInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return NetworkAccessProfilePage Page of NetworkAccessProfileInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): NetworkAccessProfilePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new NetworkAccessProfilePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of NetworkAccessProfileInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return NetworkAccessProfilePage Page of NetworkAccessProfileInstance */ public function getPage(string $targetUrl): NetworkAccessProfilePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new NetworkAccessProfilePage($this->version, $response, $this->solution); } /** * Constructs a NetworkAccessProfileContext * * @param string $sid The SID of the Network Access Profile resource to fetch. */ public function getContext( string $sid ): NetworkAccessProfileContext { return new NetworkAccessProfileContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.NetworkAccessProfileList]'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileOptions.php 0000644 00000011015 15021223077 0020553 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Options; use Twilio\Values; abstract class NetworkAccessProfileOptions { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @param string[] $networks List of Network SIDs that this Network Access Profile will allow connections to. * @return CreateNetworkAccessProfileOptions Options builder */ public static function create( string $uniqueName = Values::NONE, array $networks = Values::ARRAY_NONE ): CreateNetworkAccessProfileOptions { return new CreateNetworkAccessProfileOptions( $uniqueName, $networks ); } /** * @param string $uniqueName The new unique name of the Network Access Profile. * @return UpdateNetworkAccessProfileOptions Options builder */ public static function update( string $uniqueName = Values::NONE ): UpdateNetworkAccessProfileOptions { return new UpdateNetworkAccessProfileOptions( $uniqueName ); } } class CreateNetworkAccessProfileOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @param string[] $networks List of Network SIDs that this Network Access Profile will allow connections to. */ public function __construct( string $uniqueName = Values::NONE, array $networks = Values::ARRAY_NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['networks'] = $networks; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * List of Network SIDs that this Network Access Profile will allow connections to. * * @param string[] $networks List of Network SIDs that this Network Access Profile will allow connections to. * @return $this Fluent Builder */ public function setNetworks(array $networks): self { $this->options['networks'] = $networks; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.CreateNetworkAccessProfileOptions ' . $options . ']'; } } class UpdateNetworkAccessProfileOptions extends Options { /** * @param string $uniqueName The new unique name of the Network Access Profile. */ public function __construct( string $uniqueName = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; } /** * The new unique name of the Network Access Profile. * * @param string $uniqueName The new unique name of the Network Access Profile. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.UpdateNetworkAccessProfileOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/FleetContext.php 0000644 00000006070 15021223077 0015514 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class FleetContext extends InstanceContext { /** * Initialize the FleetContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Fleet resource to fetch. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Fleets/' . \rawurlencode($sid) .''; } /** * Fetch the FleetInstance * * @return FleetInstance Fetched FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FleetInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new FleetInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the FleetInstance * * @param array|Options $options Optional Arguments * @return FleetInstance Updated FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FleetInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'NetworkAccessProfile' => $options['networkAccessProfile'], 'IpCommandsUrl' => $options['ipCommandsUrl'], 'IpCommandsMethod' => $options['ipCommandsMethod'], 'SmsCommandsUrl' => $options['smsCommandsUrl'], 'SmsCommandsMethod' => $options['smsCommandsMethod'], 'DataLimit' => $options['dataLimit'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FleetInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.FleetContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/SimInstance.php 0000644 00000011432 15021223077 0015323 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Supersim\V1\Sim\BillingPeriodList; use Twilio\Rest\Supersim\V1\Sim\SimIpAddressList; /** * @property string|null $sid * @property string|null $uniqueName * @property string|null $accountSid * @property string|null $iccid * @property string $status * @property string|null $fleetSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class SimInstance extends InstanceResource { protected $_billingPeriods; protected $_simIpAddresses; /** * Initialize the SimInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Sim resource to fetch. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'iccid' => Values::array_get($payload, 'iccid'), 'status' => Values::array_get($payload, 'status'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SimContext Context for this SimInstance */ protected function proxy(): SimContext { if (!$this->context) { $this->context = new SimContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the SimInstance * * @return SimInstance Fetched SimInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SimInstance { return $this->proxy()->fetch(); } /** * Update the SimInstance * * @param array|Options $options Optional Arguments * @return SimInstance Updated SimInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SimInstance { return $this->proxy()->update($options); } /** * Access the billingPeriods */ protected function getBillingPeriods(): BillingPeriodList { return $this->proxy()->billingPeriods; } /** * Access the simIpAddresses */ protected function getSimIpAddresses(): SimIpAddressList { return $this->proxy()->simIpAddresses; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.SimInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/SmsCommandPage.php 0000644 00000003044 15021223077 0015744 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SmsCommandPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SmsCommandInstance \Twilio\Rest\Supersim\V1\SmsCommandInstance */ public function buildInstance(array $payload): SmsCommandInstance { return new SmsCommandInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SmsCommandPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/SimPage.php 0000644 00000002772 15021223077 0014442 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SimPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SimInstance \Twilio\Rest\Supersim\V1\SimInstance */ public function buildInstance(array $payload): SimInstance { return new SimInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SimPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/SettingsUpdatePage.php 0000644 00000003074 15021223077 0016651 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SettingsUpdatePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SettingsUpdateInstance \Twilio\Rest\Supersim\V1\SettingsUpdateInstance */ public function buildInstance(array $payload): SettingsUpdateInstance { return new SettingsUpdateInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.SettingsUpdatePage]'; } } sdk/src/Twilio/Rest/Supersim/V1/SimOptions.php 0000644 00000023513 15021223077 0015215 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Options; use Twilio\Values; abstract class SimOptions { /** * @param string $status The status of the Sim resources to read. Can be `new`, `ready`, `active`, `inactive`, or `scheduled`. * @param string $fleet The SID or unique name of the Fleet to which a list of Sims are assigned. * @param string $iccid The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with a Super SIM to filter the list by. Passing this parameter will always return a list containing zero or one SIMs. * @return ReadSimOptions Options builder */ public static function read( string $status = Values::NONE, string $fleet = Values::NONE, string $iccid = Values::NONE ): ReadSimOptions { return new ReadSimOptions( $status, $fleet, $iccid ); } /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @param string $status * @param string $fleet The SID or unique name of the Fleet to which the SIM resource should be assigned. * @param string $callbackUrl The URL we should call using the `callback_method` after an asynchronous update has finished. * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * @param string $accountSid The SID of the Account to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a Subaccount of the requesting Account. Only valid when the Sim resource's status is new. * @return UpdateSimOptions Options builder */ public static function update( string $uniqueName = Values::NONE, string $status = Values::NONE, string $fleet = Values::NONE, string $callbackUrl = Values::NONE, string $callbackMethod = Values::NONE, string $accountSid = Values::NONE ): UpdateSimOptions { return new UpdateSimOptions( $uniqueName, $status, $fleet, $callbackUrl, $callbackMethod, $accountSid ); } } class ReadSimOptions extends Options { /** * @param string $status The status of the Sim resources to read. Can be `new`, `ready`, `active`, `inactive`, or `scheduled`. * @param string $fleet The SID or unique name of the Fleet to which a list of Sims are assigned. * @param string $iccid The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with a Super SIM to filter the list by. Passing this parameter will always return a list containing zero or one SIMs. */ public function __construct( string $status = Values::NONE, string $fleet = Values::NONE, string $iccid = Values::NONE ) { $this->options['status'] = $status; $this->options['fleet'] = $fleet; $this->options['iccid'] = $iccid; } /** * The status of the Sim resources to read. Can be `new`, `ready`, `active`, `inactive`, or `scheduled`. * * @param string $status The status of the Sim resources to read. Can be `new`, `ready`, `active`, `inactive`, or `scheduled`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The SID or unique name of the Fleet to which a list of Sims are assigned. * * @param string $fleet The SID or unique name of the Fleet to which a list of Sims are assigned. * @return $this Fluent Builder */ public function setFleet(string $fleet): self { $this->options['fleet'] = $fleet; return $this; } /** * The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with a Super SIM to filter the list by. Passing this parameter will always return a list containing zero or one SIMs. * * @param string $iccid The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with a Super SIM to filter the list by. Passing this parameter will always return a list containing zero or one SIMs. * @return $this Fluent Builder */ public function setIccid(string $iccid): self { $this->options['iccid'] = $iccid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadSimOptions ' . $options . ']'; } } class UpdateSimOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @param string $status * @param string $fleet The SID or unique name of the Fleet to which the SIM resource should be assigned. * @param string $callbackUrl The URL we should call using the `callback_method` after an asynchronous update has finished. * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * @param string $accountSid The SID of the Account to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a Subaccount of the requesting Account. Only valid when the Sim resource's status is new. */ public function __construct( string $uniqueName = Values::NONE, string $status = Values::NONE, string $fleet = Values::NONE, string $callbackUrl = Values::NONE, string $callbackMethod = Values::NONE, string $accountSid = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['status'] = $status; $this->options['fleet'] = $fleet; $this->options['callbackUrl'] = $callbackUrl; $this->options['callbackMethod'] = $callbackMethod; $this->options['accountSid'] = $accountSid; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The SID or unique name of the Fleet to which the SIM resource should be assigned. * * @param string $fleet The SID or unique name of the Fleet to which the SIM resource should be assigned. * @return $this Fluent Builder */ public function setFleet(string $fleet): self { $this->options['fleet'] = $fleet; return $this; } /** * The URL we should call using the `callback_method` after an asynchronous update has finished. * * @param string $callbackUrl The URL we should call using the `callback_method` after an asynchronous update has finished. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The SID of the Account to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a Subaccount of the requesting Account. Only valid when the Sim resource's status is new. * * @param string $accountSid The SID of the Account to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a Subaccount of the requesting Account. Only valid when the Sim resource's status is new. * @return $this Fluent Builder */ public function setAccountSid(string $accountSid): self { $this->options['accountSid'] = $accountSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.UpdateSimOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfileContext.php 0000644 00000011122 15021223077 0020543 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Supersim\V1\NetworkAccessProfile\NetworkAccessProfileNetworkList; /** * @property NetworkAccessProfileNetworkList $networks * @method \Twilio\Rest\Supersim\V1\NetworkAccessProfile\NetworkAccessProfileNetworkContext networks(string $sid) */ class NetworkAccessProfileContext extends InstanceContext { protected $_networks; /** * Initialize the NetworkAccessProfileContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Network Access Profile resource to fetch. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/NetworkAccessProfiles/' . \rawurlencode($sid) .''; } /** * Fetch the NetworkAccessProfileInstance * * @return NetworkAccessProfileInstance Fetched NetworkAccessProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NetworkAccessProfileInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new NetworkAccessProfileInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the NetworkAccessProfileInstance * * @param array|Options $options Optional Arguments * @return NetworkAccessProfileInstance Updated NetworkAccessProfileInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): NetworkAccessProfileInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new NetworkAccessProfileInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the networks */ protected function getNetworks(): NetworkAccessProfileNetworkList { if (!$this->_networks) { $this->_networks = new NetworkAccessProfileNetworkList( $this->version, $this->solution['sid'] ); } return $this->_networks; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Supersim.V1.NetworkAccessProfileContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkPage.php 0000644 00000003022 15021223077 0015330 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NetworkPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return NetworkInstance \Twilio\Rest\Supersim\V1\NetworkInstance */ public function buildInstance(array $payload): NetworkInstance { return new NetworkInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.NetworkPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/UsageRecordList.php 0000644 00000013214 15021223077 0016145 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class UsageRecordList extends ListResource { /** * Construct the UsageRecordList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/UsageRecords'; } /** * Reads UsageRecordInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UsageRecordInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams UsageRecordInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UsageRecordInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UsageRecordPage Page of UsageRecordInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UsageRecordPage { $options = new Values($options); $params = Values::of([ 'Sim' => $options['sim'], 'Fleet' => $options['fleet'], 'Network' => $options['network'], 'IsoCountry' => $options['isoCountry'], 'Group' => $options['group'], 'Granularity' => $options['granularity'], 'StartTime' => Serialize::iso8601DateTime($options['startTime']), 'EndTime' => Serialize::iso8601DateTime($options['endTime']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UsageRecordInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UsageRecordPage Page of UsageRecordInstance */ public function getPage(string $targetUrl): UsageRecordPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.UsageRecordList]'; } } sdk/src/Twilio/Rest/Supersim/V1/UsageRecordPage.php 0000644 00000003052 15021223077 0016105 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UsageRecordPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UsageRecordInstance \Twilio\Rest\Supersim\V1\UsageRecordInstance */ public function buildInstance(array $payload): UsageRecordInstance { return new UsageRecordInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.UsageRecordPage]'; } } sdk/src/Twilio/Rest/Supersim/V1/IpCommandOptions.php 0000644 00000017761 15021223077 0016344 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Options; use Twilio\Values; abstract class IpCommandOptions { /** * @param string $payloadType * @param string $callbackUrl The URL we should call using the `callback_method` after we have sent the IP Command. * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be `GET` or `POST`, and the default is `POST`. * @return CreateIpCommandOptions Options builder */ public static function create( string $payloadType = Values::NONE, string $callbackUrl = Values::NONE, string $callbackMethod = Values::NONE ): CreateIpCommandOptions { return new CreateIpCommandOptions( $payloadType, $callbackUrl, $callbackMethod ); } /** * @param string $sim The SID or unique name of the Sim resource that IP Command was sent to or from. * @param string $simIccid The ICCID of the Sim resource that IP Command was sent to or from. * @param string $status The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each. * @param string $direction The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. * @return ReadIpCommandOptions Options builder */ public static function read( string $sim = Values::NONE, string $simIccid = Values::NONE, string $status = Values::NONE, string $direction = Values::NONE ): ReadIpCommandOptions { return new ReadIpCommandOptions( $sim, $simIccid, $status, $direction ); } } class CreateIpCommandOptions extends Options { /** * @param string $payloadType * @param string $callbackUrl The URL we should call using the `callback_method` after we have sent the IP Command. * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be `GET` or `POST`, and the default is `POST`. */ public function __construct( string $payloadType = Values::NONE, string $callbackUrl = Values::NONE, string $callbackMethod = Values::NONE ) { $this->options['payloadType'] = $payloadType; $this->options['callbackUrl'] = $callbackUrl; $this->options['callbackMethod'] = $callbackMethod; } /** * @param string $payloadType * @return $this Fluent Builder */ public function setPayloadType(string $payloadType): self { $this->options['payloadType'] = $payloadType; return $this; } /** * The URL we should call using the `callback_method` after we have sent the IP Command. * * @param string $callbackUrl The URL we should call using the `callback_method` after we have sent the IP Command. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * The HTTP method we should use to call `callback_url`. Can be `GET` or `POST`, and the default is `POST`. * * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be `GET` or `POST`, and the default is `POST`. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.CreateIpCommandOptions ' . $options . ']'; } } class ReadIpCommandOptions extends Options { /** * @param string $sim The SID or unique name of the Sim resource that IP Command was sent to or from. * @param string $simIccid The ICCID of the Sim resource that IP Command was sent to or from. * @param string $status The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each. * @param string $direction The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. */ public function __construct( string $sim = Values::NONE, string $simIccid = Values::NONE, string $status = Values::NONE, string $direction = Values::NONE ) { $this->options['sim'] = $sim; $this->options['simIccid'] = $simIccid; $this->options['status'] = $status; $this->options['direction'] = $direction; } /** * The SID or unique name of the Sim resource that IP Command was sent to or from. * * @param string $sim The SID or unique name of the Sim resource that IP Command was sent to or from. * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * The ICCID of the Sim resource that IP Command was sent to or from. * * @param string $simIccid The ICCID of the Sim resource that IP Command was sent to or from. * @return $this Fluent Builder */ public function setSimIccid(string $simIccid): self { $this->options['simIccid'] = $simIccid; return $this; } /** * The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each. * * @param string $status The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/iot/supersim/api/ipcommand-resource#status-values) for a description of each. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. * * @param string $direction The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. * @return $this Fluent Builder */ public function setDirection(string $direction): self { $this->options['direction'] = $direction; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Supersim.V1.ReadIpCommandOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Supersim/V1/NetworkAccessProfilePage.php 0000644 00000003140 15021223077 0017774 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NetworkAccessProfilePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return NetworkAccessProfileInstance \Twilio\Rest\Supersim\V1\NetworkAccessProfileInstance */ public function buildInstance(array $payload): NetworkAccessProfileInstance { return new NetworkAccessProfileInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1.NetworkAccessProfilePage]'; } } sdk/src/Twilio/Rest/Supersim/V1.php 0000644 00000013145 15021223077 0013111 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Supersim * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Supersim; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Supersim\V1\EsimProfileList; use Twilio\Rest\Supersim\V1\FleetList; use Twilio\Rest\Supersim\V1\IpCommandList; use Twilio\Rest\Supersim\V1\NetworkList; use Twilio\Rest\Supersim\V1\NetworkAccessProfileList; use Twilio\Rest\Supersim\V1\SettingsUpdateList; use Twilio\Rest\Supersim\V1\SimList; use Twilio\Rest\Supersim\V1\SmsCommandList; use Twilio\Rest\Supersim\V1\UsageRecordList; use Twilio\Version; /** * @property EsimProfileList $esimProfiles * @property FleetList $fleets * @property IpCommandList $ipCommands * @property NetworkList $networks * @property NetworkAccessProfileList $networkAccessProfiles * @property SettingsUpdateList $settingsUpdates * @property SimList $sims * @property SmsCommandList $smsCommands * @property UsageRecordList $usageRecords * @method \Twilio\Rest\Supersim\V1\EsimProfileContext esimProfiles(string $sid) * @method \Twilio\Rest\Supersim\V1\FleetContext fleets(string $sid) * @method \Twilio\Rest\Supersim\V1\IpCommandContext ipCommands(string $sid) * @method \Twilio\Rest\Supersim\V1\NetworkContext networks(string $sid) * @method \Twilio\Rest\Supersim\V1\NetworkAccessProfileContext networkAccessProfiles(string $sid) * @method \Twilio\Rest\Supersim\V1\SimContext sims(string $sid) * @method \Twilio\Rest\Supersim\V1\SmsCommandContext smsCommands(string $sid) */ class V1 extends Version { protected $_esimProfiles; protected $_fleets; protected $_ipCommands; protected $_networks; protected $_networkAccessProfiles; protected $_settingsUpdates; protected $_sims; protected $_smsCommands; protected $_usageRecords; /** * Construct the V1 version of Supersim * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getEsimProfiles(): EsimProfileList { if (!$this->_esimProfiles) { $this->_esimProfiles = new EsimProfileList($this); } return $this->_esimProfiles; } protected function getFleets(): FleetList { if (!$this->_fleets) { $this->_fleets = new FleetList($this); } return $this->_fleets; } protected function getIpCommands(): IpCommandList { if (!$this->_ipCommands) { $this->_ipCommands = new IpCommandList($this); } return $this->_ipCommands; } protected function getNetworks(): NetworkList { if (!$this->_networks) { $this->_networks = new NetworkList($this); } return $this->_networks; } protected function getNetworkAccessProfiles(): NetworkAccessProfileList { if (!$this->_networkAccessProfiles) { $this->_networkAccessProfiles = new NetworkAccessProfileList($this); } return $this->_networkAccessProfiles; } protected function getSettingsUpdates(): SettingsUpdateList { if (!$this->_settingsUpdates) { $this->_settingsUpdates = new SettingsUpdateList($this); } return $this->_settingsUpdates; } protected function getSims(): SimList { if (!$this->_sims) { $this->_sims = new SimList($this); } return $this->_sims; } protected function getSmsCommands(): SmsCommandList { if (!$this->_smsCommands) { $this->_smsCommands = new SmsCommandList($this); } return $this->_smsCommands; } protected function getUsageRecords(): UsageRecordList { if (!$this->_usageRecords) { $this->_usageRecords = new UsageRecordList($this); } return $this->_usageRecords; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Supersim.V1]'; } } sdk/src/Twilio/Rest/Trunking.php 0000644 00000001257 15021223077 0012616 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Trunking\V1; class Trunking extends TrunkingBase { /** * @deprecated Use v1->trunks instead. */ protected function getTrunks(): \Twilio\Rest\Trunking\V1\TrunkList { echo "trunks is deprecated. Use v1->trunks instead."; return $this->v1->trunks; } /** * @deprecated Use v1->trunks(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextTrunks(string $sid): \Twilio\Rest\Trunking\V1\TrunkContext { echo "trunks(\$sid) is deprecated. Use v1->trunks(\$sid) instead."; return $this->v1->trunks($sid); } } sdk/src/Twilio/Rest/InsightsBase.php 0000644 00000004540 15021223077 0013376 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Insights\V1; /** * @property \Twilio\Rest\Insights\V1 $v1 */ class InsightsBase extends Domain { protected $_v1; /** * Construct the Insights Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://insights.twilio.com'; } /** * @return V1 Version v1 of insights */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Insights]'; } } sdk/src/Twilio/Rest/Notify.php 0000644 00000002501 15021223077 0012256 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Notify\V1; class Notify extends NotifyBase { /** * @deprecated Use v1->credentials instead. */ protected function getCredentials(): \Twilio\Rest\Notify\V1\CredentialList { echo "credentials is deprecated. Use v1->credentials instead."; return $this->v1->credentials; } /** * @deprecated Use v1->credentials(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextCredentials(string $sid): \Twilio\Rest\Notify\V1\CredentialContext { echo "credentials(\$sid) is deprecated. Use v1->credentials(\$sid) instead."; return $this->v1->credentials($sid); } /** * @deprecated Use v1->services instead. */ protected function getServices(): \Twilio\Rest\Notify\V1\ServiceList { echo "services is deprecated. Use v1->services instead."; return $this->v1->services; } /** * @deprecated Use v1->services(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextServices(string $sid): \Twilio\Rest\Notify\V1\ServiceContext { echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; return $this->v1->services($sid); } } sdk/src/Twilio/Rest/Conversations.php 0000644 00000011677 15021223077 0013661 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Conversations\V1; class Conversations extends ConversationsBase { /** * @deprecated Use v1->configuration instead. */ protected function getConfiguration(): \Twilio\Rest\Conversations\V1\ConfigurationList { echo "configuration is deprecated. Use v1->configuration instead."; return $this->v1->configuration; } /** * @deprecated Use v1->configuration() instead. */ protected function contextConfiguration(): \Twilio\Rest\Conversations\V1\ConfigurationContext { echo "configuration() is deprecated. Use v1->configuration() instead."; return $this->v1->configuration(); } /** * @deprecated Use v1->addressConfigurations instead. */ protected function getAddressConfigurations(): \Twilio\Rest\Conversations\V1\AddressConfigurationList { echo "addressConfigurations is deprecated. Use v1->addressConfigurations instead."; return $this->v1->addressConfigurations; } /** * @deprecated Use v1->addressConfigurations(\$sid) instead. * @param string $sid The SID or Address of the Configuration. */ protected function contextAddressConfigurations(string $sid): \Twilio\Rest\Conversations\V1\AddressConfigurationContext { echo "addressConfigurations(\$sid) is deprecated. Use v1->addressConfigurations(\$sid) instead."; return $this->v1->addressConfigurations($sid); } /** * @deprecated Use v1->conversations instead. */ protected function getConversations(): \Twilio\Rest\Conversations\V1\ConversationList { echo "conversations is deprecated. Use v1->conversations instead."; return $this->v1->conversations; } /** * @deprecated Use v1->conversations(\$sid) instead. * @param string $sid A 34 character string that uniquely identifies this * resource. */ protected function contextConversations(string $sid): \Twilio\Rest\Conversations\V1\ConversationContext { echo "conversations(\$sid) is deprecated. Use v1->conversations(\$sid) instead."; return $this->v1->conversations($sid); } /** * @deprecated Use v1->credentials instead. */ protected function getCredentials(): \Twilio\Rest\Conversations\V1\CredentialList { echo "credentials is deprecated. Use v1->credentials instead."; return $this->v1->credentials; } /** * @deprecated Use v1->credentials(\$sid) instead. * @param string $sid A 34 character string that uniquely identifies this * resource. */ protected function contextCredentials(string $sid): \Twilio\Rest\Conversations\V1\CredentialContext { echo "credentials(\$sid) is deprecated. Use v1->credentials(\$sid) instead."; return $this->v1->credentials($sid); } /** * @deprecated Use v1->participantConversations instead. */ protected function getParticipantConversations(): \Twilio\Rest\Conversations\V1\ParticipantConversationList { echo "participantConversations is deprecated. Use v1->participantConversations instead."; return $this->v1->participantConversations; } /** * @deprecated Use v1->roles instead. */ protected function getRoles(): \Twilio\Rest\Conversations\V1\RoleList { echo "roles is deprecated. Use v1->roles instead."; return $this->v1->roles; } /** * @deprecated Use v1->roles(\$sid) instead. * @param string $sid The SID of the Role resource to fetch */ protected function contextRoles(string $sid): \Twilio\Rest\Conversations\V1\RoleContext { echo "roles(\$sid) is deprecated. Use v1->roles(\$sid) instead."; return $this->v1->roles($sid); } /** * @deprecated Use v1->services instead. */ protected function getServices(): \Twilio\Rest\Conversations\V1\ServiceList { echo "services is deprecated. Use v1->services instead."; return $this->v1->services; } /** * @deprecated Use v1->services(\$sid) instead. * @param string $sid A 34 character string that uniquely identifies this * resource. */ protected function contextServices(string $sid): \Twilio\Rest\Conversations\V1\ServiceContext { echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; return $this->v1->services($sid); } /** * @deprecated Use v1->users instead. */ protected function getUsers(): \Twilio\Rest\Conversations\V1\UserList { echo "users is deprecated. Use v1->users instead."; return $this->v1->users; } /** * @deprecated Use v1->users(\$sid) instead. * @param string $sid The SID of the User resource to fetch */ protected function contextUsers(string $sid): \Twilio\Rest\Conversations\V1\UserContext { echo "users(\$sid) is deprecated. Use v1->users(\$sid) instead."; return $this->v1->users($sid); } } sdk/src/Twilio/Rest/BulkexportsBase.php 0000644 00000004565 15021223077 0014137 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Bulkexports\V1; /** * @property \Twilio\Rest\Bulkexports\V1 $v1 */ class BulkexportsBase extends Domain { protected $_v1; /** * Construct the Bulkexports Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://bulkexports.twilio.com'; } /** * @return V1 Version v1 of bulkexports */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports]'; } } sdk/src/Twilio/Rest/Content/V1/LegacyContentPage.php 0000644 00000003062 15021223077 0016245 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Content * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Content\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class LegacyContentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return LegacyContentInstance \Twilio\Rest\Content\V1\LegacyContentInstance */ public function buildInstance(array $payload): LegacyContentInstance { return new LegacyContentInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.LegacyContentPage]'; } } sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchList.php 0000644 00000003141 15021223077 0017713 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Content * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Content\V1\Content; use Twilio\ListResource; use Twilio\Version; class ApprovalFetchList extends ListResource { /** * Construct the ApprovalFetchList * * @param Version $version Version that contains the resource * @param string $sid The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. */ public function __construct( Version $version, string $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; } /** * Constructs a ApprovalFetchContext */ public function getContext( ): ApprovalFetchContext { return new ApprovalFetchContext( $this->version, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.ApprovalFetchList]'; } } sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchContext.php 0000644 00000004115 15021223077 0020426 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Content * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Content\V1\Content; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class ApprovalFetchContext extends InstanceContext { /** * Initialize the ApprovalFetchContext * * @param Version $version Version that contains the resource * @param string $sid The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Content/' . \rawurlencode($sid) .'/ApprovalRequests'; } /** * Fetch the ApprovalFetchInstance * * @return ApprovalFetchInstance Fetched ApprovalFetchInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ApprovalFetchInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ApprovalFetchInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Content.V1.ApprovalFetchContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchPage.php 0000644 00000003132 15021223077 0017654 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Content * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Content\V1\Content; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ApprovalFetchPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ApprovalFetchInstance \Twilio\Rest\Content\V1\Content\ApprovalFetchInstance */ public function buildInstance(array $payload): ApprovalFetchInstance { return new ApprovalFetchInstance($this->version, $payload, $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.ApprovalFetchPage]'; } } sdk/src/Twilio/Rest/Content/V1/Content/ApprovalFetchInstance.php 0000644 00000006642 15021223077 0020555 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Content * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Content\V1\Content; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string|null $accountSid * @property array|null $whatsapp * @property string|null $url */ class ApprovalFetchInstance extends InstanceResource { /** * Initialize the ApprovalFetchInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. */ public function __construct(Version $version, array $payload, string $sid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'whatsapp' => Values::array_get($payload, 'whatsapp'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ApprovalFetchContext Context for this ApprovalFetchInstance */ protected function proxy(): ApprovalFetchContext { if (!$this->context) { $this->context = new ApprovalFetchContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the ApprovalFetchInstance * * @return ApprovalFetchInstance Fetched ApprovalFetchInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ApprovalFetchInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Content.V1.ApprovalFetchInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Content/V1/LegacyContentInstance.php 0000644 00000006154 15021223077 0017142 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Content * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Content\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string|null $language * @property array|null $variables * @property array|null $types * @property string|null $legacyTemplateName * @property string|null $legacyBody * @property string|null $url */ class LegacyContentInstance extends InstanceResource { /** * Initialize the LegacyContentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'language' => Values::array_get($payload, 'language'), 'variables' => Values::array_get($payload, 'variables'), 'types' => Values::array_get($payload, 'types'), 'legacyTemplateName' => Values::array_get($payload, 'legacy_template_name'), 'legacyBody' => Values::array_get($payload, 'legacy_body'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.LegacyContentInstance]'; } } sdk/src/Twilio/Rest/Content/V1/ContentContext.php 0000644 00000007714 15021223077 0015700 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Content * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Content\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Content\V1\Content\ApprovalFetchList; /** * @property ApprovalFetchList $approvalFetch * @method \Twilio\Rest\Content\V1\Content\ApprovalFetchContext approvalFetch() */ class ContentContext extends InstanceContext { protected $_approvalFetch; /** * Initialize the ContentContext * * @param Version $version Version that contains the resource * @param string $sid The Twilio-provided string that uniquely identifies the Content resource to fetch. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Content/' . \rawurlencode($sid) .''; } /** * Delete the ContentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ContentInstance * * @return ContentInstance Fetched ContentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ContentInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ContentInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the approvalFetch */ protected function getApprovalFetch(): ApprovalFetchList { if (!$this->_approvalFetch) { $this->_approvalFetch = new ApprovalFetchList( $this->version, $this->solution['sid'] ); } return $this->_approvalFetch; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Content.V1.ContentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Content/V1/ContentList.php 0000644 00000012136 15021223077 0015161 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Content * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Content\V1; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ContentList extends ListResource { /** * Construct the ContentList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Content'; } /** * Reads ContentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ContentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ContentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ContentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ContentPage Page of ContentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ContentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ContentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ContentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ContentPage Page of ContentInstance */ public function getPage(string $targetUrl): ContentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ContentPage($this->version, $response, $this->solution); } /** * Constructs a ContentContext * * @param string $sid The Twilio-provided string that uniquely identifies the Content resource to fetch. */ public function getContext( string $sid ): ContentContext { return new ContentContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.ContentList]'; } } sdk/src/Twilio/Rest/Content/V1/ContentAndApprovalsInstance.php 0000644 00000005662 15021223077 0020333 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Content * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Content\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string|null $language * @property array|null $variables * @property array|null $types * @property array|null $approvalRequests */ class ContentAndApprovalsInstance extends InstanceResource { /** * Initialize the ContentAndApprovalsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'language' => Values::array_get($payload, 'language'), 'variables' => Values::array_get($payload, 'variables'), 'types' => Values::array_get($payload, 'types'), 'approvalRequests' => Values::array_get($payload, 'approval_requests'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.ContentAndApprovalsInstance]'; } } sdk/src/Twilio/Rest/Content/V1/ContentAndApprovalsPage.php 0000644 00000003126 15021223077 0017434 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Content * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Content\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ContentAndApprovalsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ContentAndApprovalsInstance \Twilio\Rest\Content\V1\ContentAndApprovalsInstance */ public function buildInstance(array $payload): ContentAndApprovalsInstance { return new ContentAndApprovalsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.ContentAndApprovalsPage]'; } } sdk/src/Twilio/Rest/Content/V1/ContentAndApprovalsList.php 0000644 00000011710 15021223077 0017471 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Content * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Content\V1; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ContentAndApprovalsList extends ListResource { /** * Construct the ContentAndApprovalsList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/ContentAndApprovals'; } /** * Reads ContentAndApprovalsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ContentAndApprovalsInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ContentAndApprovalsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ContentAndApprovalsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ContentAndApprovalsPage Page of ContentAndApprovalsInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ContentAndApprovalsPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ContentAndApprovalsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ContentAndApprovalsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ContentAndApprovalsPage Page of ContentAndApprovalsInstance */ public function getPage(string $targetUrl): ContentAndApprovalsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ContentAndApprovalsPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.ContentAndApprovalsList]'; } } sdk/src/Twilio/Rest/Content/V1/ContentInstance.php 0000644 00000011050 15021223077 0016004 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Content * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Content\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Content\V1\Content\ApprovalFetchList; /** * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string|null $language * @property array|null $variables * @property array|null $types * @property string|null $url * @property array|null $links */ class ContentInstance extends InstanceResource { protected $_approvalFetch; /** * Initialize the ContentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The Twilio-provided string that uniquely identifies the Content resource to fetch. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'language' => Values::array_get($payload, 'language'), 'variables' => Values::array_get($payload, 'variables'), 'types' => Values::array_get($payload, 'types'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ContentContext Context for this ContentInstance */ protected function proxy(): ContentContext { if (!$this->context) { $this->context = new ContentContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ContentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ContentInstance * * @return ContentInstance Fetched ContentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ContentInstance { return $this->proxy()->fetch(); } /** * Access the approvalFetch */ protected function getApprovalFetch(): ApprovalFetchList { return $this->proxy()->approvalFetch; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Content.V1.ContentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Content/V1/LegacyContentList.php 0000644 00000011542 15021223077 0016306 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Content * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Content\V1; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class LegacyContentList extends ListResource { /** * Construct the LegacyContentList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/LegacyContent'; } /** * Reads LegacyContentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return LegacyContentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams LegacyContentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of LegacyContentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return LegacyContentPage Page of LegacyContentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): LegacyContentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new LegacyContentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of LegacyContentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return LegacyContentPage Page of LegacyContentInstance */ public function getPage(string $targetUrl): LegacyContentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new LegacyContentPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.LegacyContentList]'; } } sdk/src/Twilio/Rest/Content/V1/ContentPage.php 0000644 00000003016 15021223077 0015117 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Content * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Content\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ContentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ContentInstance \Twilio\Rest\Content\V1\ContentInstance */ public function buildInstance(array $payload): ContentInstance { return new ContentInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1.ContentPage]'; } } sdk/src/Twilio/Rest/Content/V1.php 0000644 00000006467 15021223077 0012725 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Content * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Content; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Content\V1\ContentList; use Twilio\Rest\Content\V1\ContentAndApprovalsList; use Twilio\Rest\Content\V1\LegacyContentList; use Twilio\Version; /** * @property ContentList $contents * @property ContentAndApprovalsList $contentAndApprovals * @property LegacyContentList $legacyContents * @method \Twilio\Rest\Content\V1\ContentContext contents(string $sid) */ class V1 extends Version { protected $_contents; protected $_contentAndApprovals; protected $_legacyContents; /** * Construct the V1 version of Content * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getContents(): ContentList { if (!$this->_contents) { $this->_contents = new ContentList($this); } return $this->_contents; } protected function getContentAndApprovals(): ContentAndApprovalsList { if (!$this->_contentAndApprovals) { $this->_contentAndApprovals = new ContentAndApprovalsList($this); } return $this->_contentAndApprovals; } protected function getLegacyContents(): LegacyContentList { if (!$this->_legacyContents) { $this->_legacyContents = new LegacyContentList($this); } return $this->_legacyContents; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content.V1]'; } } sdk/src/Twilio/Rest/Sync.php 0000644 00000001254 15021223077 0011726 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Sync\V1; class Sync extends SyncBase { /** * @deprecated Use v1->services instead. */ protected function getServices(): \Twilio\Rest\Sync\V1\ServiceList { echo "services is deprecated. Use v1->services instead."; return $this->v1->services; } /** * @deprecated Use v1->services(\$sid) instead. * @param string $sid The SID of the Service resource to fetch */ protected function contextServices(string $sid): \Twilio\Rest\Sync\V1\ServiceContext { echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; return $this->v1->services($sid); } } sdk/src/Twilio/Rest/Messaging.php 0000644 00000011205 15021223077 0012724 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Messaging\V1; class Messaging extends MessagingBase { /** * @deprecated */ protected function getBrandRegistrations(): \Twilio\Rest\Messaging\V1\BrandRegistrationList { echo "brandRegistrations is deprecated. Use v1->brandRegistrations instead."; return $this->v1->brandRegistrations; } /** * @deprecated * @param string $sid The SID that identifies the resource to fetch */ protected function contextBrandRegistrations(string $sid): \Twilio\Rest\Messaging\V1\BrandRegistrationContext { echo "brandRegistrations(\$sid) is deprecated. Use v1->brandRegistrations(\$sid) instead."; return $this->v1->brandRegistrations($sid); } /** * @deprecated */ protected function getDeactivations(): \Twilio\Rest\Messaging\V1\DeactivationsList { echo "deactivations is deprecated. Use v1->deactivations instead."; return $this->v1->deactivations; } /** * @deprecated Use v1->deactivations() instead. */ protected function contextDeactivations(): \Twilio\Rest\Messaging\V1\DeactivationsContext { echo "deactivations() is deprecated. Use v1->deactivations() instead."; return $this->v1->deactivations(); } /** * @deprecated Use v1->domainCerts instead. */ protected function getDomainCerts(): \Twilio\Rest\Messaging\V1\DomainCertsList { echo "domainCerts is deprecated. Use v1->domainCerts instead."; return $this->v1->domainCerts; } /** * @deprecated Use v1->domainCerts(\$domainSid) instead. * @param string $domainSid Unique string used to identify the domain that this * certificate should be associated with. */ protected function contextDomainCerts(string $domainSid): \Twilio\Rest\Messaging\V1\DomainCertsContext { echo "domainCerts(\$domainSid) is deprecated. Use v1->domainCerts(\$domainSid) instead."; return $this->v1->domainCerts($domainSid); } /** * @deprecated Use v1->domainConfig instead. */ protected function getDomainConfig(): \Twilio\Rest\Messaging\V1\DomainConfigList { echo "domainConfig is deprecated. Use v1->domainConfig instead."; return $this->v1->domainConfig; } /** * @deprecated Use v1->domainConfig(\$domainSid) instead. * @param string $domainSid Unique string used to identify the domain that this * config should be associated with. */ protected function contextDomainConfig(string $domainSid): \Twilio\Rest\Messaging\V1\DomainConfigContext { echo "domainConfig(\$domainSid) is deprecated. Use v1->domainConfig(\$domainSid) instead."; return $this->v1->domainConfig($domainSid); } /** * @deprecated Use v1->externalCampaign instead. */ protected function getExternalCampaign(): \Twilio\Rest\Messaging\V1\ExternalCampaignList { echo "externalCampaign is deprecated. Use v1->externalCampaign instead."; return $this->v1->externalCampaign; } /** * @deprecated Use v1->services instead. */ protected function getServices(): \Twilio\Rest\Messaging\V1\ServiceList { echo "services is deprecated. Use v1->services instead."; return $this->v1->services; } /** * @deprecated Use v1->services(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextServices(string $sid): \Twilio\Rest\Messaging\V1\ServiceContext { echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; return $this->v1->services($sid); } /** * @deprecated Use v1->tollfreeVerifications instead. */ protected function getTollfreeVerifications(): \Twilio\Rest\Messaging\V1\TollfreeVerificationList { echo "tollfreeVerifications is deprecated. Use v1->tollfreeVerifications instead."; return $this->v1->tollfreeVerifications; } /** * @deprecated Use v1->tollfreeVerifications(\$sid) instead. * @param string $sid Tollfree Verification Sid */ protected function contextTollfreeVerifications(string $sid): \Twilio\Rest\Messaging\V1\TollfreeVerificationContext { echo "tollfreeVerifications(\$sid) is deprecated. Use v1->tollfreeVerifications(\$sid) instead."; return $this->v1->tollfreeVerifications($sid); } /** * @deprecated Use v1->usecases instead. */ protected function getUsecases(): \Twilio\Rest\Messaging\V1\UsecaseList { echo "usecases is deprecated. Use v1->usecases instead."; return $this->v1->usecases; } } sdk/src/Twilio/Rest/VoiceBase.php 0000644 00000004513 15021223077 0012653 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Voice\V1; /** * @property \Twilio\Rest\Voice\V1 $v1 */ class VoiceBase extends Domain { protected $_v1; /** * Construct the Voice Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://voice.twilio.com'; } /** * @return V1 Version v1 of voice */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice]'; } } sdk/src/Twilio/Rest/Supersim.php 0000644 00000012003 15021223077 0012613 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Supersim\V1; class Supersim extends SupersimBase { /** * @deprecated Use v1->esimProfiles instead. */ protected function getEsimProfiles(): \Twilio\Rest\Supersim\V1\EsimProfileList { echo "esimProfiles is deprecated. Use v1->esimProfiles instead."; return $this->v1->esimProfiles; } /** * @deprecated Use v1->esimProfiles(\$sid) instead. * @param string $sid The SID of the eSIM Profile resource to fetch */ protected function contextEsimProfiles(string $sid): \Twilio\Rest\Supersim\V1\EsimProfileContext { echo "esimProfiles(\$sid) is deprecated. Use v1->esimProfiles(\$sid) instead."; return $this->v1->esimProfiles($sid); } /** * @deprecated Use v1->fleets instead. */ protected function getFleets(): \Twilio\Rest\Supersim\V1\FleetList { echo "fleets is deprecated. Use v1->fleets instead."; return $this->v1->fleets; } /** * @deprecated Use v1->fleets(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextFleets(string $sid): \Twilio\Rest\Supersim\V1\FleetContext { echo "fleets(\$sid) is deprecated. Use v1->fleets(\$sid) instead."; return $this->v1->fleets($sid); } /** * @deprecated Use v1->ipCommands instead. */ protected function getIpCommands(): \Twilio\Rest\Supersim\V1\IpCommandList { echo "ipCommands is deprecated. Use v1->ipCommands instead."; return $this->v1->ipCommands; } /** * @deprecated Use v1->ipCommands(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextIpCommands(string $sid): \Twilio\Rest\Supersim\V1\IpCommandContext { echo "ipCommands(\$sid) is deprecated. Use v1->ipCommands(\$sid) instead."; return $this->v1->ipCommands($sid); } /** * @deprecated Use v1->networks instead. */ protected function getNetworks(): \Twilio\Rest\Supersim\V1\NetworkList { echo "networks is deprecated. Use v1->networks instead."; return $this->v1->networks; } /** * @deprecated Use v1->networks(\$sid) instead. * @param string $sid The SID of the Network resource to fetch */ protected function contextNetworks(string $sid): \Twilio\Rest\Supersim\V1\NetworkContext { echo "networks(\$sid) is deprecated. Use v1->networks(\$sid) instead."; return $this->v1->networks($sid); } /** * @deprecated Use v1->networkAccessProfiles instead. */ protected function getNetworkAccessProfiles(): \Twilio\Rest\Supersim\V1\NetworkAccessProfileList { echo "networkAccessProfiles is deprecated. Use v1->networkAccessProfiles instead."; return $this->v1->networkAccessProfiles; } /** * @deprecated Use v1->networkAccessProfiles(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextNetworkAccessProfiles(string $sid): \Twilio\Rest\Supersim\V1\NetworkAccessProfileContext { echo "networkAccessProfiles(\$sid) is deprecated. Use v1->networkAccessProfiles(\$sid) instead."; return $this->v1->networkAccessProfiles($sid); } /** * @deprecated Use v1->settingsUpdates instead. */ protected function getSettingsUpdates(): \Twilio\Rest\Supersim\V1\SettingsUpdateList { echo "settingsUpdates is deprecated. Use v1->settingsUpdates instead."; return $this->v1->settingsUpdates; } /** * @deprecated Use v1->sims instead. */ protected function getSims(): \Twilio\Rest\Supersim\V1\SimList { echo "sims is deprecated. Use v1->sims instead."; return $this->v1->sims; } /** * @deprecated Use v1->sims(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextSims(string $sid): \Twilio\Rest\Supersim\V1\SimContext { echo "sims(\$sid) is deprecated. Use v1->sims(\$sid) instead."; return $this->v1->sims($sid); } /** * @deprecated Use v1->smsCommands instead. */ protected function getSmsCommands(): \Twilio\Rest\Supersim\V1\SmsCommandList { echo "smsCommands is deprecated. Use v1->smsCommands instead."; return $this->v1->smsCommands; } /** * @deprecated Use v1->smsCommands(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextSmsCommands(string $sid): \Twilio\Rest\Supersim\V1\SmsCommandContext { echo "smsCommands(\$sid) is deprecated. Use v1->smsCommands(\$sid) instead."; return $this->v1->smsCommands($sid); } /** * @deprecated Use v1->usageRecords instead. */ protected function getUsageRecords(): \Twilio\Rest\Supersim\V1\UsageRecordList { echo "usageRecords is deprecated. Use v1->usageRecords instead."; return $this->v1->usageRecords; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderContext.php 0000644 00000004563 15021223077 0020701 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class ChannelSenderContext extends InstanceContext { /** * Initialize the ChannelSenderContext * * @param Version $version Version that contains the resource * @param string $messagingServiceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to fetch the resource from. * @param string $sid The SID of the ChannelSender resource to fetch. */ public function __construct( Version $version, $messagingServiceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'messagingServiceSid' => $messagingServiceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) .'/ChannelSenders/' . \rawurlencode($sid) .''; } /** * Fetch the ChannelSenderInstance * * @return ChannelSenderInstance Fetched ChannelSenderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelSenderInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ChannelSenderInstance( $this->version, $payload, $this->solution['messagingServiceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ChannelSenderContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonOptions.php 0000644 00000036407 15021223077 0020723 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Options; use Twilio\Values; abstract class UsAppToPersonOptions { /** * @param string $optInMessage If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum. * @param string $optOutMessage Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. * @param string $helpMessage When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. * @param string[] $optInKeywords If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. * @param string[] $optOutKeywords End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. * @param string[] $helpKeywords End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. * @param bool $subscriberOptIn A boolean that specifies whether campaign has Subscriber Optin or not. * @param bool $ageGated A boolean that specifies whether campaign is age gated or not. * @param bool $directLending A boolean that specifies whether campaign allows direct lending or not. * @return CreateUsAppToPersonOptions Options builder */ public static function create( string $optInMessage = Values::NONE, string $optOutMessage = Values::NONE, string $helpMessage = Values::NONE, array $optInKeywords = Values::ARRAY_NONE, array $optOutKeywords = Values::ARRAY_NONE, array $helpKeywords = Values::ARRAY_NONE, bool $subscriberOptIn = Values::BOOL_NONE, bool $ageGated = Values::BOOL_NONE, bool $directLending = Values::BOOL_NONE ): CreateUsAppToPersonOptions { return new CreateUsAppToPersonOptions( $optInMessage, $optOutMessage, $helpMessage, $optInKeywords, $optOutKeywords, $helpKeywords, $subscriberOptIn, $ageGated, $directLending ); } } class CreateUsAppToPersonOptions extends Options { /** * @param string $optInMessage If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum. * @param string $optOutMessage Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. * @param string $helpMessage When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. * @param string[] $optInKeywords If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. * @param string[] $optOutKeywords End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. * @param string[] $helpKeywords End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. * @param bool $subscriberOptIn A boolean that specifies whether campaign has Subscriber Optin or not. * @param bool $ageGated A boolean that specifies whether campaign is age gated or not. * @param bool $directLending A boolean that specifies whether campaign allows direct lending or not. */ public function __construct( string $optInMessage = Values::NONE, string $optOutMessage = Values::NONE, string $helpMessage = Values::NONE, array $optInKeywords = Values::ARRAY_NONE, array $optOutKeywords = Values::ARRAY_NONE, array $helpKeywords = Values::ARRAY_NONE, bool $subscriberOptIn = Values::BOOL_NONE, bool $ageGated = Values::BOOL_NONE, bool $directLending = Values::BOOL_NONE ) { $this->options['optInMessage'] = $optInMessage; $this->options['optOutMessage'] = $optOutMessage; $this->options['helpMessage'] = $helpMessage; $this->options['optInKeywords'] = $optInKeywords; $this->options['optOutKeywords'] = $optOutKeywords; $this->options['helpKeywords'] = $helpKeywords; $this->options['subscriberOptIn'] = $subscriberOptIn; $this->options['ageGated'] = $ageGated; $this->options['directLending'] = $directLending; } /** * If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum. * * @param string $optInMessage If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum. * @return $this Fluent Builder */ public function setOptInMessage(string $optInMessage): self { $this->options['optInMessage'] = $optInMessage; return $this; } /** * Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. * * @param string $optOutMessage Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. * @return $this Fluent Builder */ public function setOptOutMessage(string $optOutMessage): self { $this->options['optOutMessage'] = $optOutMessage; return $this; } /** * When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. * * @param string $helpMessage When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. * @return $this Fluent Builder */ public function setHelpMessage(string $helpMessage): self { $this->options['helpMessage'] = $helpMessage; return $this; } /** * If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. * * @param string[] $optInKeywords If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. * @return $this Fluent Builder */ public function setOptInKeywords(array $optInKeywords): self { $this->options['optInKeywords'] = $optInKeywords; return $this; } /** * End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. * * @param string[] $optOutKeywords End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. * @return $this Fluent Builder */ public function setOptOutKeywords(array $optOutKeywords): self { $this->options['optOutKeywords'] = $optOutKeywords; return $this; } /** * End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. * * @param string[] $helpKeywords End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. * @return $this Fluent Builder */ public function setHelpKeywords(array $helpKeywords): self { $this->options['helpKeywords'] = $helpKeywords; return $this; } /** * A boolean that specifies whether campaign has Subscriber Optin or not. * * @param bool $subscriberOptIn A boolean that specifies whether campaign has Subscriber Optin or not. * @return $this Fluent Builder */ public function setSubscriberOptIn(bool $subscriberOptIn): self { $this->options['subscriberOptIn'] = $subscriberOptIn; return $this; } /** * A boolean that specifies whether campaign is age gated or not. * * @param bool $ageGated A boolean that specifies whether campaign is age gated or not. * @return $this Fluent Builder */ public function setAgeGated(bool $ageGated): self { $this->options['ageGated'] = $ageGated; return $this; } /** * A boolean that specifies whether campaign allows direct lending or not. * * @param bool $directLending A boolean that specifies whether campaign allows direct lending or not. * @return $this Fluent Builder */ public function setDirectLending(bool $directLending): self { $this->options['directLending'] = $directLending; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.CreateUsAppToPersonOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberInstance.php 0000644 00000010774 15021223077 0020533 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $phoneNumber * @property string|null $countryCode * @property string[]|null $capabilities * @property string|null $url */ class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the resource under. * @param string $sid The SID of the PhoneNumber resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'countryCode' => Values::array_get($payload, 'country_code'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PhoneNumberContext Context for this PhoneNumberInstance */ protected function proxy(): PhoneNumberContext { if (!$this->context) { $this->context = new PhoneNumberContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the PhoneNumberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PhoneNumberInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseInstance.php 0000644 00000004473 15021223077 0022343 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property array[]|null $usAppToPersonUsecases */ class UsAppToPersonUsecaseInstance extends InstanceResource { /** * Initialize the UsAppToPersonUsecaseInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to fetch the resource from. */ public function __construct(Version $version, array $payload, string $messagingServiceSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'usAppToPersonUsecases' => Values::array_get($payload, 'us_app_to_person_usecases'), ]; $this->solution = ['messagingServiceSid' => $messagingServiceSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.UsAppToPersonUsecaseInstance]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonInstance.php 0000644 00000020674 15021223077 0021033 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $brandRegistrationSid * @property string|null $messagingServiceSid * @property string|null $description * @property string[]|null $messageSamples * @property string|null $usAppToPersonUsecase * @property bool|null $hasEmbeddedLinks * @property bool|null $hasEmbeddedPhone * @property bool|null $subscriberOptIn * @property bool|null $ageGated * @property bool|null $directLending * @property string|null $campaignStatus * @property string|null $campaignId * @property bool|null $isExternallyRegistered * @property array|null $rateLimits * @property string|null $messageFlow * @property string|null $optInMessage * @property string|null $optOutMessage * @property string|null $helpMessage * @property string[]|null $optInKeywords * @property string[]|null $optOutKeywords * @property string[]|null $helpKeywords * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property bool|null $mock * @property array[]|null $errors */ class UsAppToPersonInstance extends InstanceResource { /** * Initialize the UsAppToPersonInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to create the resources from. * @param string $sid The SID of the US A2P Compliance resource to delete `QE2c6890da8086d771620e9b13fadeba0b`. */ public function __construct(Version $version, array $payload, string $messagingServiceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'brandRegistrationSid' => Values::array_get($payload, 'brand_registration_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'description' => Values::array_get($payload, 'description'), 'messageSamples' => Values::array_get($payload, 'message_samples'), 'usAppToPersonUsecase' => Values::array_get($payload, 'us_app_to_person_usecase'), 'hasEmbeddedLinks' => Values::array_get($payload, 'has_embedded_links'), 'hasEmbeddedPhone' => Values::array_get($payload, 'has_embedded_phone'), 'subscriberOptIn' => Values::array_get($payload, 'subscriber_opt_in'), 'ageGated' => Values::array_get($payload, 'age_gated'), 'directLending' => Values::array_get($payload, 'direct_lending'), 'campaignStatus' => Values::array_get($payload, 'campaign_status'), 'campaignId' => Values::array_get($payload, 'campaign_id'), 'isExternallyRegistered' => Values::array_get($payload, 'is_externally_registered'), 'rateLimits' => Values::array_get($payload, 'rate_limits'), 'messageFlow' => Values::array_get($payload, 'message_flow'), 'optInMessage' => Values::array_get($payload, 'opt_in_message'), 'optOutMessage' => Values::array_get($payload, 'opt_out_message'), 'helpMessage' => Values::array_get($payload, 'help_message'), 'optInKeywords' => Values::array_get($payload, 'opt_in_keywords'), 'optOutKeywords' => Values::array_get($payload, 'opt_out_keywords'), 'helpKeywords' => Values::array_get($payload, 'help_keywords'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'mock' => Values::array_get($payload, 'mock'), 'errors' => Values::array_get($payload, 'errors'), ]; $this->solution = ['messagingServiceSid' => $messagingServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UsAppToPersonContext Context for this UsAppToPersonInstance */ protected function proxy(): UsAppToPersonContext { if (!$this->context) { $this->context = new UsAppToPersonContext( $this->version, $this->solution['messagingServiceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UsAppToPersonInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UsAppToPersonInstance * * @return UsAppToPersonInstance Fetched UsAppToPersonInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UsAppToPersonInstance { return $this->proxy()->fetch(); } /** * Update the UsAppToPersonInstance * * @param bool $hasEmbeddedLinks Indicates that this SMS campaign will send messages that contain links. * @param bool $hasEmbeddedPhone Indicates that this SMS campaign will send messages that contain phone numbers. * @param string[] $messageSamples An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. * @param string $messageFlow Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. * @param string $description A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. * @param bool $ageGated A boolean that specifies whether campaign requires age gate for federally legal content. * @param bool $directLending A boolean that specifies whether campaign allows direct lending or not. * @return UsAppToPersonInstance Updated UsAppToPersonInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $hasEmbeddedLinks, bool $hasEmbeddedPhone, array $messageSamples, string $messageFlow, string $description, bool $ageGated, bool $directLending): UsAppToPersonInstance { return $this->proxy()->update($hasEmbeddedLinks, $hasEmbeddedPhone, $messageSamples, $messageFlow, $description, $ageGated, $directLending); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.UsAppToPersonInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecasePage.php 0000644 00000003234 15021223077 0021445 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UsAppToPersonUsecasePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UsAppToPersonUsecaseInstance \Twilio\Rest\Messaging\V1\Service\UsAppToPersonUsecaseInstance */ public function buildInstance(array $payload): UsAppToPersonUsecaseInstance { return new UsAppToPersonUsecaseInstance($this->version, $payload, $this->solution['messagingServiceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.UsAppToPersonUsecasePage]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonList.php 0000644 00000021643 15021223077 0020177 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class UsAppToPersonList extends ListResource { /** * Construct the UsAppToPersonList * * @param Version $version Version that contains the resource * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to create the resources from. */ public function __construct( Version $version, string $messagingServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'messagingServiceSid' => $messagingServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) .'/Compliance/Usa2p'; } /** * Create the UsAppToPersonInstance * * @param string $brandRegistrationSid A2P Brand Registration SID * @param string $description A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. * @param string $messageFlow Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. * @param string[] $messageSamples An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. * @param string $usAppToPersonUsecase A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING..] * @param bool $hasEmbeddedLinks Indicates that this SMS campaign will send messages that contain links. * @param bool $hasEmbeddedPhone Indicates that this SMS campaign will send messages that contain phone numbers. * @param array|Options $options Optional Arguments * @return UsAppToPersonInstance Created UsAppToPersonInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $brandRegistrationSid, string $description, string $messageFlow, array $messageSamples, string $usAppToPersonUsecase, bool $hasEmbeddedLinks, bool $hasEmbeddedPhone, array $options = []): UsAppToPersonInstance { $options = new Values($options); $data = Values::of([ 'BrandRegistrationSid' => $brandRegistrationSid, 'Description' => $description, 'MessageFlow' => $messageFlow, 'MessageSamples' => Serialize::map($messageSamples,function ($e) { return $e; }), 'UsAppToPersonUsecase' => $usAppToPersonUsecase, 'HasEmbeddedLinks' => Serialize::booleanToString($hasEmbeddedLinks), 'HasEmbeddedPhone' => Serialize::booleanToString($hasEmbeddedPhone), 'OptInMessage' => $options['optInMessage'], 'OptOutMessage' => $options['optOutMessage'], 'HelpMessage' => $options['helpMessage'], 'OptInKeywords' => Serialize::map($options['optInKeywords'], function ($e) { return $e; }), 'OptOutKeywords' => Serialize::map($options['optOutKeywords'], function ($e) { return $e; }), 'HelpKeywords' => Serialize::map($options['helpKeywords'], function ($e) { return $e; }), 'SubscriberOptIn' => Serialize::booleanToString($options['subscriberOptIn']), 'AgeGated' => Serialize::booleanToString($options['ageGated']), 'DirectLending' => Serialize::booleanToString($options['directLending']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new UsAppToPersonInstance( $this->version, $payload, $this->solution['messagingServiceSid'] ); } /** * Reads UsAppToPersonInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UsAppToPersonInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UsAppToPersonInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UsAppToPersonInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UsAppToPersonPage Page of UsAppToPersonInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UsAppToPersonPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UsAppToPersonPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UsAppToPersonInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UsAppToPersonPage Page of UsAppToPersonInstance */ public function getPage(string $targetUrl): UsAppToPersonPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UsAppToPersonPage($this->version, $response, $this->solution); } /** * Constructs a UsAppToPersonContext * * @param string $sid The SID of the US A2P Compliance resource to delete `QE2c6890da8086d771620e9b13fadeba0b`. */ public function getContext( string $sid ): UsAppToPersonContext { return new UsAppToPersonContext( $this->version, $this->solution['messagingServiceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.UsAppToPersonList]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonContext.php 0000644 00000012104 15021223077 0020700 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class UsAppToPersonContext extends InstanceContext { /** * Initialize the UsAppToPersonContext * * @param Version $version Version that contains the resource * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to create the resources from. * @param string $sid The SID of the US A2P Compliance resource to delete `QE2c6890da8086d771620e9b13fadeba0b`. */ public function __construct( Version $version, $messagingServiceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'messagingServiceSid' => $messagingServiceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) .'/Compliance/Usa2p/' . \rawurlencode($sid) .''; } /** * Delete the UsAppToPersonInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the UsAppToPersonInstance * * @return UsAppToPersonInstance Fetched UsAppToPersonInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UsAppToPersonInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new UsAppToPersonInstance( $this->version, $payload, $this->solution['messagingServiceSid'], $this->solution['sid'] ); } /** * Update the UsAppToPersonInstance * * @param bool $hasEmbeddedLinks Indicates that this SMS campaign will send messages that contain links. * @param bool $hasEmbeddedPhone Indicates that this SMS campaign will send messages that contain phone numbers. * @param string[] $messageSamples An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. * @param string $messageFlow Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. * @param string $description A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. * @param bool $ageGated A boolean that specifies whether campaign requires age gate for federally legal content. * @param bool $directLending A boolean that specifies whether campaign allows direct lending or not. * @return UsAppToPersonInstance Updated UsAppToPersonInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $hasEmbeddedLinks, bool $hasEmbeddedPhone, array $messageSamples, string $messageFlow, string $description, bool $ageGated, bool $directLending): UsAppToPersonInstance { $data = Values::of([ 'HasEmbeddedLinks' => Serialize::booleanToString($hasEmbeddedLinks), 'HasEmbeddedPhone' => Serialize::booleanToString($hasEmbeddedPhone), 'MessageSamples' => Serialize::map($messageSamples,function ($e) { return $e; }), 'MessageFlow' => $messageFlow, 'Description' => $description, 'AgeGated' => Serialize::booleanToString($ageGated), 'DirectLending' => Serialize::booleanToString($directLending), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new UsAppToPersonInstance( $this->version, $payload, $this->solution['messagingServiceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.UsAppToPersonContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberPage.php 0000644 00000003135 15021223077 0017634 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PhoneNumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return PhoneNumberInstance \Twilio\Rest\Messaging\V1\Service\PhoneNumberInstance */ public function buildInstance(array $payload): PhoneNumberInstance { return new PhoneNumberInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.PhoneNumberPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderPage.php 0000644 00000003162 15021223077 0020123 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ChannelSenderPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ChannelSenderInstance \Twilio\Rest\Messaging\V1\Service\ChannelSenderInstance */ public function buildInstance(array $payload): ChannelSenderInstance { return new ChannelSenderInstance($this->version, $payload, $this->solution['messagingServiceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.ChannelSenderPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderInstance.php 0000644 00000010614 15021223077 0020470 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $alphaSender * @property string[]|null $capabilities * @property string|null $url */ class AlphaSenderInstance extends InstanceResource { /** * Initialize the AlphaSenderInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the resource under. * @param string $sid The SID of the AlphaSender resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'alphaSender' => Values::array_get($payload, 'alpha_sender'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AlphaSenderContext Context for this AlphaSenderInstance */ protected function proxy(): AlphaSenderContext { if (!$this->context) { $this->context = new AlphaSenderContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the AlphaSenderInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AlphaSenderInstance * * @return AlphaSenderInstance Fetched AlphaSenderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AlphaSenderInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.AlphaSenderInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseOptions.php 0000644 00000004114 15021223077 0022222 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Options; use Twilio\Values; abstract class UsAppToPersonUsecaseOptions { /** * @param string $brandRegistrationSid The unique string to identify the A2P brand. * @return FetchUsAppToPersonUsecaseOptions Options builder */ public static function fetch( string $brandRegistrationSid = Values::NONE ): FetchUsAppToPersonUsecaseOptions { return new FetchUsAppToPersonUsecaseOptions( $brandRegistrationSid ); } } class FetchUsAppToPersonUsecaseOptions extends Options { /** * @param string $brandRegistrationSid The unique string to identify the A2P brand. */ public function __construct( string $brandRegistrationSid = Values::NONE ) { $this->options['brandRegistrationSid'] = $brandRegistrationSid; } /** * The unique string to identify the A2P brand. * * @param string $brandRegistrationSid The unique string to identify the A2P brand. * @return $this Fluent Builder */ public function setBrandRegistrationSid(string $brandRegistrationSid): self { $this->options['brandRegistrationSid'] = $brandRegistrationSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.FetchUsAppToPersonUsecaseOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeList.php 0000644 00000014175 15021223077 0017351 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ShortCodeList extends ListResource { /** * Construct the ShortCodeList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the resource under. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/ShortCodes'; } /** * Create the ShortCodeInstance * * @param string $shortCodeSid The SID of the ShortCode resource being added to the Service. * @return ShortCodeInstance Created ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $shortCodeSid): ShortCodeInstance { $data = Values::of([ 'ShortCodeSid' => $shortCodeSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ShortCodeInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads ShortCodeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ShortCodeInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ShortCodeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ShortCodeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ShortCodePage Page of ShortCodeInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ShortCodePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ShortCodePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ShortCodeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ShortCodePage Page of ShortCodeInstance */ public function getPage(string $targetUrl): ShortCodePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ShortCodePage($this->version, $response, $this->solution); } /** * Constructs a ShortCodeContext * * @param string $sid The SID of the ShortCode resource to delete. */ public function getContext( string $sid ): ShortCodeContext { return new ShortCodeContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.ShortCodeList]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderList.php 0000644 00000014476 15021223077 0017651 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AlphaSenderList extends ListResource { /** * Construct the AlphaSenderList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the resource under. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/AlphaSenders'; } /** * Create the AlphaSenderInstance * * @param string $alphaSender The Alphanumeric Sender ID string. Can be up to 11 characters long. Valid characters are A-Z, a-z, 0-9, space, hyphen `-`, plus `+`, underscore `_` and ampersand `&`. This value cannot contain only numbers. * @return AlphaSenderInstance Created AlphaSenderInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $alphaSender): AlphaSenderInstance { $data = Values::of([ 'AlphaSender' => $alphaSender, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AlphaSenderInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads AlphaSenderInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AlphaSenderInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AlphaSenderInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AlphaSenderInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AlphaSenderPage Page of AlphaSenderInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AlphaSenderPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AlphaSenderPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AlphaSenderInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AlphaSenderPage Page of AlphaSenderInstance */ public function getPage(string $targetUrl): AlphaSenderPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AlphaSenderPage($this->version, $response, $this->solution); } /** * Constructs a AlphaSenderContext * * @param string $sid The SID of the AlphaSender resource to delete. */ public function getContext( string $sid ): AlphaSenderContext { return new AlphaSenderContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.AlphaSenderList]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseList.php 0000644 00000004607 15021223077 0021511 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class UsAppToPersonUsecaseList extends ListResource { /** * Construct the UsAppToPersonUsecaseList * * @param Version $version Version that contains the resource * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to fetch the resource from. */ public function __construct( Version $version, string $messagingServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'messagingServiceSid' => $messagingServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) .'/Compliance/Usa2p/Usecases'; } /** * Fetch the UsAppToPersonUsecaseInstance * * @param array|Options $options Optional Arguments * @return UsAppToPersonUsecaseInstance Fetched UsAppToPersonUsecaseInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): UsAppToPersonUsecaseInstance { $options = new Values($options); $params = Values::of([ 'BrandRegistrationSid' => $options['brandRegistrationSid'], ]); $payload = $this->version->fetch('GET', $this->uri, $params, []); return new UsAppToPersonUsecaseInstance( $this->version, $payload, $this->solution['messagingServiceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.UsAppToPersonUsecaseList]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberContext.php 0000644 00000005117 15021223077 0020406 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class PhoneNumberContext extends InstanceContext { /** * Initialize the PhoneNumberContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the resource under. * @param string $sid The SID of the PhoneNumber resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/PhoneNumbers/' . \rawurlencode($sid) .''; } /** * Delete the PhoneNumberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PhoneNumberInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new PhoneNumberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeInstance.php 0000644 00000010734 15021223077 0020177 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $shortCode * @property string|null $countryCode * @property string[]|null $capabilities * @property string|null $url */ class ShortCodeInstance extends InstanceResource { /** * Initialize the ShortCodeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the resource under. * @param string $sid The SID of the ShortCode resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'shortCode' => Values::array_get($payload, 'short_code'), 'countryCode' => Values::array_get($payload, 'country_code'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ShortCodeContext Context for this ShortCodeInstance */ protected function proxy(): ShortCodeContext { if (!$this->context) { $this->context = new ShortCodeContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ShortCodeInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ShortCodeInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ShortCodeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberList.php 0000644 00000014263 15021223077 0017677 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class PhoneNumberList extends ListResource { /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the resource under. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/PhoneNumbers'; } /** * Create the PhoneNumberInstance * * @param string $phoneNumberSid The SID of the Phone Number being added to the Service. * @return PhoneNumberInstance Created PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumberSid): PhoneNumberInstance { $data = Values::of([ 'PhoneNumberSid' => $phoneNumberSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new PhoneNumberInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads PhoneNumberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PhoneNumberInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams PhoneNumberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return PhoneNumberPage Page of PhoneNumberInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): PhoneNumberPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return PhoneNumberPage Page of PhoneNumberInstance */ public function getPage(string $targetUrl): PhoneNumberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Constructs a PhoneNumberContext * * @param string $sid The SID of the PhoneNumber resource to delete. */ public function getContext( string $sid ): PhoneNumberContext { return new PhoneNumberContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderPage.php 0000644 00000003135 15021223077 0017600 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AlphaSenderPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AlphaSenderInstance \Twilio\Rest\Messaging\V1\Service\AlphaSenderInstance */ public function buildInstance(array $payload): AlphaSenderInstance { return new AlphaSenderInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.AlphaSenderPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderInstance.php 0000644 00000010465 15021223077 0021017 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $messagingServiceSid * @property string|null $sid * @property string|null $sender * @property string|null $senderType * @property string|null $countryCode * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class ChannelSenderInstance extends InstanceResource { /** * Initialize the ChannelSenderInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $messagingServiceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to fetch the resource from. * @param string $sid The SID of the ChannelSender resource to fetch. */ public function __construct(Version $version, array $payload, string $messagingServiceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'sender' => Values::array_get($payload, 'sender'), 'senderType' => Values::array_get($payload, 'sender_type'), 'countryCode' => Values::array_get($payload, 'country_code'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['messagingServiceSid' => $messagingServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ChannelSenderContext Context for this ChannelSenderInstance */ protected function proxy(): ChannelSenderContext { if (!$this->context) { $this->context = new ChannelSenderContext( $this->version, $this->solution['messagingServiceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the ChannelSenderInstance * * @return ChannelSenderInstance Fetched ChannelSenderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelSenderInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ChannelSenderInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderContext.php 0000644 00000005117 15021223077 0020352 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class AlphaSenderContext extends InstanceContext { /** * Initialize the AlphaSenderContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the resource under. * @param string $sid The SID of the AlphaSender resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/AlphaSenders/' . \rawurlencode($sid) .''; } /** * Delete the AlphaSenderInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the AlphaSenderInstance * * @return AlphaSenderInstance Fetched AlphaSenderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AlphaSenderInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AlphaSenderInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.AlphaSenderContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeContext.php 0000644 00000005071 15021223077 0020055 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class ShortCodeContext extends InstanceContext { /** * Initialize the ShortCodeContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the resource under. * @param string $sid The SID of the ShortCode resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/ShortCodes/' . \rawurlencode($sid) .''; } /** * Delete the ShortCodeInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ShortCodeInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ShortCodeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ShortCodeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/UsAppToPersonPage.php 0000644 00000003162 15021223077 0020134 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UsAppToPersonPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UsAppToPersonInstance \Twilio\Rest\Messaging\V1\Service\UsAppToPersonInstance */ public function buildInstance(array $payload): UsAppToPersonInstance { return new UsAppToPersonInstance($this->version, $payload, $this->solution['messagingServiceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.UsAppToPersonPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodePage.php 0000644 00000003121 15021223077 0017277 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ShortCodePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ShortCodeInstance \Twilio\Rest\Messaging\V1\Service\ShortCodeInstance */ public function buildInstance(array $payload): ShortCodeInstance { return new ShortCodeInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.ShortCodePage]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ChannelSenderList.php 0000644 00000013072 15021223077 0020163 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ChannelSenderList extends ListResource { /** * Construct the ChannelSenderList * * @param Version $version Version that contains the resource * @param string $messagingServiceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to fetch the resource from. */ public function __construct( Version $version, string $messagingServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'messagingServiceSid' => $messagingServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) .'/ChannelSenders'; } /** * Reads ChannelSenderInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelSenderInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ChannelSenderInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ChannelSenderInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ChannelSenderPage Page of ChannelSenderInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ChannelSenderPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChannelSenderPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelSenderInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ChannelSenderPage Page of ChannelSenderInstance */ public function getPage(string $targetUrl): ChannelSenderPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelSenderPage($this->version, $response, $this->solution); } /** * Constructs a ChannelSenderContext * * @param string $sid The SID of the ChannelSender resource to fetch. */ public function getContext( string $sid ): ChannelSenderContext { return new ChannelSenderContext( $this->version, $this->solution['messagingServiceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.ChannelSenderList]'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationList.php 0000644 00000003426 15021223077 0025556 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\ListResource; use Twilio\Version; class LinkshorteningMessagingServiceDomainAssociationList extends ListResource { /** * Construct the LinkshorteningMessagingServiceDomainAssociationList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a LinkshorteningMessagingServiceDomainAssociationContext * * @param string $messagingServiceSid Unique string used to identify the Messaging service that this domain should be associated with. */ public function getContext( string $messagingServiceSid ): LinkshorteningMessagingServiceDomainAssociationContext { return new LinkshorteningMessagingServiceDomainAssociationContext( $this->version, $messagingServiceSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceDomainAssociationList]'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceList.php 0000644 00000003244 15021223077 0021566 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\ListResource; use Twilio\Version; class DomainConfigMessagingServiceList extends ListResource { /** * Construct the DomainConfigMessagingServiceList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a DomainConfigMessagingServiceContext * * @param string $messagingServiceSid Unique string used to identify the Messaging service that this domain should be associated with. */ public function getContext( string $messagingServiceSid ): DomainConfigMessagingServiceContext { return new DomainConfigMessagingServiceContext( $this->version, $messagingServiceSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.DomainConfigMessagingServiceList]'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigOptions.php 0000644 00000014075 15021223077 0017133 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Options; use Twilio\Values; abstract class DomainConfigOptions { /** * @param string $fallbackUrl Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping. * @param string $callbackUrl URL to receive click events to your webhook whenever the recipients click on the shortened links * @param bool $continueOnFailure Boolean field to set customer delivery preference when there is a failure in linkShortening service * @param bool $disableHttps Customer's choice to send links with/without \\\"https://\\\" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified. * @return UpdateDomainConfigOptions Options builder */ public static function update( string $fallbackUrl = Values::NONE, string $callbackUrl = Values::NONE, bool $continueOnFailure = Values::BOOL_NONE, bool $disableHttps = Values::BOOL_NONE ): UpdateDomainConfigOptions { return new UpdateDomainConfigOptions( $fallbackUrl, $callbackUrl, $continueOnFailure, $disableHttps ); } } class UpdateDomainConfigOptions extends Options { /** * @param string $fallbackUrl Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping. * @param string $callbackUrl URL to receive click events to your webhook whenever the recipients click on the shortened links * @param bool $continueOnFailure Boolean field to set customer delivery preference when there is a failure in linkShortening service * @param bool $disableHttps Customer's choice to send links with/without \\\"https://\\\" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified. */ public function __construct( string $fallbackUrl = Values::NONE, string $callbackUrl = Values::NONE, bool $continueOnFailure = Values::BOOL_NONE, bool $disableHttps = Values::BOOL_NONE ) { $this->options['fallbackUrl'] = $fallbackUrl; $this->options['callbackUrl'] = $callbackUrl; $this->options['continueOnFailure'] = $continueOnFailure; $this->options['disableHttps'] = $disableHttps; } /** * Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping. * * @param string $fallbackUrl Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping. * @return $this Fluent Builder */ public function setFallbackUrl(string $fallbackUrl): self { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * URL to receive click events to your webhook whenever the recipients click on the shortened links * * @param string $callbackUrl URL to receive click events to your webhook whenever the recipients click on the shortened links * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Boolean field to set customer delivery preference when there is a failure in linkShortening service * * @param bool $continueOnFailure Boolean field to set customer delivery preference when there is a failure in linkShortening service * @return $this Fluent Builder */ public function setContinueOnFailure(bool $continueOnFailure): self { $this->options['continueOnFailure'] = $continueOnFailure; return $this; } /** * Customer's choice to send links with/without \\\"https://\\\" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified. * * @param bool $disableHttps Customer's choice to send links with/without \\\"https://\\\" attached to shortened url. If true, messages will not be sent with https:// at the beginning of the url. If false, messages will be sent with https:// at the beginning of the url. False is the default behavior if it is not specified. * @return $this Fluent Builder */ public function setDisableHttps(bool $disableHttps): self { $this->options['disableHttps'] = $disableHttps; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.UpdateDomainConfigOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceInstance.php 0000644 00000010574 15021223077 0022423 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $domainSid * @property string|null $configSid * @property string|null $messagingServiceSid * @property string|null $fallbackUrl * @property string|null $callbackUrl * @property bool|null $continueOnFailure * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class DomainConfigMessagingServiceInstance extends InstanceResource { /** * Initialize the DomainConfigMessagingServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $messagingServiceSid Unique string used to identify the Messaging service that this domain should be associated with. */ public function __construct(Version $version, array $payload, string $messagingServiceSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'domainSid' => Values::array_get($payload, 'domain_sid'), 'configSid' => Values::array_get($payload, 'config_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'fallbackUrl' => Values::array_get($payload, 'fallback_url'), 'callbackUrl' => Values::array_get($payload, 'callback_url'), 'continueOnFailure' => Values::array_get($payload, 'continue_on_failure'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['messagingServiceSid' => $messagingServiceSid ?: $this->properties['messagingServiceSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DomainConfigMessagingServiceContext Context for this DomainConfigMessagingServiceInstance */ protected function proxy(): DomainConfigMessagingServiceContext { if (!$this->context) { $this->context = new DomainConfigMessagingServiceContext( $this->version, $this->solution['messagingServiceSid'] ); } return $this->context; } /** * Fetch the DomainConfigMessagingServiceInstance * * @return DomainConfigMessagingServiceInstance Fetched DomainConfigMessagingServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainConfigMessagingServiceInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.DomainConfigMessagingServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigContext.php 0000644 00000006143 15021223077 0017121 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class DomainConfigContext extends InstanceContext { /** * Initialize the DomainConfigContext * * @param Version $version Version that contains the resource * @param string $domainSid Unique string used to identify the domain that this config should be associated with. */ public function __construct( Version $version, $domainSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'domainSid' => $domainSid, ]; $this->uri = '/LinkShortening/Domains/' . \rawurlencode($domainSid) .'/Config'; } /** * Fetch the DomainConfigInstance * * @return DomainConfigInstance Fetched DomainConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainConfigInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new DomainConfigInstance( $this->version, $payload, $this->solution['domainSid'] ); } /** * Update the DomainConfigInstance * * @param array|Options $options Optional Arguments * @return DomainConfigInstance Updated DomainConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DomainConfigInstance { $options = new Values($options); $data = Values::of([ 'FallbackUrl' => $options['fallbackUrl'], 'CallbackUrl' => $options['callbackUrl'], 'ContinueOnFailure' => Serialize::booleanToString($options['continueOnFailure']), 'DisableHttps' => Serialize::booleanToString($options['disableHttps']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DomainConfigInstance( $this->version, $payload, $this->solution['domainSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.DomainConfigContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainCertsList.php 0000644 00000003032 15021223077 0016255 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\ListResource; use Twilio\Version; class DomainCertsList extends ListResource { /** * Construct the DomainCertsList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a DomainCertsContext * * @param string $domainSid Unique string used to identify the domain that this certificate should be associated with. */ public function getContext( string $domainSid ): DomainCertsContext { return new DomainCertsContext( $this->version, $domainSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.DomainCertsList]'; } } sdk/src/Twilio/Rest/Messaging/V1/ServiceInstance.php 0000644 00000017447 15021223077 0016315 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Messaging\V1\Service\AlphaSenderList; use Twilio\Rest\Messaging\V1\Service\PhoneNumberList; use Twilio\Rest\Messaging\V1\Service\UsAppToPersonUsecaseList; use Twilio\Rest\Messaging\V1\Service\ChannelSenderList; use Twilio\Rest\Messaging\V1\Service\ShortCodeList; use Twilio\Rest\Messaging\V1\Service\UsAppToPersonList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $inboundRequestUrl * @property string|null $inboundMethod * @property string|null $fallbackUrl * @property string|null $fallbackMethod * @property string|null $statusCallback * @property bool|null $stickySender * @property bool|null $mmsConverter * @property bool|null $smartEncoding * @property string $scanMessageContent * @property bool|null $fallbackToLongCode * @property bool|null $areaCodeGeomatch * @property bool|null $synchronousValidation * @property int|null $validityPeriod * @property string|null $url * @property array|null $links * @property string|null $usecase * @property bool|null $usAppToPersonRegistered * @property bool|null $useInboundWebhookOnNumber */ class ServiceInstance extends InstanceResource { protected $_alphaSenders; protected $_phoneNumbers; protected $_usAppToPersonUsecases; protected $_channelSenders; protected $_shortCodes; protected $_usAppToPerson; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Service resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'inboundRequestUrl' => Values::array_get($payload, 'inbound_request_url'), 'inboundMethod' => Values::array_get($payload, 'inbound_method'), 'fallbackUrl' => Values::array_get($payload, 'fallback_url'), 'fallbackMethod' => Values::array_get($payload, 'fallback_method'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'stickySender' => Values::array_get($payload, 'sticky_sender'), 'mmsConverter' => Values::array_get($payload, 'mms_converter'), 'smartEncoding' => Values::array_get($payload, 'smart_encoding'), 'scanMessageContent' => Values::array_get($payload, 'scan_message_content'), 'fallbackToLongCode' => Values::array_get($payload, 'fallback_to_long_code'), 'areaCodeGeomatch' => Values::array_get($payload, 'area_code_geomatch'), 'synchronousValidation' => Values::array_get($payload, 'synchronous_validation'), 'validityPeriod' => Values::array_get($payload, 'validity_period'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'usecase' => Values::array_get($payload, 'usecase'), 'usAppToPersonRegistered' => Values::array_get($payload, 'us_app_to_person_registered'), 'useInboundWebhookOnNumber' => Values::array_get($payload, 'use_inbound_webhook_on_number'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the alphaSenders */ protected function getAlphaSenders(): AlphaSenderList { return $this->proxy()->alphaSenders; } /** * Access the phoneNumbers */ protected function getPhoneNumbers(): PhoneNumberList { return $this->proxy()->phoneNumbers; } /** * Access the usAppToPersonUsecases */ protected function getUsAppToPersonUsecases(): UsAppToPersonUsecaseList { return $this->proxy()->usAppToPersonUsecases; } /** * Access the channelSenders */ protected function getChannelSenders(): ChannelSenderList { return $this->proxy()->channelSenders; } /** * Access the shortCodes */ protected function getShortCodes(): ShortCodeList { return $this->proxy()->shortCodes; } /** * Access the usAppToPerson */ protected function getUsAppToPerson(): UsAppToPersonList { return $this->proxy()->usAppToPerson; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/ServiceList.php 0000644 00000016356 15021223077 0015462 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param array|Options $options Optional Arguments * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'InboundRequestUrl' => $options['inboundRequestUrl'], 'InboundMethod' => $options['inboundMethod'], 'FallbackUrl' => $options['fallbackUrl'], 'FallbackMethod' => $options['fallbackMethod'], 'StatusCallback' => $options['statusCallback'], 'StickySender' => Serialize::booleanToString($options['stickySender']), 'MmsConverter' => Serialize::booleanToString($options['mmsConverter']), 'SmartEncoding' => Serialize::booleanToString($options['smartEncoding']), 'ScanMessageContent' => $options['scanMessageContent'], 'FallbackToLongCode' => Serialize::booleanToString($options['fallbackToLongCode']), 'AreaCodeGeomatch' => Serialize::booleanToString($options['areaCodeGeomatch']), 'ValidityPeriod' => $options['validityPeriod'], 'SynchronousValidation' => Serialize::booleanToString($options['synchronousValidation']), 'Usecase' => $options['usecase'], 'UseInboundWebhookOnNumber' => Serialize::booleanToString($options['useInboundWebhookOnNumber']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The SID of the Service resource to delete. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationContext.php 0000644 00000011561 15021223077 0020703 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class TollfreeVerificationContext extends InstanceContext { /** * Initialize the TollfreeVerificationContext * * @param Version $version Version that contains the resource * @param string $sid The unique string to identify Tollfree Verification. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Tollfree/Verifications/' . \rawurlencode($sid) .''; } /** * Delete the TollfreeVerificationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the TollfreeVerificationInstance * * @return TollfreeVerificationInstance Fetched TollfreeVerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TollfreeVerificationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new TollfreeVerificationInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the TollfreeVerificationInstance * * @param array|Options $options Optional Arguments * @return TollfreeVerificationInstance Updated TollfreeVerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TollfreeVerificationInstance { $options = new Values($options); $data = Values::of([ 'BusinessName' => $options['businessName'], 'BusinessWebsite' => $options['businessWebsite'], 'NotificationEmail' => $options['notificationEmail'], 'UseCaseCategories' => Serialize::map($options['useCaseCategories'], function ($e) { return $e; }), 'UseCaseSummary' => $options['useCaseSummary'], 'ProductionMessageSample' => $options['productionMessageSample'], 'OptInImageUrls' => Serialize::map($options['optInImageUrls'], function ($e) { return $e; }), 'OptInType' => $options['optInType'], 'MessageVolume' => $options['messageVolume'], 'BusinessStreetAddress' => $options['businessStreetAddress'], 'BusinessStreetAddress2' => $options['businessStreetAddress2'], 'BusinessCity' => $options['businessCity'], 'BusinessStateProvinceRegion' => $options['businessStateProvinceRegion'], 'BusinessPostalCode' => $options['businessPostalCode'], 'BusinessCountry' => $options['businessCountry'], 'AdditionalInformation' => $options['additionalInformation'], 'BusinessContactFirstName' => $options['businessContactFirstName'], 'BusinessContactLastName' => $options['businessContactLastName'], 'BusinessContactEmail' => $options['businessContactEmail'], 'BusinessContactPhone' => $options['businessContactPhone'], 'EditReason' => $options['editReason'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new TollfreeVerificationInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.TollfreeVerificationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationContext.php 0000644 00000004675 15021223077 0026276 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class LinkshorteningMessagingServiceDomainAssociationContext extends InstanceContext { /** * Initialize the LinkshorteningMessagingServiceDomainAssociationContext * * @param Version $version Version that contains the resource * @param string $messagingServiceSid Unique string used to identify the Messaging service that this domain should be associated with. */ public function __construct( Version $version, $messagingServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'messagingServiceSid' => $messagingServiceSid, ]; $this->uri = '/LinkShortening/MessagingServices/' . \rawurlencode($messagingServiceSid) .'/Domain'; } /** * Fetch the LinkshorteningMessagingServiceDomainAssociationInstance * * @return LinkshorteningMessagingServiceDomainAssociationInstance Fetched LinkshorteningMessagingServiceDomainAssociationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): LinkshorteningMessagingServiceDomainAssociationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new LinkshorteningMessagingServiceDomainAssociationInstance( $this->version, $payload, $this->solution['messagingServiceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceDomainAssociationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/ServiceOptions.php 0000644 00000112645 15021223077 0016200 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param string $inboundRequestUrl The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. * @param string $inboundMethod The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. * @param string $fallbackUrl The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. * @param string $fallbackMethod The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. * @param string $statusCallback The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. * @param bool $stickySender Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. * @param bool $mmsConverter Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. * @param bool $smartEncoding Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. * @param string $scanMessageContent * @param bool $fallbackToLongCode [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. * @param bool $areaCodeGeomatch Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. * @param int $validityPeriod How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. * @param bool $synchronousValidation Reserved. * @param string $usecase A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. * @param bool $useInboundWebhookOnNumber A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. * @return CreateServiceOptions Options builder */ public static function create( string $inboundRequestUrl = Values::NONE, string $inboundMethod = Values::NONE, string $fallbackUrl = Values::NONE, string $fallbackMethod = Values::NONE, string $statusCallback = Values::NONE, bool $stickySender = Values::BOOL_NONE, bool $mmsConverter = Values::BOOL_NONE, bool $smartEncoding = Values::BOOL_NONE, string $scanMessageContent = Values::NONE, bool $fallbackToLongCode = Values::BOOL_NONE, bool $areaCodeGeomatch = Values::BOOL_NONE, int $validityPeriod = Values::INT_NONE, bool $synchronousValidation = Values::BOOL_NONE, string $usecase = Values::NONE, bool $useInboundWebhookOnNumber = Values::BOOL_NONE ): CreateServiceOptions { return new CreateServiceOptions( $inboundRequestUrl, $inboundMethod, $fallbackUrl, $fallbackMethod, $statusCallback, $stickySender, $mmsConverter, $smartEncoding, $scanMessageContent, $fallbackToLongCode, $areaCodeGeomatch, $validityPeriod, $synchronousValidation, $usecase, $useInboundWebhookOnNumber ); } /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $inboundRequestUrl The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. * @param string $inboundMethod The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. * @param string $fallbackUrl The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. * @param string $fallbackMethod The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. * @param string $statusCallback The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. * @param bool $stickySender Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. * @param bool $mmsConverter Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. * @param bool $smartEncoding Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. * @param string $scanMessageContent * @param bool $fallbackToLongCode [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. * @param bool $areaCodeGeomatch Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. * @param int $validityPeriod How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. * @param bool $synchronousValidation Reserved. * @param string $usecase A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. * @param bool $useInboundWebhookOnNumber A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. * @return UpdateServiceOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $inboundRequestUrl = Values::NONE, string $inboundMethod = Values::NONE, string $fallbackUrl = Values::NONE, string $fallbackMethod = Values::NONE, string $statusCallback = Values::NONE, bool $stickySender = Values::BOOL_NONE, bool $mmsConverter = Values::BOOL_NONE, bool $smartEncoding = Values::BOOL_NONE, string $scanMessageContent = Values::NONE, bool $fallbackToLongCode = Values::BOOL_NONE, bool $areaCodeGeomatch = Values::BOOL_NONE, int $validityPeriod = Values::INT_NONE, bool $synchronousValidation = Values::BOOL_NONE, string $usecase = Values::NONE, bool $useInboundWebhookOnNumber = Values::BOOL_NONE ): UpdateServiceOptions { return new UpdateServiceOptions( $friendlyName, $inboundRequestUrl, $inboundMethod, $fallbackUrl, $fallbackMethod, $statusCallback, $stickySender, $mmsConverter, $smartEncoding, $scanMessageContent, $fallbackToLongCode, $areaCodeGeomatch, $validityPeriod, $synchronousValidation, $usecase, $useInboundWebhookOnNumber ); } } class CreateServiceOptions extends Options { /** * @param string $inboundRequestUrl The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. * @param string $inboundMethod The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. * @param string $fallbackUrl The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. * @param string $fallbackMethod The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. * @param string $statusCallback The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. * @param bool $stickySender Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. * @param bool $mmsConverter Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. * @param bool $smartEncoding Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. * @param string $scanMessageContent * @param bool $fallbackToLongCode [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. * @param bool $areaCodeGeomatch Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. * @param int $validityPeriod How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. * @param bool $synchronousValidation Reserved. * @param string $usecase A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. * @param bool $useInboundWebhookOnNumber A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. */ public function __construct( string $inboundRequestUrl = Values::NONE, string $inboundMethod = Values::NONE, string $fallbackUrl = Values::NONE, string $fallbackMethod = Values::NONE, string $statusCallback = Values::NONE, bool $stickySender = Values::BOOL_NONE, bool $mmsConverter = Values::BOOL_NONE, bool $smartEncoding = Values::BOOL_NONE, string $scanMessageContent = Values::NONE, bool $fallbackToLongCode = Values::BOOL_NONE, bool $areaCodeGeomatch = Values::BOOL_NONE, int $validityPeriod = Values::INT_NONE, bool $synchronousValidation = Values::BOOL_NONE, string $usecase = Values::NONE, bool $useInboundWebhookOnNumber = Values::BOOL_NONE ) { $this->options['inboundRequestUrl'] = $inboundRequestUrl; $this->options['inboundMethod'] = $inboundMethod; $this->options['fallbackUrl'] = $fallbackUrl; $this->options['fallbackMethod'] = $fallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['stickySender'] = $stickySender; $this->options['mmsConverter'] = $mmsConverter; $this->options['smartEncoding'] = $smartEncoding; $this->options['scanMessageContent'] = $scanMessageContent; $this->options['fallbackToLongCode'] = $fallbackToLongCode; $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; $this->options['validityPeriod'] = $validityPeriod; $this->options['synchronousValidation'] = $synchronousValidation; $this->options['usecase'] = $usecase; $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; } /** * The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. * * @param string $inboundRequestUrl The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. * @return $this Fluent Builder */ public function setInboundRequestUrl(string $inboundRequestUrl): self { $this->options['inboundRequestUrl'] = $inboundRequestUrl; return $this; } /** * The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. * * @param string $inboundMethod The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setInboundMethod(string $inboundMethod): self { $this->options['inboundMethod'] = $inboundMethod; return $this; } /** * The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. * * @param string $fallbackUrl The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. * @return $this Fluent Builder */ public function setFallbackUrl(string $fallbackUrl): self { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. * * @param string $fallbackMethod The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setFallbackMethod(string $fallbackMethod): self { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. * * @param string $statusCallback The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. * * @param bool $stickySender Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. * @return $this Fluent Builder */ public function setStickySender(bool $stickySender): self { $this->options['stickySender'] = $stickySender; return $this; } /** * Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. * * @param bool $mmsConverter Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. * @return $this Fluent Builder */ public function setMmsConverter(bool $mmsConverter): self { $this->options['mmsConverter'] = $mmsConverter; return $this; } /** * Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. * * @param bool $smartEncoding Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. * @return $this Fluent Builder */ public function setSmartEncoding(bool $smartEncoding): self { $this->options['smartEncoding'] = $smartEncoding; return $this; } /** * @param string $scanMessageContent * @return $this Fluent Builder */ public function setScanMessageContent(string $scanMessageContent): self { $this->options['scanMessageContent'] = $scanMessageContent; return $this; } /** * [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. * * @param bool $fallbackToLongCode [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. * @return $this Fluent Builder */ public function setFallbackToLongCode(bool $fallbackToLongCode): self { $this->options['fallbackToLongCode'] = $fallbackToLongCode; return $this; } /** * Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. * * @param bool $areaCodeGeomatch Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. * @return $this Fluent Builder */ public function setAreaCodeGeomatch(bool $areaCodeGeomatch): self { $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; return $this; } /** * How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. * * @param int $validityPeriod How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. * @return $this Fluent Builder */ public function setValidityPeriod(int $validityPeriod): self { $this->options['validityPeriod'] = $validityPeriod; return $this; } /** * Reserved. * * @param bool $synchronousValidation Reserved. * @return $this Fluent Builder */ public function setSynchronousValidation(bool $synchronousValidation): self { $this->options['synchronousValidation'] = $synchronousValidation; return $this; } /** * A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. * * @param string $usecase A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. * @return $this Fluent Builder */ public function setUsecase(string $usecase): self { $this->options['usecase'] = $usecase; return $this; } /** * A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. * * @param bool $useInboundWebhookOnNumber A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. * @return $this Fluent Builder */ public function setUseInboundWebhookOnNumber(bool $useInboundWebhookOnNumber): self { $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.CreateServiceOptions ' . $options . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $inboundRequestUrl The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. * @param string $inboundMethod The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. * @param string $fallbackUrl The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. * @param string $fallbackMethod The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. * @param string $statusCallback The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. * @param bool $stickySender Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. * @param bool $mmsConverter Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. * @param bool $smartEncoding Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. * @param string $scanMessageContent * @param bool $fallbackToLongCode [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. * @param bool $areaCodeGeomatch Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. * @param int $validityPeriod How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. * @param bool $synchronousValidation Reserved. * @param string $usecase A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. * @param bool $useInboundWebhookOnNumber A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. */ public function __construct( string $friendlyName = Values::NONE, string $inboundRequestUrl = Values::NONE, string $inboundMethod = Values::NONE, string $fallbackUrl = Values::NONE, string $fallbackMethod = Values::NONE, string $statusCallback = Values::NONE, bool $stickySender = Values::BOOL_NONE, bool $mmsConverter = Values::BOOL_NONE, bool $smartEncoding = Values::BOOL_NONE, string $scanMessageContent = Values::NONE, bool $fallbackToLongCode = Values::BOOL_NONE, bool $areaCodeGeomatch = Values::BOOL_NONE, int $validityPeriod = Values::INT_NONE, bool $synchronousValidation = Values::BOOL_NONE, string $usecase = Values::NONE, bool $useInboundWebhookOnNumber = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['inboundRequestUrl'] = $inboundRequestUrl; $this->options['inboundMethod'] = $inboundMethod; $this->options['fallbackUrl'] = $fallbackUrl; $this->options['fallbackMethod'] = $fallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['stickySender'] = $stickySender; $this->options['mmsConverter'] = $mmsConverter; $this->options['smartEncoding'] = $smartEncoding; $this->options['scanMessageContent'] = $scanMessageContent; $this->options['fallbackToLongCode'] = $fallbackToLongCode; $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; $this->options['validityPeriod'] = $validityPeriod; $this->options['synchronousValidation'] = $synchronousValidation; $this->options['usecase'] = $usecase; $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. * * @param string $inboundRequestUrl The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. * @return $this Fluent Builder */ public function setInboundRequestUrl(string $inboundRequestUrl): self { $this->options['inboundRequestUrl'] = $inboundRequestUrl; return $this; } /** * The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. * * @param string $inboundMethod The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setInboundMethod(string $inboundMethod): self { $this->options['inboundMethod'] = $inboundMethod; return $this; } /** * The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. * * @param string $fallbackUrl The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. * @return $this Fluent Builder */ public function setFallbackUrl(string $fallbackUrl): self { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. * * @param string $fallbackMethod The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setFallbackMethod(string $fallbackMethod): self { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. * * @param string $statusCallback The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. * * @param bool $stickySender Whether to enable [Sticky Sender](https://www.twilio.com/docs/messaging/services#sticky-sender) on the Service instance. * @return $this Fluent Builder */ public function setStickySender(bool $stickySender): self { $this->options['stickySender'] = $stickySender; return $this; } /** * Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. * * @param bool $mmsConverter Whether to enable the [MMS Converter](https://www.twilio.com/docs/messaging/services#mms-converter) for messages sent through the Service instance. * @return $this Fluent Builder */ public function setMmsConverter(bool $mmsConverter): self { $this->options['mmsConverter'] = $mmsConverter; return $this; } /** * Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. * * @param bool $smartEncoding Whether to enable [Smart Encoding](https://www.twilio.com/docs/messaging/services#smart-encoding) for messages sent through the Service instance. * @return $this Fluent Builder */ public function setSmartEncoding(bool $smartEncoding): self { $this->options['smartEncoding'] = $smartEncoding; return $this; } /** * @param string $scanMessageContent * @return $this Fluent Builder */ public function setScanMessageContent(string $scanMessageContent): self { $this->options['scanMessageContent'] = $scanMessageContent; return $this; } /** * [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. * * @param bool $fallbackToLongCode [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. * @return $this Fluent Builder */ public function setFallbackToLongCode(bool $fallbackToLongCode): self { $this->options['fallbackToLongCode'] = $fallbackToLongCode; return $this; } /** * Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. * * @param bool $areaCodeGeomatch Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. * @return $this Fluent Builder */ public function setAreaCodeGeomatch(bool $areaCodeGeomatch): self { $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; return $this; } /** * How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. * * @param int $validityPeriod How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. * @return $this Fluent Builder */ public function setValidityPeriod(int $validityPeriod): self { $this->options['validityPeriod'] = $validityPeriod; return $this; } /** * Reserved. * * @param bool $synchronousValidation Reserved. * @return $this Fluent Builder */ public function setSynchronousValidation(bool $synchronousValidation): self { $this->options['synchronousValidation'] = $synchronousValidation; return $this; } /** * A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. * * @param string $usecase A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. * @return $this Fluent Builder */ public function setUsecase(string $usecase): self { $this->options['usecase'] = $usecase; return $this; } /** * A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. * * @param bool $useInboundWebhookOnNumber A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. * @return $this Fluent Builder */ public function setUseInboundWebhookOnNumber(bool $useInboundWebhookOnNumber): self { $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationPage.php 0000644 00000003406 15021223077 0025515 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class LinkshorteningMessagingServiceDomainAssociationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return LinkshorteningMessagingServiceDomainAssociationInstance \Twilio\Rest\Messaging\V1\LinkshorteningMessagingServiceDomainAssociationInstance */ public function buildInstance(array $payload): LinkshorteningMessagingServiceDomainAssociationInstance { return new LinkshorteningMessagingServiceDomainAssociationInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceDomainAssociationPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationInstance.php 0000644 00000020635 15021223077 0021025 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $customerProfileSid * @property string|null $trustProductSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $regulatedItemSid * @property string|null $businessName * @property string|null $businessStreetAddress * @property string|null $businessStreetAddress2 * @property string|null $businessCity * @property string|null $businessStateProvinceRegion * @property string|null $businessPostalCode * @property string|null $businessCountry * @property string|null $businessWebsite * @property string|null $businessContactFirstName * @property string|null $businessContactLastName * @property string|null $businessContactEmail * @property string|null $businessContactPhone * @property string|null $notificationEmail * @property string[]|null $useCaseCategories * @property string|null $useCaseSummary * @property string|null $productionMessageSample * @property string[]|null $optInImageUrls * @property string $optInType * @property string|null $messageVolume * @property string|null $additionalInformation * @property string|null $tollfreePhoneNumberSid * @property string $status * @property string|null $url * @property string|null $rejectionReason * @property int|null $errorCode * @property \DateTime|null $editExpiration * @property bool|null $editAllowed * @property array[]|null $rejectionReasons * @property array|null $resourceLinks * @property string|null $externalReferenceId */ class TollfreeVerificationInstance extends InstanceResource { /** * Initialize the TollfreeVerificationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string to identify Tollfree Verification. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'regulatedItemSid' => Values::array_get($payload, 'regulated_item_sid'), 'businessName' => Values::array_get($payload, 'business_name'), 'businessStreetAddress' => Values::array_get($payload, 'business_street_address'), 'businessStreetAddress2' => Values::array_get($payload, 'business_street_address2'), 'businessCity' => Values::array_get($payload, 'business_city'), 'businessStateProvinceRegion' => Values::array_get($payload, 'business_state_province_region'), 'businessPostalCode' => Values::array_get($payload, 'business_postal_code'), 'businessCountry' => Values::array_get($payload, 'business_country'), 'businessWebsite' => Values::array_get($payload, 'business_website'), 'businessContactFirstName' => Values::array_get($payload, 'business_contact_first_name'), 'businessContactLastName' => Values::array_get($payload, 'business_contact_last_name'), 'businessContactEmail' => Values::array_get($payload, 'business_contact_email'), 'businessContactPhone' => Values::array_get($payload, 'business_contact_phone'), 'notificationEmail' => Values::array_get($payload, 'notification_email'), 'useCaseCategories' => Values::array_get($payload, 'use_case_categories'), 'useCaseSummary' => Values::array_get($payload, 'use_case_summary'), 'productionMessageSample' => Values::array_get($payload, 'production_message_sample'), 'optInImageUrls' => Values::array_get($payload, 'opt_in_image_urls'), 'optInType' => Values::array_get($payload, 'opt_in_type'), 'messageVolume' => Values::array_get($payload, 'message_volume'), 'additionalInformation' => Values::array_get($payload, 'additional_information'), 'tollfreePhoneNumberSid' => Values::array_get($payload, 'tollfree_phone_number_sid'), 'status' => Values::array_get($payload, 'status'), 'url' => Values::array_get($payload, 'url'), 'rejectionReason' => Values::array_get($payload, 'rejection_reason'), 'errorCode' => Values::array_get($payload, 'error_code'), 'editExpiration' => Deserialize::dateTime(Values::array_get($payload, 'edit_expiration')), 'editAllowed' => Values::array_get($payload, 'edit_allowed'), 'rejectionReasons' => Values::array_get($payload, 'rejection_reasons'), 'resourceLinks' => Values::array_get($payload, 'resource_links'), 'externalReferenceId' => Values::array_get($payload, 'external_reference_id'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TollfreeVerificationContext Context for this TollfreeVerificationInstance */ protected function proxy(): TollfreeVerificationContext { if (!$this->context) { $this->context = new TollfreeVerificationContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the TollfreeVerificationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TollfreeVerificationInstance * * @return TollfreeVerificationInstance Fetched TollfreeVerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TollfreeVerificationInstance { return $this->proxy()->fetch(); } /** * Update the TollfreeVerificationInstance * * @param array|Options $options Optional Arguments * @return TollfreeVerificationInstance Updated TollfreeVerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TollfreeVerificationInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.TollfreeVerificationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationList.php 0000644 00000023103 15021223077 0020165 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class TollfreeVerificationList extends ListResource { /** * Construct the TollfreeVerificationList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Tollfree/Verifications'; } /** * Create the TollfreeVerificationInstance * * @param string $businessName The name of the business or organization using the Tollfree number. * @param string $businessWebsite The website of the business or organization using the Tollfree number. * @param string $notificationEmail The email address to receive the notification about the verification result. . * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. * @param string $productionMessageSample An example of message content, i.e. a sample message. * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. * @param string $optInType * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. * @param string $tollfreePhoneNumberSid The SID of the Phone Number associated with the Tollfree Verification. * @param array|Options $options Optional Arguments * @return TollfreeVerificationInstance Created TollfreeVerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $businessName, string $businessWebsite, string $notificationEmail, array $useCaseCategories, string $useCaseSummary, string $productionMessageSample, array $optInImageUrls, string $optInType, string $messageVolume, string $tollfreePhoneNumberSid, array $options = []): TollfreeVerificationInstance { $options = new Values($options); $data = Values::of([ 'BusinessName' => $businessName, 'BusinessWebsite' => $businessWebsite, 'NotificationEmail' => $notificationEmail, 'UseCaseCategories' => Serialize::map($useCaseCategories,function ($e) { return $e; }), 'UseCaseSummary' => $useCaseSummary, 'ProductionMessageSample' => $productionMessageSample, 'OptInImageUrls' => Serialize::map($optInImageUrls,function ($e) { return $e; }), 'OptInType' => $optInType, 'MessageVolume' => $messageVolume, 'TollfreePhoneNumberSid' => $tollfreePhoneNumberSid, 'CustomerProfileSid' => $options['customerProfileSid'], 'BusinessStreetAddress' => $options['businessStreetAddress'], 'BusinessStreetAddress2' => $options['businessStreetAddress2'], 'BusinessCity' => $options['businessCity'], 'BusinessStateProvinceRegion' => $options['businessStateProvinceRegion'], 'BusinessPostalCode' => $options['businessPostalCode'], 'BusinessCountry' => $options['businessCountry'], 'AdditionalInformation' => $options['additionalInformation'], 'BusinessContactFirstName' => $options['businessContactFirstName'], 'BusinessContactLastName' => $options['businessContactLastName'], 'BusinessContactEmail' => $options['businessContactEmail'], 'BusinessContactPhone' => $options['businessContactPhone'], 'ExternalReferenceId' => $options['externalReferenceId'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TollfreeVerificationInstance( $this->version, $payload ); } /** * Reads TollfreeVerificationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TollfreeVerificationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TollfreeVerificationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TollfreeVerificationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TollfreeVerificationPage Page of TollfreeVerificationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TollfreeVerificationPage { $options = new Values($options); $params = Values::of([ 'TollfreePhoneNumberSid' => $options['tollfreePhoneNumberSid'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TollfreeVerificationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TollfreeVerificationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TollfreeVerificationPage Page of TollfreeVerificationInstance */ public function getPage(string $targetUrl): TollfreeVerificationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TollfreeVerificationPage($this->version, $response, $this->solution); } /** * Constructs a TollfreeVerificationContext * * @param string $sid The unique string to identify Tollfree Verification. */ public function getContext( string $sid ): TollfreeVerificationContext { return new TollfreeVerificationContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.TollfreeVerificationList]'; } } sdk/src/Twilio/Rest/Messaging/V1/DeactivationsList.php 0000644 00000002562 15021223077 0016651 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\ListResource; use Twilio\Version; class DeactivationsList extends ListResource { /** * Construct the DeactivationsList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a DeactivationsContext */ public function getContext( ): DeactivationsContext { return new DeactivationsContext( $this->version ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.DeactivationsList]'; } } sdk/src/Twilio/Rest/Messaging/V1/ExternalCampaignList.php 0000644 00000004237 15021223077 0017277 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class ExternalCampaignList extends ListResource { /** * Construct the ExternalCampaignList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Services/PreregisteredUsa2p'; } /** * Create the ExternalCampaignInstance * * @param string $campaignId ID of the preregistered campaign. * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) that the resource is associated with. * @return ExternalCampaignInstance Created ExternalCampaignInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $campaignId, string $messagingServiceSid): ExternalCampaignInstance { $data = Values::of([ 'CampaignId' => $campaignId, 'MessagingServiceSid' => $messagingServiceSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ExternalCampaignInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.ExternalCampaignList]'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationInstance.php 0000644 00000014412 15021223077 0020323 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Messaging\V1\BrandRegistration\BrandRegistrationOtpList; use Twilio\Rest\Messaging\V1\BrandRegistration\BrandVettingList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $customerProfileBundleSid * @property string|null $a2PProfileBundleSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $brandType * @property string $status * @property string|null $tcrId * @property string|null $failureReason * @property array[]|null $errors * @property string|null $url * @property int|null $brandScore * @property string[]|null $brandFeedback * @property string $identityStatus * @property bool|null $russell3000 * @property bool|null $governmentEntity * @property string|null $taxExemptStatus * @property bool|null $skipAutomaticSecVet * @property bool|null $mock * @property array|null $links */ class BrandRegistrationInstance extends InstanceResource { protected $_brandRegistrationOtps; protected $_brandVettings; /** * Initialize the BrandRegistrationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Brand Registration resource to fetch. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'customerProfileBundleSid' => Values::array_get($payload, 'customer_profile_bundle_sid'), 'a2PProfileBundleSid' => Values::array_get($payload, 'a2p_profile_bundle_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'brandType' => Values::array_get($payload, 'brand_type'), 'status' => Values::array_get($payload, 'status'), 'tcrId' => Values::array_get($payload, 'tcr_id'), 'failureReason' => Values::array_get($payload, 'failure_reason'), 'errors' => Values::array_get($payload, 'errors'), 'url' => Values::array_get($payload, 'url'), 'brandScore' => Values::array_get($payload, 'brand_score'), 'brandFeedback' => Values::array_get($payload, 'brand_feedback'), 'identityStatus' => Values::array_get($payload, 'identity_status'), 'russell3000' => Values::array_get($payload, 'russell_3000'), 'governmentEntity' => Values::array_get($payload, 'government_entity'), 'taxExemptStatus' => Values::array_get($payload, 'tax_exempt_status'), 'skipAutomaticSecVet' => Values::array_get($payload, 'skip_automatic_sec_vet'), 'mock' => Values::array_get($payload, 'mock'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BrandRegistrationContext Context for this BrandRegistrationInstance */ protected function proxy(): BrandRegistrationContext { if (!$this->context) { $this->context = new BrandRegistrationContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the BrandRegistrationInstance * * @return BrandRegistrationInstance Fetched BrandRegistrationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BrandRegistrationInstance { return $this->proxy()->fetch(); } /** * Update the BrandRegistrationInstance * * @return BrandRegistrationInstance Updated BrandRegistrationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(): BrandRegistrationInstance { return $this->proxy()->update(); } /** * Access the brandRegistrationOtps */ protected function getBrandRegistrationOtps(): BrandRegistrationOtpList { return $this->proxy()->brandRegistrationOtps; } /** * Access the brandVettings */ protected function getBrandVettings(): BrandVettingList { return $this->proxy()->brandVettings; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.BrandRegistrationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainCertsInstance.php 0000644 00000011511 15021223077 0017107 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $domainSid * @property \DateTime|null $dateUpdated * @property \DateTime|null $dateExpires * @property \DateTime|null $dateCreated * @property string|null $domainName * @property string|null $certificateSid * @property string|null $url * @property array|null $certInValidation */ class DomainCertsInstance extends InstanceResource { /** * Initialize the DomainCertsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $domainSid Unique string used to identify the domain that this certificate should be associated with. */ public function __construct(Version $version, array $payload, string $domainSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'domainSid' => Values::array_get($payload, 'domain_sid'), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'domainName' => Values::array_get($payload, 'domain_name'), 'certificateSid' => Values::array_get($payload, 'certificate_sid'), 'url' => Values::array_get($payload, 'url'), 'certInValidation' => Values::array_get($payload, 'cert_in_validation'), ]; $this->solution = ['domainSid' => $domainSid ?: $this->properties['domainSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DomainCertsContext Context for this DomainCertsInstance */ protected function proxy(): DomainCertsContext { if (!$this->context) { $this->context = new DomainCertsContext( $this->version, $this->solution['domainSid'] ); } return $this->context; } /** * Delete the DomainCertsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DomainCertsInstance * * @return DomainCertsInstance Fetched DomainCertsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainCertsInstance { return $this->proxy()->fetch(); } /** * Update the DomainCertsInstance * * @param string $tlsCert Contains the full TLS certificate and private for this domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail. Twilio uses this information to process HTTPS traffic sent to your domain. * @return DomainCertsInstance Updated DomainCertsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $tlsCert): DomainCertsInstance { return $this->proxy()->update($tlsCert); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.DomainCertsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServicePage.php 0000644 00000003240 15021223077 0022164 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class LinkshorteningMessagingServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return LinkshorteningMessagingServiceInstance \Twilio\Rest\Messaging\V1\LinkshorteningMessagingServiceInstance */ public function buildInstance(array $payload): LinkshorteningMessagingServiceInstance { return new LinkshorteningMessagingServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.LinkshorteningMessagingServicePage]'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceInstance.php 0000644 00000010563 15021223077 0023062 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $domainSid * @property string|null $messagingServiceSid * @property string|null $url */ class LinkshorteningMessagingServiceInstance extends InstanceResource { /** * Initialize the LinkshorteningMessagingServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $domainSid The domain SID to associate with a messaging service. With URL shortening enabled, links in messages sent with the associated messaging service will be shortened to the provided domain * @param string $messagingServiceSid A messaging service SID to associate with a domain. With URL shortening enabled, links in messages sent with the provided messaging service will be shortened to the associated domain */ public function __construct(Version $version, array $payload, string $domainSid = null, string $messagingServiceSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'domainSid' => Values::array_get($payload, 'domain_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['domainSid' => $domainSid ?: $this->properties['domainSid'], 'messagingServiceSid' => $messagingServiceSid ?: $this->properties['messagingServiceSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return LinkshorteningMessagingServiceContext Context for this LinkshorteningMessagingServiceInstance */ protected function proxy(): LinkshorteningMessagingServiceContext { if (!$this->context) { $this->context = new LinkshorteningMessagingServiceContext( $this->version, $this->solution['domainSid'], $this->solution['messagingServiceSid'] ); } return $this->context; } /** * Create the LinkshorteningMessagingServiceInstance * * @return LinkshorteningMessagingServiceInstance Created LinkshorteningMessagingServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(): LinkshorteningMessagingServiceInstance { return $this->proxy()->create(); } /** * Delete the LinkshorteningMessagingServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationList.php 0000644 00000015106 15021223077 0017473 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class BrandRegistrationList extends ListResource { /** * Construct the BrandRegistrationList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/a2p/BrandRegistrations'; } /** * Create the BrandRegistrationInstance * * @param string $customerProfileBundleSid Customer Profile Bundle Sid. * @param string $a2PProfileBundleSid A2P Messaging Profile Bundle Sid. * @param array|Options $options Optional Arguments * @return BrandRegistrationInstance Created BrandRegistrationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $customerProfileBundleSid, string $a2PProfileBundleSid, array $options = []): BrandRegistrationInstance { $options = new Values($options); $data = Values::of([ 'CustomerProfileBundleSid' => $customerProfileBundleSid, 'A2PProfileBundleSid' => $a2PProfileBundleSid, 'BrandType' => $options['brandType'], 'Mock' => Serialize::booleanToString($options['mock']), 'SkipAutomaticSecVet' => Serialize::booleanToString($options['skipAutomaticSecVet']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BrandRegistrationInstance( $this->version, $payload ); } /** * Reads BrandRegistrationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BrandRegistrationInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams BrandRegistrationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BrandRegistrationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BrandRegistrationPage Page of BrandRegistrationInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BrandRegistrationPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BrandRegistrationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BrandRegistrationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BrandRegistrationPage Page of BrandRegistrationInstance */ public function getPage(string $targetUrl): BrandRegistrationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BrandRegistrationPage($this->version, $response, $this->solution); } /** * Constructs a BrandRegistrationContext * * @param string $sid The SID of the Brand Registration resource to fetch. */ public function getContext( string $sid ): BrandRegistrationContext { return new BrandRegistrationContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.BrandRegistrationList]'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationOptions.php 0000644 00000010614 15021223077 0020212 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Options; use Twilio\Values; abstract class BrandRegistrationOptions { /** * @param string $brandType Type of brand being created. One of: \\\"STANDARD\\\", \\\"SOLE_PROPRIETOR\\\". SOLE_PROPRIETOR is for low volume, SOLE_PROPRIETOR use cases. STANDARD is for all other use cases. * @param bool $mock A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided. * @param bool $skipAutomaticSecVet A flag to disable automatic secondary vetting for brands which it would otherwise be done. * @return CreateBrandRegistrationOptions Options builder */ public static function create( string $brandType = Values::NONE, bool $mock = Values::BOOL_NONE, bool $skipAutomaticSecVet = Values::BOOL_NONE ): CreateBrandRegistrationOptions { return new CreateBrandRegistrationOptions( $brandType, $mock, $skipAutomaticSecVet ); } } class CreateBrandRegistrationOptions extends Options { /** * @param string $brandType Type of brand being created. One of: \\\"STANDARD\\\", \\\"SOLE_PROPRIETOR\\\". SOLE_PROPRIETOR is for low volume, SOLE_PROPRIETOR use cases. STANDARD is for all other use cases. * @param bool $mock A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided. * @param bool $skipAutomaticSecVet A flag to disable automatic secondary vetting for brands which it would otherwise be done. */ public function __construct( string $brandType = Values::NONE, bool $mock = Values::BOOL_NONE, bool $skipAutomaticSecVet = Values::BOOL_NONE ) { $this->options['brandType'] = $brandType; $this->options['mock'] = $mock; $this->options['skipAutomaticSecVet'] = $skipAutomaticSecVet; } /** * Type of brand being created. One of: \\\"STANDARD\\\", \\\"SOLE_PROPRIETOR\\\". SOLE_PROPRIETOR is for low volume, SOLE_PROPRIETOR use cases. STANDARD is for all other use cases. * * @param string $brandType Type of brand being created. One of: \\\"STANDARD\\\", \\\"SOLE_PROPRIETOR\\\". SOLE_PROPRIETOR is for low volume, SOLE_PROPRIETOR use cases. STANDARD is for all other use cases. * @return $this Fluent Builder */ public function setBrandType(string $brandType): self { $this->options['brandType'] = $brandType; return $this; } /** * A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided. * * @param bool $mock A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided. * @return $this Fluent Builder */ public function setMock(bool $mock): self { $this->options['mock'] = $mock; return $this; } /** * A flag to disable automatic secondary vetting for brands which it would otherwise be done. * * @param bool $skipAutomaticSecVet A flag to disable automatic secondary vetting for brands which it would otherwise be done. * @return $this Fluent Builder */ public function setSkipAutomaticSecVet(bool $skipAutomaticSecVet): self { $this->options['skipAutomaticSecVet'] = $skipAutomaticSecVet; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.CreateBrandRegistrationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceList.php 0000644 00000004032 15021223077 0022223 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\ListResource; use Twilio\Version; class LinkshorteningMessagingServiceList extends ListResource { /** * Construct the LinkshorteningMessagingServiceList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a LinkshorteningMessagingServiceContext * * @param string $domainSid The domain SID to associate with a messaging service. With URL shortening enabled, links in messages sent with the associated messaging service will be shortened to the provided domain * * @param string $messagingServiceSid A messaging service SID to associate with a domain. With URL shortening enabled, links in messages sent with the provided messaging service will be shortened to the associated domain */ public function getContext( string $domainSid , string $messagingServiceSid ): LinkshorteningMessagingServiceContext { return new LinkshorteningMessagingServiceContext( $this->version, $domainSid, $messagingServiceSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceList]'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainCertsPage.php 0000644 00000003056 15021223077 0016224 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DomainCertsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DomainCertsInstance \Twilio\Rest\Messaging\V1\DomainCertsInstance */ public function buildInstance(array $payload): DomainCertsInstance { return new DomainCertsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.DomainCertsPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/UsecasePage.php 0000644 00000003026 15021223077 0015401 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UsecasePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UsecaseInstance \Twilio\Rest\Messaging\V1\UsecaseInstance */ public function buildInstance(array $payload): UsecaseInstance { return new UsecaseInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.UsecasePage]'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceContext.php 0000644 00000004452 15021223077 0022301 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class DomainConfigMessagingServiceContext extends InstanceContext { /** * Initialize the DomainConfigMessagingServiceContext * * @param Version $version Version that contains the resource * @param string $messagingServiceSid Unique string used to identify the Messaging service that this domain should be associated with. */ public function __construct( Version $version, $messagingServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'messagingServiceSid' => $messagingServiceSid, ]; $this->uri = '/LinkShortening/MessagingService/' . \rawurlencode($messagingServiceSid) .'/DomainConfig'; } /** * Fetch the DomainConfigMessagingServiceInstance * * @return DomainConfigMessagingServiceInstance Fetched DomainConfigMessagingServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainConfigMessagingServiceInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new DomainConfigMessagingServiceInstance( $this->version, $payload, $this->solution['messagingServiceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.DomainConfigMessagingServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/UsecaseInstance.php 0000644 00000003760 15021223077 0016276 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property array[]|null $usecases */ class UsecaseInstance extends InstanceResource { /** * Initialize the UsecaseInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'usecases' => Values::array_get($payload, 'usecases'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.UsecaseInstance]'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationPage.php 0000644 00000003122 15021223077 0017427 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BrandRegistrationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return BrandRegistrationInstance \Twilio\Rest\Messaging\V1\BrandRegistrationInstance */ public function buildInstance(array $payload): BrandRegistrationInstance { return new BrandRegistrationInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.BrandRegistrationPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigMessagingServicePage.php 0000644 00000003224 15021223077 0021525 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DomainConfigMessagingServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DomainConfigMessagingServiceInstance \Twilio\Rest\Messaging\V1\DomainConfigMessagingServiceInstance */ public function buildInstance(array $payload): DomainConfigMessagingServiceInstance { return new DomainConfigMessagingServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.DomainConfigMessagingServicePage]'; } } sdk/src/Twilio/Rest/Messaging/V1/DeactivationsInstance.php 0000644 00000006050 15021223077 0017476 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $redirectTo */ class DeactivationsInstance extends InstanceResource { /** * Initialize the DeactivationsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'redirectTo' => Values::array_get($payload, 'redirect_to'), ]; $this->solution = []; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DeactivationsContext Context for this DeactivationsInstance */ protected function proxy(): DeactivationsContext { if (!$this->context) { $this->context = new DeactivationsContext( $this->version ); } return $this->context; } /** * Fetch the DeactivationsInstance * * @param array|Options $options Optional Arguments * @return DeactivationsInstance Fetched DeactivationsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): DeactivationsInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.DeactivationsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/ExternalCampaignInstance.php 0000644 00000005000 15021223077 0020115 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $campaignId * @property string|null $messagingServiceSid * @property \DateTime|null $dateCreated */ class ExternalCampaignInstance extends InstanceResource { /** * Initialize the ExternalCampaignInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'campaignId' => Values::array_get($payload, 'campaign_id'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.ExternalCampaignInstance]'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigPage.php 0000644 00000003064 15021223077 0016350 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DomainConfigPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DomainConfigInstance \Twilio\Rest\Messaging\V1\DomainConfigInstance */ public function buildInstance(array $payload): DomainConfigInstance { return new DomainConfigInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.DomainConfigPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/UsecaseList.php 0000644 00000003144 15021223077 0015441 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; class UsecaseList extends ListResource { /** * Construct the UsecaseList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Services/Usecases'; } /** * Fetch the UsecaseInstance * * @return UsecaseInstance Fetched UsecaseInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UsecaseInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new UsecaseInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.UsecaseList]'; } } sdk/src/Twilio/Rest/Messaging/V1/DeactivationsOptions.php 0000644 00000004570 15021223077 0017372 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Options; use Twilio\Values; abstract class DeactivationsOptions { /** * @param \DateTime $date The request will return a list of all United States Phone Numbers that were deactivated on the day specified by this parameter. This date should be specified in YYYY-MM-DD format. * @return FetchDeactivationsOptions Options builder */ public static function fetch( \DateTime $date = null ): FetchDeactivationsOptions { return new FetchDeactivationsOptions( $date ); } } class FetchDeactivationsOptions extends Options { /** * @param \DateTime $date The request will return a list of all United States Phone Numbers that were deactivated on the day specified by this parameter. This date should be specified in YYYY-MM-DD format. */ public function __construct( \DateTime $date = null ) { $this->options['date'] = $date; } /** * The request will return a list of all United States Phone Numbers that were deactivated on the day specified by this parameter. This date should be specified in YYYY-MM-DD format. * * @param \DateTime $date The request will return a list of all United States Phone Numbers that were deactivated on the day specified by this parameter. This date should be specified in YYYY-MM-DD format. * @return $this Fluent Builder */ public function setDate(\DateTime $date): self { $this->options['date'] = $date; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.FetchDeactivationsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistrationContext.php 0000644 00000011510 15021223077 0020177 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Messaging\V1\BrandRegistration\BrandRegistrationOtpList; use Twilio\Rest\Messaging\V1\BrandRegistration\BrandVettingList; /** * @property BrandRegistrationOtpList $brandRegistrationOtps * @property BrandVettingList $brandVettings * @method \Twilio\Rest\Messaging\V1\BrandRegistration\BrandVettingContext brandVettings(string $brandVettingSid) */ class BrandRegistrationContext extends InstanceContext { protected $_brandRegistrationOtps; protected $_brandVettings; /** * Initialize the BrandRegistrationContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Brand Registration resource to fetch. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/a2p/BrandRegistrations/' . \rawurlencode($sid) .''; } /** * Fetch the BrandRegistrationInstance * * @return BrandRegistrationInstance Fetched BrandRegistrationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BrandRegistrationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new BrandRegistrationInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the BrandRegistrationInstance * * @return BrandRegistrationInstance Updated BrandRegistrationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(): BrandRegistrationInstance { $payload = $this->version->update('POST', $this->uri, [], []); return new BrandRegistrationInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the brandRegistrationOtps */ protected function getBrandRegistrationOtps(): BrandRegistrationOtpList { if (!$this->_brandRegistrationOtps) { $this->_brandRegistrationOtps = new BrandRegistrationOtpList( $this->version, $this->solution['sid'] ); } return $this->_brandRegistrationOtps; } /** * Access the brandVettings */ protected function getBrandVettings(): BrandVettingList { if (!$this->_brandVettings) { $this->_brandVettings = new BrandVettingList( $this->version, $this->solution['sid'] ); } return $this->_brandVettings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.BrandRegistrationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/ExternalCampaignPage.php 0000644 00000003114 15021223077 0017231 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExternalCampaignPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ExternalCampaignInstance \Twilio\Rest\Messaging\V1\ExternalCampaignInstance */ public function buildInstance(array $payload): ExternalCampaignInstance { return new ExternalCampaignInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.ExternalCampaignPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigList.php 0000644 00000003033 15021223077 0016403 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\ListResource; use Twilio\Version; class DomainConfigList extends ListResource { /** * Construct the DomainConfigList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a DomainConfigContext * * @param string $domainSid Unique string used to identify the domain that this config should be associated with. */ public function getContext( string $domainSid ): DomainConfigContext { return new DomainConfigContext( $this->version, $domainSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.DomainConfigList]'; } } sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationOptions.php 0000644 00000104117 15021223077 0020712 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Options; use Twilio\Values; abstract class TollfreeVerificationOptions { /** * @param string $customerProfileSid Customer's Profile Bundle BundleSid. * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. * @param string $businessCity The city of the business or organization using the Tollfree number. * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. * @param string $businessCountry The country of the business or organization using the Tollfree number. * @param string $additionalInformation Additional information to be provided for verification. * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. * @param string $businessContactPhone The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. * @param string $externalReferenceId An optional external reference ID supplied by customer and echoed back on status retrieval. * @return CreateTollfreeVerificationOptions Options builder */ public static function create( string $customerProfileSid = Values::NONE, string $businessStreetAddress = Values::NONE, string $businessStreetAddress2 = Values::NONE, string $businessCity = Values::NONE, string $businessStateProvinceRegion = Values::NONE, string $businessPostalCode = Values::NONE, string $businessCountry = Values::NONE, string $additionalInformation = Values::NONE, string $businessContactFirstName = Values::NONE, string $businessContactLastName = Values::NONE, string $businessContactEmail = Values::NONE, string $businessContactPhone = Values::NONE, string $externalReferenceId = Values::NONE ): CreateTollfreeVerificationOptions { return new CreateTollfreeVerificationOptions( $customerProfileSid, $businessStreetAddress, $businessStreetAddress2, $businessCity, $businessStateProvinceRegion, $businessPostalCode, $businessCountry, $additionalInformation, $businessContactFirstName, $businessContactLastName, $businessContactEmail, $businessContactPhone, $externalReferenceId ); } /** * @param string $tollfreePhoneNumberSid The SID of the Phone Number associated with the Tollfree Verification. * @param string $status The compliance status of the Tollfree Verification record. * @return ReadTollfreeVerificationOptions Options builder */ public static function read( string $tollfreePhoneNumberSid = Values::NONE, string $status = Values::NONE ): ReadTollfreeVerificationOptions { return new ReadTollfreeVerificationOptions( $tollfreePhoneNumberSid, $status ); } /** * @param string $businessName The name of the business or organization using the Tollfree number. * @param string $businessWebsite The website of the business or organization using the Tollfree number. * @param string $notificationEmail The email address to receive the notification about the verification result. . * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. * @param string $productionMessageSample An example of message content, i.e. a sample message. * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. * @param string $optInType * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. * @param string $businessCity The city of the business or organization using the Tollfree number. * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. * @param string $businessCountry The country of the business or organization using the Tollfree number. * @param string $additionalInformation Additional information to be provided for verification. * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. * @param string $businessContactPhone The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. * @param string $editReason Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. * @return UpdateTollfreeVerificationOptions Options builder */ public static function update( string $businessName = Values::NONE, string $businessWebsite = Values::NONE, string $notificationEmail = Values::NONE, array $useCaseCategories = Values::ARRAY_NONE, string $useCaseSummary = Values::NONE, string $productionMessageSample = Values::NONE, array $optInImageUrls = Values::ARRAY_NONE, string $optInType = Values::NONE, string $messageVolume = Values::NONE, string $businessStreetAddress = Values::NONE, string $businessStreetAddress2 = Values::NONE, string $businessCity = Values::NONE, string $businessStateProvinceRegion = Values::NONE, string $businessPostalCode = Values::NONE, string $businessCountry = Values::NONE, string $additionalInformation = Values::NONE, string $businessContactFirstName = Values::NONE, string $businessContactLastName = Values::NONE, string $businessContactEmail = Values::NONE, string $businessContactPhone = Values::NONE, string $editReason = Values::NONE ): UpdateTollfreeVerificationOptions { return new UpdateTollfreeVerificationOptions( $businessName, $businessWebsite, $notificationEmail, $useCaseCategories, $useCaseSummary, $productionMessageSample, $optInImageUrls, $optInType, $messageVolume, $businessStreetAddress, $businessStreetAddress2, $businessCity, $businessStateProvinceRegion, $businessPostalCode, $businessCountry, $additionalInformation, $businessContactFirstName, $businessContactLastName, $businessContactEmail, $businessContactPhone, $editReason ); } } class CreateTollfreeVerificationOptions extends Options { /** * @param string $customerProfileSid Customer's Profile Bundle BundleSid. * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. * @param string $businessCity The city of the business or organization using the Tollfree number. * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. * @param string $businessCountry The country of the business or organization using the Tollfree number. * @param string $additionalInformation Additional information to be provided for verification. * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. * @param string $businessContactPhone The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. * @param string $externalReferenceId An optional external reference ID supplied by customer and echoed back on status retrieval. */ public function __construct( string $customerProfileSid = Values::NONE, string $businessStreetAddress = Values::NONE, string $businessStreetAddress2 = Values::NONE, string $businessCity = Values::NONE, string $businessStateProvinceRegion = Values::NONE, string $businessPostalCode = Values::NONE, string $businessCountry = Values::NONE, string $additionalInformation = Values::NONE, string $businessContactFirstName = Values::NONE, string $businessContactLastName = Values::NONE, string $businessContactEmail = Values::NONE, string $businessContactPhone = Values::NONE, string $externalReferenceId = Values::NONE ) { $this->options['customerProfileSid'] = $customerProfileSid; $this->options['businessStreetAddress'] = $businessStreetAddress; $this->options['businessStreetAddress2'] = $businessStreetAddress2; $this->options['businessCity'] = $businessCity; $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; $this->options['businessPostalCode'] = $businessPostalCode; $this->options['businessCountry'] = $businessCountry; $this->options['additionalInformation'] = $additionalInformation; $this->options['businessContactFirstName'] = $businessContactFirstName; $this->options['businessContactLastName'] = $businessContactLastName; $this->options['businessContactEmail'] = $businessContactEmail; $this->options['businessContactPhone'] = $businessContactPhone; $this->options['externalReferenceId'] = $externalReferenceId; } /** * Customer's Profile Bundle BundleSid. * * @param string $customerProfileSid Customer's Profile Bundle BundleSid. * @return $this Fluent Builder */ public function setCustomerProfileSid(string $customerProfileSid): self { $this->options['customerProfileSid'] = $customerProfileSid; return $this; } /** * The address of the business or organization using the Tollfree number. * * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessStreetAddress(string $businessStreetAddress): self { $this->options['businessStreetAddress'] = $businessStreetAddress; return $this; } /** * The address of the business or organization using the Tollfree number. * * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessStreetAddress2(string $businessStreetAddress2): self { $this->options['businessStreetAddress2'] = $businessStreetAddress2; return $this; } /** * The city of the business or organization using the Tollfree number. * * @param string $businessCity The city of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessCity(string $businessCity): self { $this->options['businessCity'] = $businessCity; return $this; } /** * The state/province/region of the business or organization using the Tollfree number. * * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessStateProvinceRegion(string $businessStateProvinceRegion): self { $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; return $this; } /** * The postal code of the business or organization using the Tollfree number. * * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessPostalCode(string $businessPostalCode): self { $this->options['businessPostalCode'] = $businessPostalCode; return $this; } /** * The country of the business or organization using the Tollfree number. * * @param string $businessCountry The country of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessCountry(string $businessCountry): self { $this->options['businessCountry'] = $businessCountry; return $this; } /** * Additional information to be provided for verification. * * @param string $additionalInformation Additional information to be provided for verification. * @return $this Fluent Builder */ public function setAdditionalInformation(string $additionalInformation): self { $this->options['additionalInformation'] = $additionalInformation; return $this; } /** * The first name of the contact for the business or organization using the Tollfree number. * * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactFirstName(string $businessContactFirstName): self { $this->options['businessContactFirstName'] = $businessContactFirstName; return $this; } /** * The last name of the contact for the business or organization using the Tollfree number. * * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactLastName(string $businessContactLastName): self { $this->options['businessContactLastName'] = $businessContactLastName; return $this; } /** * The email address of the contact for the business or organization using the Tollfree number. * * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactEmail(string $businessContactEmail): self { $this->options['businessContactEmail'] = $businessContactEmail; return $this; } /** * The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. * * @param string $businessContactPhone The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactPhone(string $businessContactPhone): self { $this->options['businessContactPhone'] = $businessContactPhone; return $this; } /** * An optional external reference ID supplied by customer and echoed back on status retrieval. * * @param string $externalReferenceId An optional external reference ID supplied by customer and echoed back on status retrieval. * @return $this Fluent Builder */ public function setExternalReferenceId(string $externalReferenceId): self { $this->options['externalReferenceId'] = $externalReferenceId; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.CreateTollfreeVerificationOptions ' . $options . ']'; } } class ReadTollfreeVerificationOptions extends Options { /** * @param string $tollfreePhoneNumberSid The SID of the Phone Number associated with the Tollfree Verification. * @param string $status The compliance status of the Tollfree Verification record. */ public function __construct( string $tollfreePhoneNumberSid = Values::NONE, string $status = Values::NONE ) { $this->options['tollfreePhoneNumberSid'] = $tollfreePhoneNumberSid; $this->options['status'] = $status; } /** * The SID of the Phone Number associated with the Tollfree Verification. * * @param string $tollfreePhoneNumberSid The SID of the Phone Number associated with the Tollfree Verification. * @return $this Fluent Builder */ public function setTollfreePhoneNumberSid(string $tollfreePhoneNumberSid): self { $this->options['tollfreePhoneNumberSid'] = $tollfreePhoneNumberSid; return $this; } /** * The compliance status of the Tollfree Verification record. * * @param string $status The compliance status of the Tollfree Verification record. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.ReadTollfreeVerificationOptions ' . $options . ']'; } } class UpdateTollfreeVerificationOptions extends Options { /** * @param string $businessName The name of the business or organization using the Tollfree number. * @param string $businessWebsite The website of the business or organization using the Tollfree number. * @param string $notificationEmail The email address to receive the notification about the verification result. . * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. * @param string $productionMessageSample An example of message content, i.e. a sample message. * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. * @param string $optInType * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. * @param string $businessCity The city of the business or organization using the Tollfree number. * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. * @param string $businessCountry The country of the business or organization using the Tollfree number. * @param string $additionalInformation Additional information to be provided for verification. * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. * @param string $businessContactPhone The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. * @param string $editReason Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. */ public function __construct( string $businessName = Values::NONE, string $businessWebsite = Values::NONE, string $notificationEmail = Values::NONE, array $useCaseCategories = Values::ARRAY_NONE, string $useCaseSummary = Values::NONE, string $productionMessageSample = Values::NONE, array $optInImageUrls = Values::ARRAY_NONE, string $optInType = Values::NONE, string $messageVolume = Values::NONE, string $businessStreetAddress = Values::NONE, string $businessStreetAddress2 = Values::NONE, string $businessCity = Values::NONE, string $businessStateProvinceRegion = Values::NONE, string $businessPostalCode = Values::NONE, string $businessCountry = Values::NONE, string $additionalInformation = Values::NONE, string $businessContactFirstName = Values::NONE, string $businessContactLastName = Values::NONE, string $businessContactEmail = Values::NONE, string $businessContactPhone = Values::NONE, string $editReason = Values::NONE ) { $this->options['businessName'] = $businessName; $this->options['businessWebsite'] = $businessWebsite; $this->options['notificationEmail'] = $notificationEmail; $this->options['useCaseCategories'] = $useCaseCategories; $this->options['useCaseSummary'] = $useCaseSummary; $this->options['productionMessageSample'] = $productionMessageSample; $this->options['optInImageUrls'] = $optInImageUrls; $this->options['optInType'] = $optInType; $this->options['messageVolume'] = $messageVolume; $this->options['businessStreetAddress'] = $businessStreetAddress; $this->options['businessStreetAddress2'] = $businessStreetAddress2; $this->options['businessCity'] = $businessCity; $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; $this->options['businessPostalCode'] = $businessPostalCode; $this->options['businessCountry'] = $businessCountry; $this->options['additionalInformation'] = $additionalInformation; $this->options['businessContactFirstName'] = $businessContactFirstName; $this->options['businessContactLastName'] = $businessContactLastName; $this->options['businessContactEmail'] = $businessContactEmail; $this->options['businessContactPhone'] = $businessContactPhone; $this->options['editReason'] = $editReason; } /** * The name of the business or organization using the Tollfree number. * * @param string $businessName The name of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessName(string $businessName): self { $this->options['businessName'] = $businessName; return $this; } /** * The website of the business or organization using the Tollfree number. * * @param string $businessWebsite The website of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessWebsite(string $businessWebsite): self { $this->options['businessWebsite'] = $businessWebsite; return $this; } /** * The email address to receive the notification about the verification result. . * * @param string $notificationEmail The email address to receive the notification about the verification result. . * @return $this Fluent Builder */ public function setNotificationEmail(string $notificationEmail): self { $this->options['notificationEmail'] = $notificationEmail; return $this; } /** * The category of the use case for the Tollfree Number. List as many are applicable.. * * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. * @return $this Fluent Builder */ public function setUseCaseCategories(array $useCaseCategories): self { $this->options['useCaseCategories'] = $useCaseCategories; return $this; } /** * Use this to further explain how messaging is used by the business or organization. * * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. * @return $this Fluent Builder */ public function setUseCaseSummary(string $useCaseSummary): self { $this->options['useCaseSummary'] = $useCaseSummary; return $this; } /** * An example of message content, i.e. a sample message. * * @param string $productionMessageSample An example of message content, i.e. a sample message. * @return $this Fluent Builder */ public function setProductionMessageSample(string $productionMessageSample): self { $this->options['productionMessageSample'] = $productionMessageSample; return $this; } /** * Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. * * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. * @return $this Fluent Builder */ public function setOptInImageUrls(array $optInImageUrls): self { $this->options['optInImageUrls'] = $optInImageUrls; return $this; } /** * @param string $optInType * @return $this Fluent Builder */ public function setOptInType(string $optInType): self { $this->options['optInType'] = $optInType; return $this; } /** * Estimate monthly volume of messages from the Tollfree Number. * * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. * @return $this Fluent Builder */ public function setMessageVolume(string $messageVolume): self { $this->options['messageVolume'] = $messageVolume; return $this; } /** * The address of the business or organization using the Tollfree number. * * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessStreetAddress(string $businessStreetAddress): self { $this->options['businessStreetAddress'] = $businessStreetAddress; return $this; } /** * The address of the business or organization using the Tollfree number. * * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessStreetAddress2(string $businessStreetAddress2): self { $this->options['businessStreetAddress2'] = $businessStreetAddress2; return $this; } /** * The city of the business or organization using the Tollfree number. * * @param string $businessCity The city of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessCity(string $businessCity): self { $this->options['businessCity'] = $businessCity; return $this; } /** * The state/province/region of the business or organization using the Tollfree number. * * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessStateProvinceRegion(string $businessStateProvinceRegion): self { $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; return $this; } /** * The postal code of the business or organization using the Tollfree number. * * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessPostalCode(string $businessPostalCode): self { $this->options['businessPostalCode'] = $businessPostalCode; return $this; } /** * The country of the business or organization using the Tollfree number. * * @param string $businessCountry The country of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessCountry(string $businessCountry): self { $this->options['businessCountry'] = $businessCountry; return $this; } /** * Additional information to be provided for verification. * * @param string $additionalInformation Additional information to be provided for verification. * @return $this Fluent Builder */ public function setAdditionalInformation(string $additionalInformation): self { $this->options['additionalInformation'] = $additionalInformation; return $this; } /** * The first name of the contact for the business or organization using the Tollfree number. * * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactFirstName(string $businessContactFirstName): self { $this->options['businessContactFirstName'] = $businessContactFirstName; return $this; } /** * The last name of the contact for the business or organization using the Tollfree number. * * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactLastName(string $businessContactLastName): self { $this->options['businessContactLastName'] = $businessContactLastName; return $this; } /** * The email address of the contact for the business or organization using the Tollfree number. * * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactEmail(string $businessContactEmail): self { $this->options['businessContactEmail'] = $businessContactEmail; return $this; } /** * The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. * * @param string $businessContactPhone The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactPhone(string $businessContactPhone): self { $this->options['businessContactPhone'] = $businessContactPhone; return $this; } /** * Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. * * @param string $editReason Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. * @return $this Fluent Builder */ public function setEditReason(string $editReason): self { $this->options['editReason'] = $editReason; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.UpdateTollfreeVerificationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DeactivationsContext.php 0000644 00000004163 15021223077 0017361 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class DeactivationsContext extends InstanceContext { /** * Initialize the DeactivationsContext * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Deactivations'; } /** * Fetch the DeactivationsInstance * * @param array|Options $options Optional Arguments * @return DeactivationsInstance Fetched DeactivationsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): DeactivationsInstance { $options = new Values($options); $params = Values::of([ 'Date' => Serialize::iso8601Date($options['date']), ]); $payload = $this->version->fetch('GET', $this->uri, $params, []); return new DeactivationsInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.DeactivationsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/ServiceContext.php 0000644 00000021355 15021223077 0016166 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Messaging\V1\Service\AlphaSenderList; use Twilio\Rest\Messaging\V1\Service\PhoneNumberList; use Twilio\Rest\Messaging\V1\Service\UsAppToPersonUsecaseList; use Twilio\Rest\Messaging\V1\Service\ChannelSenderList; use Twilio\Rest\Messaging\V1\Service\ShortCodeList; use Twilio\Rest\Messaging\V1\Service\UsAppToPersonList; /** * @property AlphaSenderList $alphaSenders * @property PhoneNumberList $phoneNumbers * @property UsAppToPersonUsecaseList $usAppToPersonUsecases * @property ChannelSenderList $channelSenders * @property ShortCodeList $shortCodes * @property UsAppToPersonList $usAppToPerson * @method \Twilio\Rest\Messaging\V1\Service\ShortCodeContext shortCodes(string $sid) * @method \Twilio\Rest\Messaging\V1\Service\UsAppToPersonContext usAppToPerson(string $sid) * @method \Twilio\Rest\Messaging\V1\Service\PhoneNumberContext phoneNumbers(string $sid) * @method \Twilio\Rest\Messaging\V1\Service\AlphaSenderContext alphaSenders(string $sid) * @method \Twilio\Rest\Messaging\V1\Service\ChannelSenderContext channelSenders(string $sid) */ class ServiceContext extends InstanceContext { protected $_alphaSenders; protected $_phoneNumbers; protected $_usAppToPersonUsecases; protected $_channelSenders; protected $_shortCodes; protected $_usAppToPerson; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Service resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) .''; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'InboundRequestUrl' => $options['inboundRequestUrl'], 'InboundMethod' => $options['inboundMethod'], 'FallbackUrl' => $options['fallbackUrl'], 'FallbackMethod' => $options['fallbackMethod'], 'StatusCallback' => $options['statusCallback'], 'StickySender' => Serialize::booleanToString($options['stickySender']), 'MmsConverter' => Serialize::booleanToString($options['mmsConverter']), 'SmartEncoding' => Serialize::booleanToString($options['smartEncoding']), 'ScanMessageContent' => $options['scanMessageContent'], 'FallbackToLongCode' => Serialize::booleanToString($options['fallbackToLongCode']), 'AreaCodeGeomatch' => Serialize::booleanToString($options['areaCodeGeomatch']), 'ValidityPeriod' => $options['validityPeriod'], 'SynchronousValidation' => Serialize::booleanToString($options['synchronousValidation']), 'Usecase' => $options['usecase'], 'UseInboundWebhookOnNumber' => Serialize::booleanToString($options['useInboundWebhookOnNumber']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the alphaSenders */ protected function getAlphaSenders(): AlphaSenderList { if (!$this->_alphaSenders) { $this->_alphaSenders = new AlphaSenderList( $this->version, $this->solution['sid'] ); } return $this->_alphaSenders; } /** * Access the phoneNumbers */ protected function getPhoneNumbers(): PhoneNumberList { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList( $this->version, $this->solution['sid'] ); } return $this->_phoneNumbers; } /** * Access the usAppToPersonUsecases */ protected function getUsAppToPersonUsecases(): UsAppToPersonUsecaseList { if (!$this->_usAppToPersonUsecases) { $this->_usAppToPersonUsecases = new UsAppToPersonUsecaseList( $this->version, $this->solution['sid'] ); } return $this->_usAppToPersonUsecases; } /** * Access the channelSenders */ protected function getChannelSenders(): ChannelSenderList { if (!$this->_channelSenders) { $this->_channelSenders = new ChannelSenderList( $this->version, $this->solution['sid'] ); } return $this->_channelSenders; } /** * Access the shortCodes */ protected function getShortCodes(): ShortCodeList { if (!$this->_shortCodes) { $this->_shortCodes = new ShortCodeList( $this->version, $this->solution['sid'] ); } return $this->_shortCodes; } /** * Access the usAppToPerson */ protected function getUsAppToPerson(): UsAppToPersonList { if (!$this->_usAppToPerson) { $this->_usAppToPerson = new UsAppToPersonList( $this->version, $this->solution['sid'] ); } return $this->_usAppToPerson; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainConfigInstance.php 0000644 00000010767 15021223077 0017250 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $domainSid * @property string|null $configSid * @property string|null $fallbackUrl * @property string|null $callbackUrl * @property bool|null $continueOnFailure * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property bool|null $disableHttps */ class DomainConfigInstance extends InstanceResource { /** * Initialize the DomainConfigInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $domainSid Unique string used to identify the domain that this config should be associated with. */ public function __construct(Version $version, array $payload, string $domainSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'domainSid' => Values::array_get($payload, 'domain_sid'), 'configSid' => Values::array_get($payload, 'config_sid'), 'fallbackUrl' => Values::array_get($payload, 'fallback_url'), 'callbackUrl' => Values::array_get($payload, 'callback_url'), 'continueOnFailure' => Values::array_get($payload, 'continue_on_failure'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'disableHttps' => Values::array_get($payload, 'disable_https'), ]; $this->solution = ['domainSid' => $domainSid ?: $this->properties['domainSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DomainConfigContext Context for this DomainConfigInstance */ protected function proxy(): DomainConfigContext { if (!$this->context) { $this->context = new DomainConfigContext( $this->version, $this->solution['domainSid'] ); } return $this->context; } /** * Fetch the DomainConfigInstance * * @return DomainConfigInstance Fetched DomainConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainConfigInstance { return $this->proxy()->fetch(); } /** * Update the DomainConfigInstance * * @param array|Options $options Optional Arguments * @return DomainConfigInstance Updated DomainConfigInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DomainConfigInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.DomainConfigInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/ServicePage.php 0000644 00000003026 15021223077 0015411 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ServiceInstance \Twilio\Rest\Messaging\V1\ServiceInstance */ public function buildInstance(array $payload): ServiceInstance { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.ServicePage]'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceContext.php 0000644 00000006065 15021223077 0022744 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class LinkshorteningMessagingServiceContext extends InstanceContext { /** * Initialize the LinkshorteningMessagingServiceContext * * @param Version $version Version that contains the resource * @param string $domainSid The domain SID to associate with a messaging service. With URL shortening enabled, links in messages sent with the associated messaging service will be shortened to the provided domain * @param string $messagingServiceSid A messaging service SID to associate with a domain. With URL shortening enabled, links in messages sent with the provided messaging service will be shortened to the associated domain */ public function __construct( Version $version, $domainSid, $messagingServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'domainSid' => $domainSid, 'messagingServiceSid' => $messagingServiceSid, ]; $this->uri = '/LinkShortening/Domains/' . \rawurlencode($domainSid) .'/MessagingServices/' . \rawurlencode($messagingServiceSid) .''; } /** * Create the LinkshorteningMessagingServiceInstance * * @return LinkshorteningMessagingServiceInstance Created LinkshorteningMessagingServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(): LinkshorteningMessagingServiceInstance { $payload = $this->version->create('POST', $this->uri, [], []); return new LinkshorteningMessagingServiceInstance( $this->version, $payload, $this->solution['domainSid'], $this->solution['messagingServiceSid'] ); } /** * Delete the LinkshorteningMessagingServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DeactivationsPage.php 0000644 00000003072 15021223077 0016607 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DeactivationsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DeactivationsInstance \Twilio\Rest\Messaging\V1\DeactivationsInstance */ public function buildInstance(array $payload): DeactivationsInstance { return new DeactivationsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.DeactivationsPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceDomainAssociationInstance.php 0000644 00000007526 15021223077 0026414 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $domainSid * @property string|null $messagingServiceSid * @property string|null $url */ class LinkshorteningMessagingServiceDomainAssociationInstance extends InstanceResource { /** * Initialize the LinkshorteningMessagingServiceDomainAssociationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $messagingServiceSid Unique string used to identify the Messaging service that this domain should be associated with. */ public function __construct(Version $version, array $payload, string $messagingServiceSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'domainSid' => Values::array_get($payload, 'domain_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['messagingServiceSid' => $messagingServiceSid ?: $this->properties['messagingServiceSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return LinkshorteningMessagingServiceDomainAssociationContext Context for this LinkshorteningMessagingServiceDomainAssociationInstance */ protected function proxy(): LinkshorteningMessagingServiceDomainAssociationContext { if (!$this->context) { $this->context = new LinkshorteningMessagingServiceDomainAssociationContext( $this->version, $this->solution['messagingServiceSid'] ); } return $this->context; } /** * Fetch the LinkshorteningMessagingServiceDomainAssociationInstance * * @return LinkshorteningMessagingServiceDomainAssociationInstance Fetched LinkshorteningMessagingServiceDomainAssociationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): LinkshorteningMessagingServiceDomainAssociationInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceDomainAssociationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/DomainCertsContext.php 0000644 00000006263 15021223077 0016777 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class DomainCertsContext extends InstanceContext { /** * Initialize the DomainCertsContext * * @param Version $version Version that contains the resource * @param string $domainSid Unique string used to identify the domain that this certificate should be associated with. */ public function __construct( Version $version, $domainSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'domainSid' => $domainSid, ]; $this->uri = '/LinkShortening/Domains/' . \rawurlencode($domainSid) .'/Certificate'; } /** * Delete the DomainCertsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the DomainCertsInstance * * @return DomainCertsInstance Fetched DomainCertsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainCertsInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new DomainCertsInstance( $this->version, $payload, $this->solution['domainSid'] ); } /** * Update the DomainCertsInstance * * @param string $tlsCert Contains the full TLS certificate and private for this domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail. Twilio uses this information to process HTTPS traffic sent to your domain. * @return DomainCertsInstance Updated DomainCertsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $tlsCert): DomainCertsInstance { $data = Values::of([ 'TlsCert' => $tlsCert, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DomainCertsInstance( $this->version, $payload, $this->solution['domainSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.DomainCertsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingPage.php 0000644 00000003165 15021223077 0022025 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\BrandRegistration; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BrandVettingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return BrandVettingInstance \Twilio\Rest\Messaging\V1\BrandRegistration\BrandVettingInstance */ public function buildInstance(array $payload): BrandVettingInstance { return new BrandVettingInstance($this->version, $payload, $this->solution['brandSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.BrandVettingPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingInstance.php 0000644 00000010662 15021223077 0022715 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\BrandRegistration; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $brandSid * @property string|null $brandVettingSid * @property \DateTime|null $dateUpdated * @property \DateTime|null $dateCreated * @property string|null $vettingId * @property string|null $vettingClass * @property string|null $vettingStatus * @property string $vettingProvider * @property string|null $url */ class BrandVettingInstance extends InstanceResource { /** * Initialize the BrandVettingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $brandSid The SID of the Brand Registration resource of the vettings to create . * @param string $brandVettingSid The Twilio SID of the third-party vetting record. */ public function __construct(Version $version, array $payload, string $brandSid, string $brandVettingSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'brandSid' => Values::array_get($payload, 'brand_sid'), 'brandVettingSid' => Values::array_get($payload, 'brand_vetting_sid'), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'vettingId' => Values::array_get($payload, 'vetting_id'), 'vettingClass' => Values::array_get($payload, 'vetting_class'), 'vettingStatus' => Values::array_get($payload, 'vetting_status'), 'vettingProvider' => Values::array_get($payload, 'vetting_provider'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['brandSid' => $brandSid, 'brandVettingSid' => $brandVettingSid ?: $this->properties['brandVettingSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BrandVettingContext Context for this BrandVettingInstance */ protected function proxy(): BrandVettingContext { if (!$this->context) { $this->context = new BrandVettingContext( $this->version, $this->solution['brandSid'], $this->solution['brandVettingSid'] ); } return $this->context; } /** * Fetch the BrandVettingInstance * * @return BrandVettingInstance Fetched BrandVettingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BrandVettingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.BrandVettingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingList.php 0000644 00000015253 15021223077 0022065 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\BrandRegistration; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class BrandVettingList extends ListResource { /** * Construct the BrandVettingList * * @param Version $version Version that contains the resource * @param string $brandSid The SID of the Brand Registration resource of the vettings to create . */ public function __construct( Version $version, string $brandSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'brandSid' => $brandSid, ]; $this->uri = '/a2p/BrandRegistrations/' . \rawurlencode($brandSid) .'/Vettings'; } /** * Create the BrandVettingInstance * * @param string $vettingProvider * @param array|Options $options Optional Arguments * @return BrandVettingInstance Created BrandVettingInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $vettingProvider, array $options = []): BrandVettingInstance { $options = new Values($options); $data = Values::of([ 'VettingProvider' => $vettingProvider, 'VettingId' => $options['vettingId'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BrandVettingInstance( $this->version, $payload, $this->solution['brandSid'] ); } /** * Reads BrandVettingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BrandVettingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams BrandVettingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BrandVettingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BrandVettingPage Page of BrandVettingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BrandVettingPage { $options = new Values($options); $params = Values::of([ 'VettingProvider' => $options['vettingProvider'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BrandVettingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BrandVettingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BrandVettingPage Page of BrandVettingInstance */ public function getPage(string $targetUrl): BrandVettingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BrandVettingPage($this->version, $response, $this->solution); } /** * Constructs a BrandVettingContext * * @param string $brandVettingSid The Twilio SID of the third-party vetting record. */ public function getContext( string $brandVettingSid ): BrandVettingContext { return new BrandVettingContext( $this->version, $this->solution['brandSid'], $brandVettingSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.BrandVettingList]'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpList.php 0000644 00000004047 15021223077 0023601 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\BrandRegistration; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; class BrandRegistrationOtpList extends ListResource { /** * Construct the BrandRegistrationOtpList * * @param Version $version Version that contains the resource * @param string $brandRegistrationSid Brand Registration Sid of Sole Proprietor Brand. */ public function __construct( Version $version, string $brandRegistrationSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'brandRegistrationSid' => $brandRegistrationSid, ]; $this->uri = '/a2p/BrandRegistrations/' . \rawurlencode($brandRegistrationSid) .'/SmsOtp'; } /** * Create the BrandRegistrationOtpInstance * * @return BrandRegistrationOtpInstance Created BrandRegistrationOtpInstance * @throws TwilioException When an HTTP error occurs. */ public function create(): BrandRegistrationOtpInstance { $payload = $this->version->create('POST', $this->uri, [], []); return new BrandRegistrationOtpInstance( $this->version, $payload, $this->solution['brandRegistrationSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.BrandRegistrationOtpList]'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpPage.php 0000644 00000003261 15021223077 0023537 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\BrandRegistration; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BrandRegistrationOtpPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return BrandRegistrationOtpInstance \Twilio\Rest\Messaging\V1\BrandRegistration\BrandRegistrationOtpInstance */ public function buildInstance(array $payload): BrandRegistrationOtpInstance { return new BrandRegistrationOtpInstance($this->version, $payload, $this->solution['brandRegistrationSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.BrandRegistrationOtpPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingOptions.php 0000644 00000006337 15021223077 0022610 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\BrandRegistration; use Twilio\Options; use Twilio\Values; abstract class BrandVettingOptions { /** * @param string $vettingId The unique ID of the vetting * @return CreateBrandVettingOptions Options builder */ public static function create( string $vettingId = Values::NONE ): CreateBrandVettingOptions { return new CreateBrandVettingOptions( $vettingId ); } /** * @param string $vettingProvider The third-party provider of the vettings to read * @return ReadBrandVettingOptions Options builder */ public static function read( string $vettingProvider = Values::NONE ): ReadBrandVettingOptions { return new ReadBrandVettingOptions( $vettingProvider ); } } class CreateBrandVettingOptions extends Options { /** * @param string $vettingId The unique ID of the vetting */ public function __construct( string $vettingId = Values::NONE ) { $this->options['vettingId'] = $vettingId; } /** * The unique ID of the vetting * * @param string $vettingId The unique ID of the vetting * @return $this Fluent Builder */ public function setVettingId(string $vettingId): self { $this->options['vettingId'] = $vettingId; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.CreateBrandVettingOptions ' . $options . ']'; } } class ReadBrandVettingOptions extends Options { /** * @param string $vettingProvider The third-party provider of the vettings to read */ public function __construct( string $vettingProvider = Values::NONE ) { $this->options['vettingProvider'] = $vettingProvider; } /** * The third-party provider of the vettings to read * * @param string $vettingProvider The third-party provider of the vettings to read * @return $this Fluent Builder */ public function setVettingProvider(string $vettingProvider): self { $this->options['vettingProvider'] = $vettingProvider; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Messaging.V1.ReadBrandVettingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpInstance.php 0000644 00000004546 15021223077 0024436 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\BrandRegistration; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $brandRegistrationSid */ class BrandRegistrationOtpInstance extends InstanceResource { /** * Initialize the BrandRegistrationOtpInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $brandRegistrationSid Brand Registration Sid of Sole Proprietor Brand. */ public function __construct(Version $version, array $payload, string $brandRegistrationSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'brandRegistrationSid' => Values::array_get($payload, 'brand_registration_sid'), ]; $this->solution = ['brandRegistrationSid' => $brandRegistrationSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.BrandRegistrationOtpInstance]'; } } sdk/src/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingContext.php 0000644 00000004537 15021223077 0022601 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1\BrandRegistration; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class BrandVettingContext extends InstanceContext { /** * Initialize the BrandVettingContext * * @param Version $version Version that contains the resource * @param string $brandSid The SID of the Brand Registration resource of the vettings to create . * @param string $brandVettingSid The Twilio SID of the third-party vetting record. */ public function __construct( Version $version, $brandSid, $brandVettingSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'brandSid' => $brandSid, 'brandVettingSid' => $brandVettingSid, ]; $this->uri = '/a2p/BrandRegistrations/' . \rawurlencode($brandSid) .'/Vettings/' . \rawurlencode($brandVettingSid) .''; } /** * Fetch the BrandVettingInstance * * @return BrandVettingInstance Fetched BrandVettingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BrandVettingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new BrandVettingInstance( $this->version, $payload, $this->solution['brandSid'], $this->solution['brandVettingSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.BrandVettingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/TollfreeVerificationPage.php 0000644 00000003144 15021223077 0020131 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TollfreeVerificationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TollfreeVerificationInstance \Twilio\Rest\Messaging\V1\TollfreeVerificationInstance */ public function buildInstance(array $payload): TollfreeVerificationInstance { return new TollfreeVerificationInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1.TollfreeVerificationPage]'; } } sdk/src/Twilio/Rest/Messaging/V1.php 0000644 00000016061 15021223077 0013217 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Messaging; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Messaging\V1\BrandRegistrationList; use Twilio\Rest\Messaging\V1\DeactivationsList; use Twilio\Rest\Messaging\V1\DomainCertsList; use Twilio\Rest\Messaging\V1\DomainConfigList; use Twilio\Rest\Messaging\V1\DomainConfigMessagingServiceList; use Twilio\Rest\Messaging\V1\ExternalCampaignList; use Twilio\Rest\Messaging\V1\LinkshorteningMessagingServiceList; use Twilio\Rest\Messaging\V1\LinkshorteningMessagingServiceDomainAssociationList; use Twilio\Rest\Messaging\V1\ServiceList; use Twilio\Rest\Messaging\V1\TollfreeVerificationList; use Twilio\Rest\Messaging\V1\UsecaseList; use Twilio\Version; /** * @property BrandRegistrationList $brandRegistrations * @property DeactivationsList $deactivations * @property DomainCertsList $domainCerts * @property DomainConfigList $domainConfig * @property DomainConfigMessagingServiceList $domainConfigMessagingService * @property ExternalCampaignList $externalCampaign * @property LinkshorteningMessagingServiceList $linkshorteningMessagingService * @property LinkshorteningMessagingServiceDomainAssociationList $linkshorteningMessagingServiceDomainAssociation * @property ServiceList $services * @property TollfreeVerificationList $tollfreeVerifications * @property UsecaseList $usecases * @method \Twilio\Rest\Messaging\V1\BrandRegistrationContext brandRegistrations(string $sid) * @method \Twilio\Rest\Messaging\V1\LinkshorteningMessagingServiceContext linkshorteningMessagingService(string $domainSid, string $messagingServiceSid) * @method \Twilio\Rest\Messaging\V1\ServiceContext services(string $sid) * @method \Twilio\Rest\Messaging\V1\TollfreeVerificationContext tollfreeVerifications(string $sid) */ class V1 extends Version { protected $_brandRegistrations; protected $_deactivations; protected $_domainCerts; protected $_domainConfig; protected $_domainConfigMessagingService; protected $_externalCampaign; protected $_linkshorteningMessagingService; protected $_linkshorteningMessagingServiceDomainAssociation; protected $_services; protected $_tollfreeVerifications; protected $_usecases; /** * Construct the V1 version of Messaging * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getBrandRegistrations(): BrandRegistrationList { if (!$this->_brandRegistrations) { $this->_brandRegistrations = new BrandRegistrationList($this); } return $this->_brandRegistrations; } protected function getDeactivations(): DeactivationsList { if (!$this->_deactivations) { $this->_deactivations = new DeactivationsList($this); } return $this->_deactivations; } protected function getDomainCerts(): DomainCertsList { if (!$this->_domainCerts) { $this->_domainCerts = new DomainCertsList($this); } return $this->_domainCerts; } protected function getDomainConfig(): DomainConfigList { if (!$this->_domainConfig) { $this->_domainConfig = new DomainConfigList($this); } return $this->_domainConfig; } protected function getDomainConfigMessagingService(): DomainConfigMessagingServiceList { if (!$this->_domainConfigMessagingService) { $this->_domainConfigMessagingService = new DomainConfigMessagingServiceList($this); } return $this->_domainConfigMessagingService; } protected function getExternalCampaign(): ExternalCampaignList { if (!$this->_externalCampaign) { $this->_externalCampaign = new ExternalCampaignList($this); } return $this->_externalCampaign; } protected function getLinkshorteningMessagingService(): LinkshorteningMessagingServiceList { if (!$this->_linkshorteningMessagingService) { $this->_linkshorteningMessagingService = new LinkshorteningMessagingServiceList($this); } return $this->_linkshorteningMessagingService; } protected function getLinkshorteningMessagingServiceDomainAssociation(): LinkshorteningMessagingServiceDomainAssociationList { if (!$this->_linkshorteningMessagingServiceDomainAssociation) { $this->_linkshorteningMessagingServiceDomainAssociation = new LinkshorteningMessagingServiceDomainAssociationList($this); } return $this->_linkshorteningMessagingServiceDomainAssociation; } protected function getServices(): ServiceList { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } protected function getTollfreeVerifications(): TollfreeVerificationList { if (!$this->_tollfreeVerifications) { $this->_tollfreeVerifications = new TollfreeVerificationList($this); } return $this->_tollfreeVerifications; } protected function getUsecases(): UsecaseList { if (!$this->_usecases) { $this->_usecases = new UsecaseList($this); } return $this->_usecases; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging.V1]'; } } sdk/src/Twilio/Rest/Voice.php 0000644 00000007403 15021223077 0012061 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Voice\V1; class Voice extends VoiceBase { /** * @deprecated Use v1->archivedCalls instead. */ protected function getArchivedCalls(): \Twilio\Rest\Voice\V1\ArchivedCallList { echo "archivedCalls is deprecated. Use v1->archivedCalls instead."; return $this->v1->archivedCalls; } /** * @deprecated Use v1->archivedCalls(\$date, \$sid) instead. * @param \DateTime $date The date of the Call in UTC. * @param string $sid The unique string that identifies this resource */ protected function contextArchivedCalls(\DateTime $date, string $sid): \Twilio\Rest\Voice\V1\ArchivedCallContext { echo "archivedCalls(\$date, \$sid) is deprecated. Use v1->archivedCalls(\$date, \$sid) instead."; return $this->v1->archivedCalls($date, $sid); } /** * @deprecated Use v1->byocTrunks instead. */ protected function getByocTrunks(): \Twilio\Rest\Voice\V1\ByocTrunkList { echo "byocTrunks is deprecated. Use v1->byocTrunks instead."; return $this->v1->byocTrunks; } /** * @deprecated Use v1->byocTrunks(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextByocTrunks(string $sid): \Twilio\Rest\Voice\V1\ByocTrunkContext { echo "byocTrunks(\$sid) is deprecated. Use v1->byocTrunks(\$sid) instead."; return $this->v1->byocTrunks($sid); } /** * @deprecated Use v1->connectionPolicies instead. */ protected function getConnectionPolicies(): \Twilio\Rest\Voice\V1\ConnectionPolicyList { echo "connectionPolicies is deprecated. Use v1->connectionPolicies instead."; return $this->v1->connectionPolicies; } /** * @deprecated Use v1->connectionPolicies(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextConnectionPolicies(string $sid): \Twilio\Rest\Voice\V1\ConnectionPolicyContext { echo "connectionPolicies(\$sid) is deprecated. Use v1->connectionPolicies(\$sid) instead."; return $this->v1->connectionPolicies($sid); } /** * @deprecated Use v1->dialingPermissions instead. */ protected function getDialingPermissions(): \Twilio\Rest\Voice\V1\DialingPermissionsList { echo "dialingPermissions is deprecated. Use v1->dialingPermissions instead."; return $this->v1->dialingPermissions; } /** * @deprecated Use v1->ipRecords instead. */ protected function getIpRecords(): \Twilio\Rest\Voice\V1\IpRecordList { echo "ipRecords is deprecated. Use v1->ipRecords instead."; return $this->v1->ipRecords; } /** * @deprecated Use v1->ipRecords(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextIpRecords(string $sid): \Twilio\Rest\Voice\V1\IpRecordContext { echo "ipRecords(\$sid) is deprecated. Use v1->ipRecords(\$sid) instead."; return $this->v1->ipRecords($sid); } /** * @deprecated Use v1->sourceIpMappings instead. */ protected function getSourceIpMappings(): \Twilio\Rest\Voice\V1\SourceIpMappingList { echo "sourceIpMappings is deprecated. Use v1->sourceIpMappings instead."; return $this->v1->sourceIpMappings; } /** * @deprecated Use v1->sourceIpMappings(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextSourceIpMappings(string $sid): \Twilio\Rest\Voice\V1\SourceIpMappingContext { echo "sourceIpMappings(\$sid) is deprecated. Use v1->sourceIpMappings(\$sid) instead."; return $this->v1->sourceIpMappings($sid); } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogInstance.php 0000644 00000011104 15021223077 0021542 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $environmentSid * @property string|null $buildSid * @property string|null $deploymentSid * @property string|null $functionSid * @property string|null $requestSid * @property string $level * @property string|null $message * @property \DateTime|null $dateCreated * @property string|null $url */ class LogInstance extends InstanceResource { /** * Initialize the LogInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service to fetch the Log resource from. * @param string $environmentSid The SID of the environment with the Log resource to fetch. * @param string $sid The SID of the Log resource to fetch. */ public function __construct(Version $version, array $payload, string $serviceSid, string $environmentSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'environmentSid' => Values::array_get($payload, 'environment_sid'), 'buildSid' => Values::array_get($payload, 'build_sid'), 'deploymentSid' => Values::array_get($payload, 'deployment_sid'), 'functionSid' => Values::array_get($payload, 'function_sid'), 'requestSid' => Values::array_get($payload, 'request_sid'), 'level' => Values::array_get($payload, 'level'), 'message' => Values::array_get($payload, 'message'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return LogContext Context for this LogInstance */ protected function proxy(): LogContext { if (!$this->context) { $this->context = new LogContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the LogInstance * * @return LogInstance Fetched LogInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): LogInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.LogInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentOptions.php 0000644 00000003611 15021223077 0023034 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Options; use Twilio\Values; abstract class DeploymentOptions { /** * @param string $buildSid The SID of the Build for the Deployment. * @return CreateDeploymentOptions Options builder */ public static function create( string $buildSid = Values::NONE ): CreateDeploymentOptions { return new CreateDeploymentOptions( $buildSid ); } } class CreateDeploymentOptions extends Options { /** * @param string $buildSid The SID of the Build for the Deployment. */ public function __construct( string $buildSid = Values::NONE ) { $this->options['buildSid'] = $buildSid; } /** * The SID of the Build for the Deployment. * * @param string $buildSid The SID of the Build for the Deployment. * @return $this Fluent Builder */ public function setBuildSid(string $buildSid): self { $this->options['buildSid'] = $buildSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Serverless.V1.CreateDeploymentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogPage.php 0000644 00000003154 15021223077 0020660 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class LogPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return LogInstance \Twilio\Rest\Serverless\V1\Service\Environment\LogInstance */ public function buildInstance(array $payload): LogInstance { return new LogInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.LogPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariablePage.php 0000644 00000003212 15021223077 0021657 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class VariablePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return VariableInstance \Twilio\Rest\Serverless\V1\Service\Environment\VariableInstance */ public function buildInstance(array $payload): VariableInstance { return new VariableInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.VariablePage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableOptions.php 0000644 00000005524 15021223077 0022446 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Options; use Twilio\Values; abstract class VariableOptions { /** * @param string $key A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. * @param string $value A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. * @return UpdateVariableOptions Options builder */ public static function update( string $key = Values::NONE, string $value = Values::NONE ): UpdateVariableOptions { return new UpdateVariableOptions( $key, $value ); } } class UpdateVariableOptions extends Options { /** * @param string $key A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. * @param string $value A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. */ public function __construct( string $key = Values::NONE, string $value = Values::NONE ) { $this->options['key'] = $key; $this->options['value'] = $value; } /** * A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. * * @param string $key A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. * @return $this Fluent Builder */ public function setKey(string $key): self { $this->options['key'] = $key; return $this; } /** * A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. * * @param string $value A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. * @return $this Fluent Builder */ public function setValue(string $value): self { $this->options['value'] = $value; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Serverless.V1.UpdateVariableOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentPage.php 0000644 00000003226 15021223077 0022257 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DeploymentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DeploymentInstance \Twilio\Rest\Serverless\V1\Service\Environment\DeploymentInstance */ public function buildInstance(array $payload): DeploymentInstance { return new DeploymentInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.DeploymentPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentContext.php 0000644 00000005036 15021223077 0023030 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class DeploymentContext extends InstanceContext { /** * Initialize the DeploymentContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to create the Deployment resource under. * @param string $environmentSid The SID of the Environment for the Deployment. * @param string $sid The SID that identifies the Deployment resource to fetch. */ public function __construct( Version $version, $serviceSid, $environmentSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Environments/' . \rawurlencode($environmentSid) .'/Deployments/' . \rawurlencode($sid) .''; } /** * Fetch the DeploymentInstance * * @return DeploymentInstance Fetched DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeploymentInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new DeploymentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.DeploymentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentList.php 0000644 00000014751 15021223077 0022323 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DeploymentList extends ListResource { /** * Construct the DeploymentList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to create the Deployment resource under. * @param string $environmentSid The SID of the Environment for the Deployment. */ public function __construct( Version $version, string $serviceSid, string $environmentSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Environments/' . \rawurlencode($environmentSid) .'/Deployments'; } /** * Create the DeploymentInstance * * @param array|Options $options Optional Arguments * @return DeploymentInstance Created DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): DeploymentInstance { $options = new Values($options); $data = Values::of([ 'BuildSid' => $options['buildSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DeploymentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'] ); } /** * Reads DeploymentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeploymentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DeploymentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DeploymentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DeploymentPage Page of DeploymentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DeploymentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DeploymentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeploymentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DeploymentPage Page of DeploymentInstance */ public function getPage(string $targetUrl): DeploymentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DeploymentPage($this->version, $response, $this->solution); } /** * Constructs a DeploymentContext * * @param string $sid The SID that identifies the Deployment resource to fetch. */ public function getContext( string $sid ): DeploymentContext { return new DeploymentContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.DeploymentList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentInstance.php 0000644 00000010436 15021223077 0023150 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $environmentSid * @property string|null $buildSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class DeploymentInstance extends InstanceResource { /** * Initialize the DeploymentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service to create the Deployment resource under. * @param string $environmentSid The SID of the Environment for the Deployment. * @param string $sid The SID that identifies the Deployment resource to fetch. */ public function __construct(Version $version, array $payload, string $serviceSid, string $environmentSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'environmentSid' => Values::array_get($payload, 'environment_sid'), 'buildSid' => Values::array_get($payload, 'build_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DeploymentContext Context for this DeploymentInstance */ protected function proxy(): DeploymentContext { if (!$this->context) { $this->context = new DeploymentContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the DeploymentInstance * * @return DeploymentInstance Fetched DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeploymentInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.DeploymentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableInstance.php 0000644 00000011735 15021223077 0022560 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $environmentSid * @property string|null $key * @property string|null $value * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class VariableInstance extends InstanceResource { /** * Initialize the VariableInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service to create the Variable resource under. * @param string $environmentSid The SID of the Environment in which the Variable resource exists. * @param string $sid The SID of the Variable resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $environmentSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'environmentSid' => Values::array_get($payload, 'environment_sid'), 'key' => Values::array_get($payload, 'key'), 'value' => Values::array_get($payload, 'value'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return VariableContext Context for this VariableInstance */ protected function proxy(): VariableContext { if (!$this->context) { $this->context = new VariableContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the VariableInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the VariableInstance * * @return VariableInstance Fetched VariableInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): VariableInstance { return $this->proxy()->fetch(); } /** * Update the VariableInstance * * @param array|Options $options Optional Arguments * @return VariableInstance Updated VariableInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): VariableInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.VariableInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogList.php 0000644 00000014123 15021223077 0020715 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class LogList extends ListResource { /** * Construct the LogList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Log resource from. * @param string $environmentSid The SID of the environment with the Log resource to fetch. */ public function __construct( Version $version, string $serviceSid, string $environmentSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Environments/' . \rawurlencode($environmentSid) .'/Logs'; } /** * Reads LogInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return LogInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams LogInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of LogInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return LogPage Page of LogInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): LogPage { $options = new Values($options); $params = Values::of([ 'FunctionSid' => $options['functionSid'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new LogPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of LogInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return LogPage Page of LogInstance */ public function getPage(string $targetUrl): LogPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new LogPage($this->version, $response, $this->solution); } /** * Constructs a LogContext * * @param string $sid The SID of the Log resource to fetch. */ public function getContext( string $sid ): LogContext { return new LogContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.LogList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogContext.php 0000644 00000004716 15021223077 0021435 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class LogContext extends InstanceContext { /** * Initialize the LogContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Log resource from. * @param string $environmentSid The SID of the environment with the Log resource to fetch. * @param string $sid The SID of the Log resource to fetch. */ public function __construct( Version $version, $serviceSid, $environmentSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Environments/' . \rawurlencode($environmentSid) .'/Logs/' . \rawurlencode($sid) .''; } /** * Fetch the LogInstance * * @return LogInstance Fetched LogInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): LogInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new LogInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.LogContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableList.php 0000644 00000015140 15021223077 0021721 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class VariableList extends ListResource { /** * Construct the VariableList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to create the Variable resource under. * @param string $environmentSid The SID of the Environment in which the Variable resource exists. */ public function __construct( Version $version, string $serviceSid, string $environmentSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Environments/' . \rawurlencode($environmentSid) .'/Variables'; } /** * Create the VariableInstance * * @param string $key A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. * @param string $value A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. * @return VariableInstance Created VariableInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $key, string $value): VariableInstance { $data = Values::of([ 'Key' => $key, 'Value' => $value, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new VariableInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'] ); } /** * Reads VariableInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return VariableInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams VariableInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of VariableInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return VariablePage Page of VariableInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): VariablePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new VariablePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of VariableInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return VariablePage Page of VariableInstance */ public function getPage(string $targetUrl): VariablePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new VariablePage($this->version, $response, $this->solution); } /** * Constructs a VariableContext * * @param string $sid The SID of the Variable resource to delete. */ public function getContext( string $sid ): VariableContext { return new VariableContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.VariableList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableContext.php 0000644 00000007172 15021223077 0022440 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class VariableContext extends InstanceContext { /** * Initialize the VariableContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to create the Variable resource under. * @param string $environmentSid The SID of the Environment in which the Variable resource exists. * @param string $sid The SID of the Variable resource to delete. */ public function __construct( Version $version, $serviceSid, $environmentSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Environments/' . \rawurlencode($environmentSid) .'/Variables/' . \rawurlencode($sid) .''; } /** * Delete the VariableInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the VariableInstance * * @return VariableInstance Fetched VariableInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): VariableInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new VariableInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } /** * Update the VariableInstance * * @param array|Options $options Optional Arguments * @return VariableInstance Updated VariableInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): VariableInstance { $options = new Values($options); $data = Values::of([ 'Key' => $options['key'], 'Value' => $options['value'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new VariableInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.VariableContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogOptions.php 0000644 00000007577 15021223077 0021454 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Options; use Twilio\Values; abstract class LogOptions { /** * @param string $functionSid The SID of the function whose invocation produced the Log resources to read. * @param \DateTime $startDate The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time. * @param \DateTime $endDate The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time. * @return ReadLogOptions Options builder */ public static function read( string $functionSid = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null ): ReadLogOptions { return new ReadLogOptions( $functionSid, $startDate, $endDate ); } } class ReadLogOptions extends Options { /** * @param string $functionSid The SID of the function whose invocation produced the Log resources to read. * @param \DateTime $startDate The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time. * @param \DateTime $endDate The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time. */ public function __construct( string $functionSid = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null ) { $this->options['functionSid'] = $functionSid; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * The SID of the function whose invocation produced the Log resources to read. * * @param string $functionSid The SID of the function whose invocation produced the Log resources to read. * @return $this Fluent Builder */ public function setFunctionSid(string $functionSid): self { $this->options['functionSid'] = $functionSid; return $this; } /** * The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time. * * @param \DateTime $startDate The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time. * * @param \DateTime $endDate The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Serverless.V1.ReadLogOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/BuildPage.php 0000644 00000003075 15021223077 0016674 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BuildPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return BuildInstance \Twilio\Rest\Serverless\V1\Service\BuildInstance */ public function buildInstance(array $payload): BuildInstance { return new BuildInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.BuildPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/BuildInstance.php 0000644 00000011643 15021223077 0017564 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Serverless\V1\Service\Build\BuildStatusList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string $status * @property array[]|null $assetVersions * @property array[]|null $functionVersions * @property array[]|null $dependencies * @property string $runtime * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class BuildInstance extends InstanceResource { protected $_buildStatus; /** * Initialize the BuildInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service to create the Build resource under. * @param string $sid The SID of the Build resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'status' => Values::array_get($payload, 'status'), 'assetVersions' => Values::array_get($payload, 'asset_versions'), 'functionVersions' => Values::array_get($payload, 'function_versions'), 'dependencies' => Values::array_get($payload, 'dependencies'), 'runtime' => Values::array_get($payload, 'runtime'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BuildContext Context for this BuildInstance */ protected function proxy(): BuildContext { if (!$this->context) { $this->context = new BuildContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the BuildInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the BuildInstance * * @return BuildInstance Fetched BuildInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BuildInstance { return $this->proxy()->fetch(); } /** * Access the buildStatus */ protected function getBuildStatus(): BuildStatusList { return $this->proxy()->buildStatus; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.BuildInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionContext.php 0000644 00000012112 15021223077 0020162 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionList; /** * @property FunctionVersionList $functionVersions * @method \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionContext functionVersions(string $sid) */ class FunctionContext extends InstanceContext { protected $_functionVersions; /** * Initialize the FunctionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to create the Function resource under. * @param string $sid The SID of the Function resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Functions/' . \rawurlencode($sid) .''; } /** * Delete the FunctionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the FunctionInstance * * @return FunctionInstance Fetched FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FunctionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new FunctionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the FunctionInstance * * @param string $friendlyName A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters. * @return FunctionInstance Updated FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): FunctionInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FunctionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the functionVersions */ protected function getFunctionVersions(): FunctionVersionList { if (!$this->_functionVersions) { $this->_functionVersions = new FunctionVersionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_functionVersions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.FunctionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentContext.php 0000644 00000012610 15021223077 0020704 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Serverless\V1\Service\Environment\LogList; use Twilio\Rest\Serverless\V1\Service\Environment\DeploymentList; use Twilio\Rest\Serverless\V1\Service\Environment\VariableList; /** * @property LogList $logs * @property DeploymentList $deployments * @property VariableList $variables * @method \Twilio\Rest\Serverless\V1\Service\Environment\LogContext logs(string $sid) * @method \Twilio\Rest\Serverless\V1\Service\Environment\VariableContext variables(string $sid) * @method \Twilio\Rest\Serverless\V1\Service\Environment\DeploymentContext deployments(string $sid) */ class EnvironmentContext extends InstanceContext { protected $_logs; protected $_deployments; protected $_variables; /** * Initialize the EnvironmentContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to create the Environment resource under. * @param string $sid The SID of the Environment resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Environments/' . \rawurlencode($sid) .''; } /** * Delete the EnvironmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the EnvironmentInstance * * @return EnvironmentInstance Fetched EnvironmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EnvironmentInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new EnvironmentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the logs */ protected function getLogs(): LogList { if (!$this->_logs) { $this->_logs = new LogList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_logs; } /** * Access the deployments */ protected function getDeployments(): DeploymentList { if (!$this->_deployments) { $this->_deployments = new DeploymentList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_deployments; } /** * Access the variables */ protected function getVariables(): VariableList { if (!$this->_variables) { $this->_variables = new VariableList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_variables; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.EnvironmentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/AssetContext.php 0000644 00000011750 15021223077 0017463 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionList; /** * @property AssetVersionList $assetVersions * @method \Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionContext assetVersions(string $sid) */ class AssetContext extends InstanceContext { protected $_assetVersions; /** * Initialize the AssetContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to create the Asset resource under. * @param string $sid The SID that identifies the Asset resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Assets/' . \rawurlencode($sid) .''; } /** * Delete the AssetInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the AssetInstance * * @return AssetInstance Fetched AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssetInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AssetInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the AssetInstance * * @param string $friendlyName A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. * @return AssetInstance Updated AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): AssetInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AssetInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the assetVersions */ protected function getAssetVersions(): AssetVersionList { if (!$this->_assetVersions) { $this->_assetVersions = new AssetVersionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_assetVersions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.AssetContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionInstance.php 0000644 00000012010 15021223077 0020277 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class FunctionInstance extends InstanceResource { protected $_functionVersions; /** * Initialize the FunctionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service to create the Function resource under. * @param string $sid The SID of the Function resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FunctionContext Context for this FunctionInstance */ protected function proxy(): FunctionContext { if (!$this->context) { $this->context = new FunctionContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the FunctionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the FunctionInstance * * @return FunctionInstance Fetched FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FunctionInstance { return $this->proxy()->fetch(); } /** * Update the FunctionInstance * * @param string $friendlyName A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters. * @return FunctionInstance Updated FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): FunctionInstance { return $this->proxy()->update($friendlyName); } /** * Access the functionVersions */ protected function getFunctionVersions(): FunctionVersionList { return $this->proxy()->functionVersions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.FunctionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/BuildList.php 0000644 00000014515 15021223077 0016734 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class BuildList extends ListResource { /** * Construct the BuildList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to create the Build resource under. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Builds'; } /** * Create the BuildInstance * * @param array|Options $options Optional Arguments * @return BuildInstance Created BuildInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): BuildInstance { $options = new Values($options); $data = Values::of([ 'AssetVersions' => Serialize::map($options['assetVersions'], function ($e) { return $e; }), 'FunctionVersions' => Serialize::map($options['functionVersions'], function ($e) { return $e; }), 'Dependencies' => $options['dependencies'], 'Runtime' => $options['runtime'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BuildInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads BuildInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BuildInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams BuildInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BuildInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BuildPage Page of BuildInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BuildPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BuildPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BuildInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BuildPage Page of BuildInstance */ public function getPage(string $targetUrl): BuildPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BuildPage($this->version, $response, $this->solution); } /** * Constructs a BuildContext * * @param string $sid The SID of the Build resource to delete. */ public function getContext( string $sid ): BuildContext { return new BuildContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.BuildList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionPage.php 0000644 00000003220 15021223077 0021331 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Asset; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AssetVersionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AssetVersionInstance \Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionInstance */ public function buildInstance(array $payload): AssetVersionInstance { return new AssetVersionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['assetSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.AssetVersionPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionContext.php 0000644 00000005034 15021223077 0022106 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Asset; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class AssetVersionContext extends InstanceContext { /** * Initialize the AssetVersionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Asset Version resource from. * @param string $assetSid The SID of the Asset resource that is the parent of the Asset Version resource to fetch. * @param string $sid The SID of the Asset Version resource to fetch. */ public function __construct( Version $version, $serviceSid, $assetSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'assetSid' => $assetSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Assets/' . \rawurlencode($assetSid) .'/Versions/' . \rawurlencode($sid) .''; } /** * Fetch the AssetVersionInstance * * @return AssetVersionInstance Fetched AssetVersionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssetVersionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AssetVersionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['assetSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.AssetVersionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionInstance.php 0000644 00000010357 15021223077 0022232 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Asset; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $assetSid * @property string|null $path * @property string $visibility * @property \DateTime|null $dateCreated * @property string|null $url */ class AssetVersionInstance extends InstanceResource { /** * Initialize the AssetVersionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service to fetch the Asset Version resource from. * @param string $assetSid The SID of the Asset resource that is the parent of the Asset Version resource to fetch. * @param string $sid The SID of the Asset Version resource to fetch. */ public function __construct(Version $version, array $payload, string $serviceSid, string $assetSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'assetSid' => Values::array_get($payload, 'asset_sid'), 'path' => Values::array_get($payload, 'path'), 'visibility' => Values::array_get($payload, 'visibility'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'assetSid' => $assetSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AssetVersionContext Context for this AssetVersionInstance */ protected function proxy(): AssetVersionContext { if (!$this->context) { $this->context = new AssetVersionContext( $this->version, $this->solution['serviceSid'], $this->solution['assetSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the AssetVersionInstance * * @return AssetVersionInstance Fetched AssetVersionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssetVersionInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.AssetVersionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionList.php 0000644 00000013350 15021223077 0021375 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Asset; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AssetVersionList extends ListResource { /** * Construct the AssetVersionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Asset Version resource from. * @param string $assetSid The SID of the Asset resource that is the parent of the Asset Version resource to fetch. */ public function __construct( Version $version, string $serviceSid, string $assetSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'assetSid' => $assetSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Assets/' . \rawurlencode($assetSid) .'/Versions'; } /** * Reads AssetVersionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssetVersionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AssetVersionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AssetVersionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AssetVersionPage Page of AssetVersionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AssetVersionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AssetVersionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssetVersionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AssetVersionPage Page of AssetVersionInstance */ public function getPage(string $targetUrl): AssetVersionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssetVersionPage($this->version, $response, $this->solution); } /** * Constructs a AssetVersionContext * * @param string $sid The SID of the Asset Version resource to fetch. */ public function getContext( string $sid ): AssetVersionContext { return new AssetVersionContext( $this->version, $this->solution['serviceSid'], $this->solution['assetSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.AssetVersionList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentOptions.php 0000644 00000004405 15021223077 0020716 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Options; use Twilio\Values; abstract class EnvironmentOptions { /** * @param string $domainSuffix A URL-friendly name that represents the environment and forms part of the domain name. It can be a maximum of 16 characters. * @return CreateEnvironmentOptions Options builder */ public static function create( string $domainSuffix = Values::NONE ): CreateEnvironmentOptions { return new CreateEnvironmentOptions( $domainSuffix ); } } class CreateEnvironmentOptions extends Options { /** * @param string $domainSuffix A URL-friendly name that represents the environment and forms part of the domain name. It can be a maximum of 16 characters. */ public function __construct( string $domainSuffix = Values::NONE ) { $this->options['domainSuffix'] = $domainSuffix; } /** * A URL-friendly name that represents the environment and forms part of the domain name. It can be a maximum of 16 characters. * * @param string $domainSuffix A URL-friendly name that represents the environment and forms part of the domain name. It can be a maximum of 16 characters. * @return $this Fluent Builder */ public function setDomainSuffix(string $domainSuffix): self { $this->options['domainSuffix'] = $domainSuffix; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Serverless.V1.CreateEnvironmentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/AssetList.php 0000644 00000014037 15021223077 0016753 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AssetList extends ListResource { /** * Construct the AssetList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to create the Asset resource under. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Assets'; } /** * Create the AssetInstance * * @param string $friendlyName A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. * @return AssetInstance Created AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): AssetInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AssetInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads AssetInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssetInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AssetInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AssetInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AssetPage Page of AssetInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AssetPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AssetPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssetInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AssetPage Page of AssetInstance */ public function getPage(string $targetUrl): AssetPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssetPage($this->version, $response, $this->solution); } /** * Constructs a AssetContext * * @param string $sid The SID that identifies the Asset resource to delete. */ public function getContext( string $sid ): AssetContext { return new AssetContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.AssetList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/AssetInstance.php 0000644 00000011701 15021223077 0017577 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class AssetInstance extends InstanceResource { protected $_assetVersions; /** * Initialize the AssetInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service to create the Asset resource under. * @param string $sid The SID that identifies the Asset resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AssetContext Context for this AssetInstance */ protected function proxy(): AssetContext { if (!$this->context) { $this->context = new AssetContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the AssetInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AssetInstance * * @return AssetInstance Fetched AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssetInstance { return $this->proxy()->fetch(); } /** * Update the AssetInstance * * @param string $friendlyName A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. * @return AssetInstance Updated AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): AssetInstance { return $this->proxy()->update($friendlyName); } /** * Access the assetVersions */ protected function getAssetVersions(): AssetVersionList { return $this->proxy()->assetVersions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.AssetInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentPage.php 0000644 00000003141 15021223077 0020133 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EnvironmentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return EnvironmentInstance \Twilio\Rest\Serverless\V1\Service\EnvironmentInstance */ public function buildInstance(array $payload): EnvironmentInstance { return new EnvironmentInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.EnvironmentPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentInstance.php 0000644 00000012522 15021223077 0021026 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Serverless\V1\Service\Environment\LogList; use Twilio\Rest\Serverless\V1\Service\Environment\DeploymentList; use Twilio\Rest\Serverless\V1\Service\Environment\VariableList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $buildSid * @property string|null $uniqueName * @property string|null $domainSuffix * @property string|null $domainName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class EnvironmentInstance extends InstanceResource { protected $_logs; protected $_deployments; protected $_variables; /** * Initialize the EnvironmentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service to create the Environment resource under. * @param string $sid The SID of the Environment resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'buildSid' => Values::array_get($payload, 'build_sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'domainSuffix' => Values::array_get($payload, 'domain_suffix'), 'domainName' => Values::array_get($payload, 'domain_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EnvironmentContext Context for this EnvironmentInstance */ protected function proxy(): EnvironmentContext { if (!$this->context) { $this->context = new EnvironmentContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the EnvironmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the EnvironmentInstance * * @return EnvironmentInstance Fetched EnvironmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EnvironmentInstance { return $this->proxy()->fetch(); } /** * Access the logs */ protected function getLogs(): LogList { return $this->proxy()->logs; } /** * Access the deployments */ protected function getDeployments(): DeploymentList { return $this->proxy()->deployments; } /** * Access the variables */ protected function getVariables(): VariableList { return $this->proxy()->variables; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.EnvironmentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/BuildOptions.php 0000644 00000011224 15021223077 0017446 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Options; use Twilio\Values; use Twilio\Version; abstract class BuildOptions { /** * @param string[] $assetVersions The list of Asset Version resource SIDs to include in the Build. * @param string[] $functionVersions The list of the Function Version resource SIDs to include in the Build. * @param string $dependencies A list of objects that describe the Dependencies included in the Build. Each object contains the `name` and `version` of the dependency. * @param string $runtime The Runtime version that will be used to run the Build resource when it is deployed. * @return CreateBuildOptions Options builder */ public static function create( array $assetVersions = Values::ARRAY_NONE, array $functionVersions = Values::ARRAY_NONE, string $dependencies = Values::NONE, string $runtime = Values::NONE ): CreateBuildOptions { return new CreateBuildOptions( $assetVersions, $functionVersions, $dependencies, $runtime ); } } class CreateBuildOptions extends Options { /** * @param string[] $assetVersions The list of Asset Version resource SIDs to include in the Build. * @param string[] $functionVersions The list of the Function Version resource SIDs to include in the Build. * @param string $dependencies A list of objects that describe the Dependencies included in the Build. Each object contains the `name` and `version` of the dependency. * @param string $runtime The Runtime version that will be used to run the Build resource when it is deployed. */ public function __construct( array $assetVersions = Values::ARRAY_NONE, array $functionVersions = Values::ARRAY_NONE, string $dependencies = Values::NONE, string $runtime = Values::NONE ) { $this->options['assetVersions'] = $assetVersions; $this->options['functionVersions'] = $functionVersions; $this->options['dependencies'] = $dependencies; $this->options['runtime'] = $runtime; } /** * The list of Asset Version resource SIDs to include in the Build. * * @param string[] $assetVersions The list of Asset Version resource SIDs to include in the Build. * @return $this Fluent Builder */ public function setAssetVersions(array $assetVersions): self { $this->options['assetVersions'] = $assetVersions; return $this; } /** * The list of the Function Version resource SIDs to include in the Build. * * @param string[] $functionVersions The list of the Function Version resource SIDs to include in the Build. * @return $this Fluent Builder */ public function setFunctionVersions(array $functionVersions): self { $this->options['functionVersions'] = $functionVersions; return $this; } /** * A list of objects that describe the Dependencies included in the Build. Each object contains the `name` and `version` of the dependency. * * @param string $dependencies A list of objects that describe the Dependencies included in the Build. Each object contains the `name` and `version` of the dependency. * @return $this Fluent Builder */ public function setDependencies(string $dependencies): self { $this->options['dependencies'] = $dependencies; return $this; } /** * The Runtime version that will be used to run the Build resource when it is deployed. * * @param string $runtime The Runtime version that will be used to run the Build resource when it is deployed. * @return $this Fluent Builder */ public function setRuntime(string $runtime): self { $this->options['runtime'] = $runtime; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Serverless.V1.CreateBuildOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionPage.php 0000644 00000003117 15021223077 0017417 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FunctionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FunctionInstance \Twilio\Rest\Serverless\V1\Service\FunctionInstance */ public function buildInstance(array $payload): FunctionInstance { return new FunctionInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.FunctionPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionList.php 0000644 00000014146 15021223077 0017462 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class FunctionList extends ListResource { /** * Construct the FunctionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to create the Function resource under. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Functions'; } /** * Create the FunctionInstance * * @param string $friendlyName A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters. * @return FunctionInstance Created FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): FunctionInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FunctionInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads FunctionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FunctionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams FunctionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FunctionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FunctionPage Page of FunctionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FunctionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FunctionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FunctionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FunctionPage Page of FunctionInstance */ public function getPage(string $targetUrl): FunctionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FunctionPage($this->version, $response, $this->solution); } /** * Constructs a FunctionContext * * @param string $sid The SID of the Function resource to delete. */ public function getContext( string $sid ): FunctionContext { return new FunctionContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.FunctionList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/AssetPage.php 0000644 00000003075 15021223077 0016714 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AssetPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AssetInstance \Twilio\Rest\Serverless\V1\Service\AssetInstance */ public function buildInstance(array $payload): AssetInstance { return new AssetInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.AssetPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusList.php 0000644 00000003371 15021223077 0021175 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Build; use Twilio\ListResource; use Twilio\Version; class BuildStatusList extends ListResource { /** * Construct the BuildStatusList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Build resource from. * @param string $sid The SID of the Build resource to fetch. */ public function __construct( Version $version, string $serviceSid, string $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; } /** * Constructs a BuildStatusContext */ public function getContext( ): BuildStatusContext { return new BuildStatusContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.BuildStatusList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusPage.php 0000644 00000003205 15021223077 0021132 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Build; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BuildStatusPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return BuildStatusInstance \Twilio\Rest\Serverless\V1\Service\Build\BuildStatusInstance */ public function buildInstance(array $payload): BuildStatusInstance { return new BuildStatusInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.BuildStatusPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusContext.php 0000644 00000004371 15021223077 0021707 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Build; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class BuildStatusContext extends InstanceContext { /** * Initialize the BuildStatusContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Build resource from. * @param string $sid The SID of the Build resource to fetch. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Builds/' . \rawurlencode($sid) .'/Status'; } /** * Fetch the BuildStatusInstance * * @return BuildStatusInstance Fetched BuildStatusInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BuildStatusInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new BuildStatusInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.BuildStatusContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusInstance.php 0000644 00000007162 15021223077 0022030 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\Build; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string $status * @property string|null $url */ class BuildStatusInstance extends InstanceResource { /** * Initialize the BuildStatusInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service to fetch the Build resource from. * @param string $sid The SID of the Build resource to fetch. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'status' => Values::array_get($payload, 'status'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BuildStatusContext Context for this BuildStatusInstance */ protected function proxy(): BuildStatusContext { if (!$this->context) { $this->context = new BuildStatusContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the BuildStatusInstance * * @return BuildStatusInstance Fetched BuildStatusInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BuildStatusInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.BuildStatusInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionContext.php 0000644 00000011061 15021223077 0024507 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion\FunctionVersionContentList; /** * @property FunctionVersionContentList $functionVersionContent * @method \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion\FunctionVersionContentContext functionVersionContent() */ class FunctionVersionContext extends InstanceContext { protected $_functionVersionContent; /** * Initialize the FunctionVersionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Function Version resource from. * @param string $functionSid The SID of the function that is the parent of the Function Version resource to fetch. * @param string $sid The SID of the Function Version resource to fetch. */ public function __construct( Version $version, $serviceSid, $functionSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'functionSid' => $functionSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Functions/' . \rawurlencode($functionSid) .'/Versions/' . \rawurlencode($sid) .''; } /** * Fetch the FunctionVersionInstance * * @return FunctionVersionInstance Fetched FunctionVersionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FunctionVersionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new FunctionVersionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['functionSid'], $this->solution['sid'] ); } /** * Access the functionVersionContent */ protected function getFunctionVersionContent(): FunctionVersionContentList { if (!$this->_functionVersionContent) { $this->_functionVersionContent = new FunctionVersionContentList( $this->version, $this->solution['serviceSid'], $this->solution['functionSid'], $this->solution['sid'] ); } return $this->_functionVersionContent; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.FunctionVersionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionList.php 0000644 00000013502 15021223077 0024000 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class FunctionVersionList extends ListResource { /** * Construct the FunctionVersionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Function Version resource from. * @param string $functionSid The SID of the function that is the parent of the Function Version resource to fetch. */ public function __construct( Version $version, string $serviceSid, string $functionSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'functionSid' => $functionSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Functions/' . \rawurlencode($functionSid) .'/Versions'; } /** * Reads FunctionVersionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FunctionVersionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams FunctionVersionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FunctionVersionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FunctionVersionPage Page of FunctionVersionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FunctionVersionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FunctionVersionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FunctionVersionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FunctionVersionPage Page of FunctionVersionInstance */ public function getPage(string $targetUrl): FunctionVersionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FunctionVersionPage($this->version, $response, $this->solution); } /** * Constructs a FunctionVersionContext * * @param string $sid The SID of the Function Version resource to fetch. */ public function getContext( string $sid ): FunctionVersionContext { return new FunctionVersionContext( $this->version, $this->solution['serviceSid'], $this->solution['functionSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.FunctionVersionList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionPage.php 0000644 00000003267 15021223077 0023750 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FunctionVersionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FunctionVersionInstance \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionInstance */ public function buildInstance(array $payload): FunctionVersionInstance { return new FunctionVersionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['functionSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.FunctionVersionPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionInstance.php 0000644 00000011346 15021223077 0024635 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion\FunctionVersionContentList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $functionSid * @property string|null $path * @property string $visibility * @property \DateTime|null $dateCreated * @property string|null $url * @property array|null $links */ class FunctionVersionInstance extends InstanceResource { protected $_functionVersionContent; /** * Initialize the FunctionVersionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service to fetch the Function Version resource from. * @param string $functionSid The SID of the function that is the parent of the Function Version resource to fetch. * @param string $sid The SID of the Function Version resource to fetch. */ public function __construct(Version $version, array $payload, string $serviceSid, string $functionSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'functionSid' => Values::array_get($payload, 'function_sid'), 'path' => Values::array_get($payload, 'path'), 'visibility' => Values::array_get($payload, 'visibility'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'functionSid' => $functionSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FunctionVersionContext Context for this FunctionVersionInstance */ protected function proxy(): FunctionVersionContext { if (!$this->context) { $this->context = new FunctionVersionContext( $this->version, $this->solution['serviceSid'], $this->solution['functionSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the FunctionVersionInstance * * @return FunctionVersionInstance Fetched FunctionVersionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FunctionVersionInstance { return $this->proxy()->fetch(); } /** * Access the functionVersionContent */ protected function getFunctionVersionContent(): FunctionVersionContentList { return $this->proxy()->functionVersionContent; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.FunctionVersionInstance ' . \implode(' ', $context) . ']'; } } src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentPage.php 0000644 00000003431 15021223077 0030350 0 ustar 00 sdk <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FunctionVersionContentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FunctionVersionContentInstance \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion\FunctionVersionContentInstance */ public function buildInstance(array $payload): FunctionVersionContentInstance { return new FunctionVersionContentInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['functionSid'], $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.FunctionVersionContentPage]'; } } Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentInstance.php 0000644 00000010153 15021223077 0031237 0 ustar 00 sdk/src <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $functionSid * @property string|null $content * @property string|null $url */ class FunctionVersionContentInstance extends InstanceResource { /** * Initialize the FunctionVersionContentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service to fetch the Function Version content from. * @param string $functionSid The SID of the Function that is the parent of the Function Version content to fetch. * @param string $sid The SID of the Function Version content to fetch. */ public function __construct(Version $version, array $payload, string $serviceSid, string $functionSid, string $sid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'functionSid' => Values::array_get($payload, 'function_sid'), 'content' => Values::array_get($payload, 'content'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'functionSid' => $functionSid, 'sid' => $sid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FunctionVersionContentContext Context for this FunctionVersionContentInstance */ protected function proxy(): FunctionVersionContentContext { if (!$this->context) { $this->context = new FunctionVersionContentContext( $this->version, $this->solution['serviceSid'], $this->solution['functionSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the FunctionVersionContentInstance * * @return FunctionVersionContentInstance Fetched FunctionVersionContentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FunctionVersionContentInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.FunctionVersionContentInstance ' . \implode(' ', $context) . ']'; } } src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentList.php 0000644 00000004144 15021223077 0030411 0 ustar 00 sdk <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion; use Twilio\ListResource; use Twilio\Version; class FunctionVersionContentList extends ListResource { /** * Construct the FunctionVersionContentList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Function Version content from. * @param string $functionSid The SID of the Function that is the parent of the Function Version content to fetch. * @param string $sid The SID of the Function Version content to fetch. */ public function __construct( Version $version, string $serviceSid, string $functionSid, string $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'functionSid' => $functionSid, 'sid' => $sid, ]; } /** * Constructs a FunctionVersionContentContext */ public function getContext( ): FunctionVersionContentContext { return new FunctionVersionContentContext( $this->version, $this->solution['serviceSid'], $this->solution['functionSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.FunctionVersionContentList]'; } } Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentContext.php 0000644 00000005242 15021223077 0031122 0 ustar 00 sdk/src <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class FunctionVersionContentContext extends InstanceContext { /** * Initialize the FunctionVersionContentContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Function Version content from. * @param string $functionSid The SID of the Function that is the parent of the Function Version content to fetch. * @param string $sid The SID of the Function Version content to fetch. */ public function __construct( Version $version, $serviceSid, $functionSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'functionSid' => $functionSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Functions/' . \rawurlencode($functionSid) .'/Versions/' . \rawurlencode($sid) .'/Content'; } /** * Fetch the FunctionVersionContentInstance * * @return FunctionVersionContentInstance Fetched FunctionVersionContentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FunctionVersionContentInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new FunctionVersionContentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['functionSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.FunctionVersionContentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/BuildContext.php 0000644 00000010307 15021223077 0017440 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Serverless\V1\Service\Build\BuildStatusList; /** * @property BuildStatusList $buildStatus * @method \Twilio\Rest\Serverless\V1\Service\Build\BuildStatusContext buildStatus() */ class BuildContext extends InstanceContext { protected $_buildStatus; /** * Initialize the BuildContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to create the Build resource under. * @param string $sid The SID of the Build resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Builds/' . \rawurlencode($sid) .''; } /** * Delete the BuildInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the BuildInstance * * @return BuildInstance Fetched BuildInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BuildInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new BuildInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the buildStatus */ protected function getBuildStatus(): BuildStatusList { if (!$this->_buildStatus) { $this->_buildStatus = new BuildStatusList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_buildStatus; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.BuildContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentList.php 0000644 00000014603 15021223077 0020177 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class EnvironmentList extends ListResource { /** * Construct the EnvironmentList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to create the Environment resource under. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Environments'; } /** * Create the EnvironmentInstance * * @param string $uniqueName A user-defined string that uniquely identifies the Environment resource. It can be a maximum of 100 characters. * @param array|Options $options Optional Arguments * @return EnvironmentInstance Created EnvironmentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $uniqueName, array $options = []): EnvironmentInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $uniqueName, 'DomainSuffix' => $options['domainSuffix'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new EnvironmentInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads EnvironmentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EnvironmentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams EnvironmentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EnvironmentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EnvironmentPage Page of EnvironmentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EnvironmentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EnvironmentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EnvironmentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EnvironmentPage Page of EnvironmentInstance */ public function getPage(string $targetUrl): EnvironmentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EnvironmentPage($this->version, $response, $this->solution); } /** * Constructs a EnvironmentContext * * @param string $sid The SID of the Environment resource to delete. */ public function getContext( string $sid ): EnvironmentContext { return new EnvironmentContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.EnvironmentList]'; } } sdk/src/Twilio/Rest/Serverless/V1/ServiceInstance.php 0000644 00000013271 15021223077 0016524 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Serverless\V1\Service\FunctionList; use Twilio\Rest\Serverless\V1\Service\BuildList; use Twilio\Rest\Serverless\V1\Service\EnvironmentList; use Twilio\Rest\Serverless\V1\Service\AssetList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string|null $uniqueName * @property bool|null $includeCredentials * @property bool|null $uiEditable * @property string|null $domainBase * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class ServiceInstance extends InstanceResource { protected $_functions; protected $_builds; protected $_environments; protected $_assets; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The `sid` or `unique_name` of the Service resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'includeCredentials' => Values::array_get($payload, 'include_credentials'), 'uiEditable' => Values::array_get($payload, 'ui_editable'), 'domainBase' => Values::array_get($payload, 'domain_base'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the functions */ protected function getFunctions(): FunctionList { return $this->proxy()->functions; } /** * Access the builds */ protected function getBuilds(): BuildList { return $this->proxy()->builds; } /** * Access the environments */ protected function getEnvironments(): EnvironmentList { return $this->proxy()->environments; } /** * Access the assets */ protected function getAssets(): AssetList { return $this->proxy()->assets; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/ServiceList.php 0000644 00000014735 15021223077 0015701 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $uniqueName A user-defined string that uniquely identifies the Service resource. It can be used as an alternative to the `sid` in the URL path to address the Service resource. This value must be 50 characters or less in length and be unique. * @param string $friendlyName A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. * @param array|Options $options Optional Arguments * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $uniqueName, string $friendlyName, array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $uniqueName, 'FriendlyName' => $friendlyName, 'IncludeCredentials' => Serialize::booleanToString($options['includeCredentials']), 'UiEditable' => Serialize::booleanToString($options['uiEditable']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The `sid` or `unique_name` of the Service resource to delete. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Serverless/V1/ServiceOptions.php 0000644 00000014623 15021223077 0016415 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param bool $includeCredentials Whether to inject Account credentials into a function invocation context. The default value is `true`. * @param bool $uiEditable Whether the Service's properties and subresources can be edited via the UI. The default value is `false`. * @return CreateServiceOptions Options builder */ public static function create( bool $includeCredentials = Values::BOOL_NONE, bool $uiEditable = Values::BOOL_NONE ): CreateServiceOptions { return new CreateServiceOptions( $includeCredentials, $uiEditable ); } /** * @param bool $includeCredentials Whether to inject Account credentials into a function invocation context. * @param string $friendlyName A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. * @param bool $uiEditable Whether the Service resource's properties and subresources can be edited via the UI. The default value is `false`. * @return UpdateServiceOptions Options builder */ public static function update( bool $includeCredentials = Values::BOOL_NONE, string $friendlyName = Values::NONE, bool $uiEditable = Values::BOOL_NONE ): UpdateServiceOptions { return new UpdateServiceOptions( $includeCredentials, $friendlyName, $uiEditable ); } } class CreateServiceOptions extends Options { /** * @param bool $includeCredentials Whether to inject Account credentials into a function invocation context. The default value is `true`. * @param bool $uiEditable Whether the Service's properties and subresources can be edited via the UI. The default value is `false`. */ public function __construct( bool $includeCredentials = Values::BOOL_NONE, bool $uiEditable = Values::BOOL_NONE ) { $this->options['includeCredentials'] = $includeCredentials; $this->options['uiEditable'] = $uiEditable; } /** * Whether to inject Account credentials into a function invocation context. The default value is `true`. * * @param bool $includeCredentials Whether to inject Account credentials into a function invocation context. The default value is `true`. * @return $this Fluent Builder */ public function setIncludeCredentials(bool $includeCredentials): self { $this->options['includeCredentials'] = $includeCredentials; return $this; } /** * Whether the Service's properties and subresources can be edited via the UI. The default value is `false`. * * @param bool $uiEditable Whether the Service's properties and subresources can be edited via the UI. The default value is `false`. * @return $this Fluent Builder */ public function setUiEditable(bool $uiEditable): self { $this->options['uiEditable'] = $uiEditable; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Serverless.V1.CreateServiceOptions ' . $options . ']'; } } class UpdateServiceOptions extends Options { /** * @param bool $includeCredentials Whether to inject Account credentials into a function invocation context. * @param string $friendlyName A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. * @param bool $uiEditable Whether the Service resource's properties and subresources can be edited via the UI. The default value is `false`. */ public function __construct( bool $includeCredentials = Values::BOOL_NONE, string $friendlyName = Values::NONE, bool $uiEditable = Values::BOOL_NONE ) { $this->options['includeCredentials'] = $includeCredentials; $this->options['friendlyName'] = $friendlyName; $this->options['uiEditable'] = $uiEditable; } /** * Whether to inject Account credentials into a function invocation context. * * @param bool $includeCredentials Whether to inject Account credentials into a function invocation context. * @return $this Fluent Builder */ public function setIncludeCredentials(bool $includeCredentials): self { $this->options['includeCredentials'] = $includeCredentials; return $this; } /** * A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. * * @param string $friendlyName A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether the Service resource's properties and subresources can be edited via the UI. The default value is `false`. * * @param bool $uiEditable Whether the Service resource's properties and subresources can be edited via the UI. The default value is `false`. * @return $this Fluent Builder */ public function setUiEditable(bool $uiEditable): self { $this->options['uiEditable'] = $uiEditable; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Serverless.V1.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/ServiceContext.php 0000644 00000014503 15021223077 0016403 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Serverless\V1\Service\FunctionList; use Twilio\Rest\Serverless\V1\Service\BuildList; use Twilio\Rest\Serverless\V1\Service\EnvironmentList; use Twilio\Rest\Serverless\V1\Service\AssetList; /** * @property FunctionList $functions * @property BuildList $builds * @property EnvironmentList $environments * @property AssetList $assets * @method \Twilio\Rest\Serverless\V1\Service\EnvironmentContext environments(string $sid) * @method \Twilio\Rest\Serverless\V1\Service\FunctionContext functions(string $sid) * @method \Twilio\Rest\Serverless\V1\Service\BuildContext builds(string $sid) * @method \Twilio\Rest\Serverless\V1\Service\AssetContext assets(string $sid) */ class ServiceContext extends InstanceContext { protected $_functions; protected $_builds; protected $_environments; protected $_assets; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The `sid` or `unique_name` of the Service resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) .''; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'IncludeCredentials' => Serialize::booleanToString($options['includeCredentials']), 'FriendlyName' => $options['friendlyName'], 'UiEditable' => Serialize::booleanToString($options['uiEditable']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the functions */ protected function getFunctions(): FunctionList { if (!$this->_functions) { $this->_functions = new FunctionList( $this->version, $this->solution['sid'] ); } return $this->_functions; } /** * Access the builds */ protected function getBuilds(): BuildList { if (!$this->_builds) { $this->_builds = new BuildList( $this->version, $this->solution['sid'] ); } return $this->_builds; } /** * Access the environments */ protected function getEnvironments(): EnvironmentList { if (!$this->_environments) { $this->_environments = new EnvironmentList( $this->version, $this->solution['sid'] ); } return $this->_environments; } /** * Access the assets */ protected function getAssets(): AssetList { if (!$this->_assets) { $this->_assets = new AssetList( $this->version, $this->solution['sid'] ); } return $this->_assets; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/ServicePage.php 0000644 00000003032 15021223077 0015626 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ServiceInstance \Twilio\Rest\Serverless\V1\ServiceInstance */ public function buildInstance(array $payload): ServiceInstance { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1.ServicePage]'; } } sdk/src/Twilio/Rest/Serverless/V1.php 0000644 00000005115 15021223077 0013435 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Serverless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Serverless; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Serverless\V1\ServiceList; use Twilio\Version; /** * @property ServiceList $services * @method \Twilio\Rest\Serverless\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_services; /** * Construct the V1 version of Serverless * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getServices(): ServiceList { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless.V1]'; } } sdk/src/Twilio/Rest/OauthBase.php 0000644 00000004513 15021223077 0012666 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Oauth\V1; /** * @property \Twilio\Rest\Oauth\V1 $v1 */ class OauthBase extends Domain { protected $_v1; /** * Construct the Oauth Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://oauth.twilio.com'; } /** * @return V1 Version v1 of oauth */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Oauth]'; } } sdk/src/Twilio/Rest/Serverless.php 0000644 00000001313 15021223077 0013143 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Serverless\V1; class Serverless extends ServerlessBase { /** * @deprecated Use v1->services instead. */ protected function getServices(): \Twilio\Rest\Serverless\V1\ServiceList { echo "services is deprecated. Use v1->services instead."; return $this->v1->services; } /** * @deprecated Use v1->services(\$sid) instead. * @param string $sid The SID of the Service resource to fetch */ protected function contextServices(string $sid): \Twilio\Rest\Serverless\V1\ServiceContext { echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; return $this->v1->services($sid); } } sdk/src/Twilio/Rest/Routes.php 0000644 00000003743 15021223077 0012300 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Routes\V2; class Routes extends RoutesBase { /** * @deprecated Use v2->phoneNumbers instead. */ protected function getPhoneNumbers(): \Twilio\Rest\Routes\V2\PhoneNumberList { echo "phoneNumbers is deprecated. Use v2->phoneNumbers instead."; return $this->v2->phoneNumbers; } /** * @deprecated Use v2->phoneNumbers(\$phoneNumber) instead. * @param string $phoneNumber The phone number */ protected function contextPhoneNumbers(string $phoneNumber): \Twilio\Rest\Routes\V2\PhoneNumberContext { echo "phoneNumbers(\$phoneNumber) is deprecated. Use v2->phoneNumbers(\$phoneNumber) instead."; return $this->v2->phoneNumbers($phoneNumber); } /** * @deprecated Use v2->sipDomains instead. */ protected function getSipDomains(): \Twilio\Rest\Routes\V2\SipDomainList { echo "sipDomains is deprecated. Use v2->sipDomains instead."; return $this->v2->sipDomains; } /** * @deprecated Use v2->sipDomains(\$sipDomain) instead. * @param string $sipDomain The sip_domain */ protected function contextSipDomains(string $sipDomain): \Twilio\Rest\Routes\V2\SipDomainContext { echo "sipDomains(\$sipDomain) is deprecated. Use v2->sipDomains(\$sipDomain) instead."; return $this->v2->sipDomains($sipDomain); } /** * @deprecated Use v2->trunks instead. */ protected function getTrunks(): \Twilio\Rest\Routes\V2\TrunkList { echo "trunks is deprecated. Use v2->trunks instead."; return $this->v2->trunks; } /** * @deprecated Use v2->trunks(\$sipTrunkDomain instead. * @param string $sipTrunkDomain The SIP Trunk */ protected function contextTrunks(string $sipTrunkDomain): \Twilio\Rest\Routes\V2\TrunkContext { echo "trunks(\$sipTrunkDomain) is deprecated. Use v2->trunks(\$sipTrunkDomain instead."; return $this->v2->trunks($sipTrunkDomain); } } sdk/src/Twilio/Rest/NumbersBase.php 0000644 00000005176 15021223077 0013227 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Numbers\V1; use Twilio\Rest\Numbers\V2; /** * @property \Twilio\Rest\Numbers\V1 $v1 * @property \Twilio\Rest\Numbers\V2 $v2 */ class NumbersBase extends Domain { protected $_v1; protected $_v2; /** * Construct the Numbers Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://numbers.twilio.com'; } /** * @return V1 Version v1 of numbers */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return V2 Version v2 of numbers */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Numbers]'; } } sdk/src/Twilio/Rest/FrontlineApi/V1/UserOptions.php 0000644 00000010607 15021223077 0016166 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Frontline * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\FrontlineApi\V1; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $friendlyName The string that you assigned to describe the User. * @param string $avatar The avatar URL which will be shown in Frontline application. * @param string $state * @param bool $isAvailable Whether the User is available for new conversations. Set to `false` to prevent User from receiving new inbound conversations if you are using [Pool Routing](https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing). * @return UpdateUserOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $avatar = Values::NONE, string $state = Values::NONE, bool $isAvailable = Values::BOOL_NONE ): UpdateUserOptions { return new UpdateUserOptions( $friendlyName, $avatar, $state, $isAvailable ); } } class UpdateUserOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the User. * @param string $avatar The avatar URL which will be shown in Frontline application. * @param string $state * @param bool $isAvailable Whether the User is available for new conversations. Set to `false` to prevent User from receiving new inbound conversations if you are using [Pool Routing](https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing). */ public function __construct( string $friendlyName = Values::NONE, string $avatar = Values::NONE, string $state = Values::NONE, bool $isAvailable = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['avatar'] = $avatar; $this->options['state'] = $state; $this->options['isAvailable'] = $isAvailable; } /** * The string that you assigned to describe the User. * * @param string $friendlyName The string that you assigned to describe the User. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The avatar URL which will be shown in Frontline application. * * @param string $avatar The avatar URL which will be shown in Frontline application. * @return $this Fluent Builder */ public function setAvatar(string $avatar): self { $this->options['avatar'] = $avatar; return $this; } /** * @param string $state * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * Whether the User is available for new conversations. Set to `false` to prevent User from receiving new inbound conversations if you are using [Pool Routing](https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing). * * @param bool $isAvailable Whether the User is available for new conversations. Set to `false` to prevent User from receiving new inbound conversations if you are using [Pool Routing](https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing). * @return $this Fluent Builder */ public function setIsAvailable(bool $isAvailable): self { $this->options['isAvailable'] = $isAvailable; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.FrontlineApi.V1.UpdateUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/FrontlineApi/V1/UserContext.php 0000644 00000005646 15021223077 0016166 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Frontline * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\FrontlineApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class UserContext extends InstanceContext { /** * Initialize the UserContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the User resource to fetch. This value can be either the `sid` or the `identity` of the User resource to fetch. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Users/' . \rawurlencode($sid) .''; } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'Avatar' => $options['avatar'], 'State' => $options['state'], 'IsAvailable' => Serialize::booleanToString($options['isAvailable']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new UserInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FrontlineApi.V1.UserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FrontlineApi/V1/UserPage.php 0000644 00000003015 15021223077 0015402 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Frontline * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\FrontlineApi\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserInstance \Twilio\Rest\FrontlineApi\V1\UserInstance */ public function buildInstance(array $payload): UserInstance { return new UserInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FrontlineApi.V1.UserPage]'; } } sdk/src/Twilio/Rest/FrontlineApi/V1/UserList.php 0000644 00000003004 15021223077 0015437 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Frontline * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\FrontlineApi\V1; use Twilio\ListResource; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a UserContext * * @param string $sid The SID of the User resource to fetch. This value can be either the `sid` or the `identity` of the User resource to fetch. */ public function getContext( string $sid ): UserContext { return new UserContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FrontlineApi.V1.UserList]'; } } sdk/src/Twilio/Rest/FrontlineApi/V1/UserInstance.php 0000644 00000010012 15021223077 0016265 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Frontline * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\FrontlineApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string|null $identity * @property string|null $friendlyName * @property string|null $avatar * @property string $state * @property bool|null $isAvailable * @property string|null $url */ class UserInstance extends InstanceResource { /** * Initialize the UserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the User resource to fetch. This value can be either the `sid` or the `identity` of the User resource to fetch. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'identity' => Values::array_get($payload, 'identity'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'avatar' => Values::array_get($payload, 'avatar'), 'state' => Values::array_get($payload, 'state'), 'isAvailable' => Values::array_get($payload, 'is_available'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserContext Context for this UserInstance */ protected function proxy(): UserContext { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FrontlineApi.V1.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FrontlineApi/V1.php 0000644 00000005062 15021223077 0013673 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Frontline * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\FrontlineApi; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\FrontlineApi\V1\UserList; use Twilio\Version; /** * @property UserList $users * @method \Twilio\Rest\FrontlineApi\V1\UserContext users(string $sid) */ class V1 extends Version { protected $_users; /** * Construct the V1 version of FrontlineApi * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getUsers(): UserList { if (!$this->_users) { $this->_users = new UserList($this); } return $this->_users; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FrontlineApi.V1]'; } } sdk/src/Twilio/Rest/Chat/V3.php 0000644 00000005075 15021223077 0012166 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Chat\V3\ChannelList; use Twilio\Version; /** * @property ChannelList $channels * @method \Twilio\Rest\Chat\V3\ChannelContext channels(string $serviceSid, string $sid) */ class V3 extends Version { protected $_channels; /** * Construct the V3 version of Chat * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v3'; } protected function getChannels(): ChannelList { if (!$this->_channels) { $this->_channels = new ChannelList($this); } return $this->_channels; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V3]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/UserOptions.php 0000644 00000020423 15021223077 0016051 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the new User. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $friendlyName A descriptive string that you create to describe the new resource. This value is often used for display purposes. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateUserOptions Options builder */ public static function create( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateUserOptions { return new CreateUserOptions( $roleSid, $attributes, $friendlyName, $xTwilioWebhookEnabled ); } /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateUserOptions Options builder */ public static function update( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateUserOptions { return new UpdateUserOptions( $roleSid, $attributes, $friendlyName, $xTwilioWebhookEnabled ); } } class CreateUserOptions extends Options { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the new User. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $friendlyName A descriptive string that you create to describe the new resource. This value is often used for display purposes. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the new User. * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the new User. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the new resource. This value is often used for display purposes. * * @param string $friendlyName A descriptive string that you create to describe the new resource. This value is often used for display purposes. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.CreateUserOptions ' . $options . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the resource. It is often used for display purposes. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/UserContext.php 0000644 00000013564 15021223077 0016052 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Chat\V2\Service\User\UserBindingList; use Twilio\Rest\Chat\V2\Service\User\UserChannelList; /** * @property UserBindingList $userBindings * @property UserChannelList $userChannels * @method \Twilio\Rest\Chat\V2\Service\User\UserChannelContext userChannels(string $channelSid) * @method \Twilio\Rest\Chat\V2\Service\User\UserBindingContext userBindings(string $sid) */ class UserContext extends InstanceContext { protected $_userBindings; protected $_userChannels; /** * Initialize the UserContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the User resource under. * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($sid) .''; } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the userBindings */ protected function getUserBindings(): UserBindingList { if (!$this->_userBindings) { $this->_userBindings = new UserBindingList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userBindings; } /** * Access the userChannels */ protected function getUserChannels(): UserChannelList { if (!$this->_userChannels) { $this->_userChannels = new UserChannelList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userChannels; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/BindingPage.php 0000644 00000003061 15021223077 0015725 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BindingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return BindingInstance \Twilio\Rest\Chat\V2\Service\BindingInstance */ public function buildInstance(array $payload): BindingInstance { return new BindingInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.BindingPage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/BindingInstance.php 0000644 00000011352 15021223077 0016617 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $endpoint * @property string|null $identity * @property string|null $credentialSid * @property string $bindingType * @property string[]|null $messageTypes * @property string|null $url * @property array|null $links */ class BindingInstance extends InstanceResource { /** * Initialize the BindingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to delete the Binding resource from. * @param string $sid The SID of the Binding resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endpoint' => Values::array_get($payload, 'endpoint'), 'identity' => Values::array_get($payload, 'identity'), 'credentialSid' => Values::array_get($payload, 'credential_sid'), 'bindingType' => Values::array_get($payload, 'binding_type'), 'messageTypes' => Values::array_get($payload, 'message_types'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BindingContext Context for this BindingInstance */ protected function proxy(): BindingContext { if (!$this->context) { $this->context = new BindingContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the BindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.BindingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/RoleInstance.php 0000644 00000012146 15021223077 0016150 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $friendlyName * @property string $type * @property string[]|null $permissions * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Role resource under. * @param string $sid The SID of the Role resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoleContext Context for this RoleInstance */ protected function proxy(): RoleContext { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/ChannelPage.php 0000644 00000003061 15021223077 0015723 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ChannelInstance \Twilio\Rest\Chat\V2\Service\ChannelInstance */ public function buildInstance(array $payload): ChannelInstance { return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.ChannelPage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/RoleContext.php 0000644 00000007137 15021223077 0016034 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Role resource under. * @param string $sid The SID of the Role resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Roles/' . \rawurlencode($sid) .''; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of([ 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.RoleContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/ChannelList.php 0000644 00000016062 15021223077 0015767 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Channel resource under. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels'; } /** * Create the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Created ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ChannelInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'Type' => $options['type'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'CreatedBy' => $options['createdBy'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads ChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ChannelPage Page of ChannelInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ChannelPage { $options = new Values($options); $params = Values::of([ 'Type' => $options['type'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ChannelPage Page of ChannelInstance */ public function getPage(string $targetUrl): ChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelPage($this->version, $response, $this->solution); } /** * Constructs a ChannelContext * * @param string $sid The SID of the Channel resource to delete. This value can be either the `sid` or the `unique_name` of the Channel resource to delete. */ public function getContext( string $sid ): ChannelContext { return new ChannelContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.ChannelList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/RolePage.php 0000644 00000003037 15021223077 0015257 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RolePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RoleInstance \Twilio\Rest\Chat\V2\Service\RoleInstance */ public function buildInstance(array $payload): RoleInstance { return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.RolePage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/ChannelContext.php 0000644 00000016643 15021223077 0016505 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Chat\V2\Service\Channel\MemberList; use Twilio\Rest\Chat\V2\Service\Channel\InviteList; use Twilio\Rest\Chat\V2\Service\Channel\WebhookList; use Twilio\Rest\Chat\V2\Service\Channel\MessageList; /** * @property MemberList $members * @property InviteList $invites * @property WebhookList $webhooks * @property MessageList $messages * @method \Twilio\Rest\Chat\V2\Service\Channel\WebhookContext webhooks(string $sid) * @method \Twilio\Rest\Chat\V2\Service\Channel\MemberContext members(string $sid) * @method \Twilio\Rest\Chat\V2\Service\Channel\MessageContext messages(string $sid) * @method \Twilio\Rest\Chat\V2\Service\Channel\InviteContext invites(string $sid) */ class ChannelContext extends InstanceContext { protected $_members; protected $_invites; protected $_webhooks; protected $_messages; /** * Initialize the ChannelContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Channel resource under. * @param string $sid The SID of the Channel resource to delete. This value can be either the `sid` or the `unique_name` of the Channel resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($sid) .''; } /** * Delete the ChannelInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'CreatedBy' => $options['createdBy'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the members */ protected function getMembers(): MemberList { if (!$this->_members) { $this->_members = new MemberList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_members; } /** * Access the invites */ protected function getInvites(): InviteList { if (!$this->_invites) { $this->_invites = new InviteList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_invites; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_webhooks; } /** * Access the messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.ChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageInstance.php 0000644 00000013471 15021223077 0020205 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $attributes * @property string|null $serviceSid * @property string|null $to * @property string|null $channelSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $lastUpdatedBy * @property bool|null $wasEdited * @property string|null $from * @property string|null $body * @property int|null $index * @property string|null $type * @property array|null $media * @property string|null $url */ class MessageInstance extends InstanceResource { /** * Initialize the MessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Message resource under. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the new Message resource belongs to. This value can be the Channel resource's `sid` or `unique_name`. * @param string $sid The SID of the Message resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'to' => Values::array_get($payload, 'to'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'lastUpdatedBy' => Values::array_get($payload, 'last_updated_by'), 'wasEdited' => Values::array_get($payload, 'was_edited'), 'from' => Values::array_get($payload, 'from'), 'body' => Values::array_get($payload, 'body'), 'index' => Values::array_get($payload, 'index'), 'type' => Values::array_get($payload, 'type'), 'media' => Values::array_get($payload, 'media'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessageContext Context for this MessageInstance */ protected function proxy(): MessageContext { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookInstance.php 0000644 00000012162 15021223077 0020213 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $channelSid * @property string|null $type * @property string|null $url * @property array|null $configuration * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) with the Channel to create the Webhook resource under. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the new Channel Webhook resource belongs to. This value can be the Channel resource's `sid` or `unique_name`. * @param string $sid The SID of the Channel Webhook resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'type' => Values::array_get($payload, 'type'), 'url' => Values::array_get($payload, 'url'), 'configuration' => Values::array_get($payload, 'configuration'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WebhookContext Context for this WebhookInstance */ protected function proxy(): WebhookContext { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageContext.php 0000644 00000010624 15021223077 0020062 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class MessageContext extends InstanceContext { /** * Initialize the MessageContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Message resource under. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the new Message resource belongs to. This value can be the Channel resource's `sid` or `unique_name`. * @param string $sid The SID of the Message resource to delete. */ public function __construct( Version $version, $serviceSid, $channelSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Messages/' . \rawurlencode($sid) .''; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Body' => $options['body'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'LastUpdatedBy' => $options['lastUpdatedBy'], 'From' => $options['from'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberInstance.php 0000644 00000013206 15021223077 0020024 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $channelSid * @property string|null $serviceSid * @property string|null $identity * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $roleSid * @property int|null $lastConsumedMessageIndex * @property \DateTime|null $lastConsumptionTimestamp * @property string|null $url * @property string|null $attributes */ class MemberInstance extends InstanceResource { /** * Initialize the MemberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Member resource under. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the new Member resource belongs to. This value can be the Channel resource's `sid` or `unique_name`. * @param string $sid The SID of the Member resource to delete. This value can be either the Member's `sid` or its `identity` value. */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), 'url' => Values::array_get($payload, 'url'), 'attributes' => Values::array_get($payload, 'attributes'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MemberContext Context for this MemberInstance */ protected function proxy(): MemberContext { if (!$this->context) { $this->context = new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MemberInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { return $this->proxy()->fetch(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.MemberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberContext.php 0000644 00000011047 15021223077 0017705 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class MemberContext extends InstanceContext { /** * Initialize the MemberContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Member resource under. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the new Member resource belongs to. This value can be the Channel resource's `sid` or `unique_name`. * @param string $sid The SID of the Member resource to delete. This value can be either the Member's `sid` or its `identity` value. */ public function __construct( Version $version, $serviceSid, $channelSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members/' . \rawurlencode($sid) .''; } /** * Delete the MemberInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.MemberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookContext.php 0000644 00000010414 15021223077 0020071 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) with the Channel to create the Webhook resource under. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the new Channel Webhook resource belongs to. This value can be the Channel resource's `sid` or `unique_name`. * @param string $sid The SID of the Channel Webhook resource to delete. */ public function __construct( Version $version, $serviceSid, $channelSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Webhooks/' . \rawurlencode($sid) .''; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function ($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.RetryCount' => $options['configurationRetryCount'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.WebhookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberOptions.php 0000644 00000055472 15021223077 0017726 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. This parameter should only be used when recreating a Member from a backup/separate source. * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used when a Member is being recreated from a backup/separate source and where a Member was previously updated. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateMemberOptions Options builder */ public static function create( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE, \DateTime $lastConsumptionTimestamp = null, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateMemberOptions { return new CreateMemberOptions( $roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated, $attributes, $xTwilioWebhookEnabled ); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return DeleteMemberOptions Options builder */ public static function delete( string $xTwilioWebhookEnabled = Values::NONE ): DeleteMemberOptions { return new DeleteMemberOptions( $xTwilioWebhookEnabled ); } /** * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * @return ReadMemberOptions Options builder */ public static function read( array $identity = Values::ARRAY_NONE ): ReadMemberOptions { return new ReadMemberOptions( $identity ); } /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateMemberOptions Options builder */ public static function update( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE, \DateTime $lastConsumptionTimestamp = null, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateMemberOptions { return new UpdateMemberOptions( $roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated, $attributes, $xTwilioWebhookEnabled ); } } class CreateMemberOptions extends Options { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. This parameter should only be used when recreating a Member from a backup/separate source. * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used when a Member is being recreated from a backup/separate source and where a Member was previously updated. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE, \DateTime $lastConsumptionTimestamp = null, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. This parameter should only be used when recreating a Member from a backup/separate source. * * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. This parameter should only be used when recreating a Member from a backup/separate source. * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used when a Member is being recreated from a backup/separate source and where a Member was previously updated. * * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used when a Member is being recreated from a backup/separate source and where a Member was previously updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.CreateMemberOptions ' . $options . ']'; } } class DeleteMemberOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.DeleteMemberOptions ' . $options . ']'; } } class ReadMemberOptions extends Options { /** * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.ReadMemberOptions ' . $options . ']'; } } class UpdateMemberOptions extends Options { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE, \DateTime $lastConsumptionTimestamp = null, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateMemberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookOptions.php 0000644 00000040710 15021223077 0020102 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class WebhookOptions { /** * @param string $configurationUrl The URL of the webhook to call using the `configuration.method`. * @param string $configurationMethod * @param string[] $configurationFilters The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * @param string[] $configurationTriggers A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * @param string $configurationFlowSid The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` is `studio`. * @param int $configurationRetryCount The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * @return CreateWebhookOptions Options builder */ public static function create( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationRetryCount = Values::INT_NONE ): CreateWebhookOptions { return new CreateWebhookOptions( $configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationRetryCount ); } /** * @param string $configurationUrl The URL of the webhook to call using the `configuration.method`. * @param string $configurationMethod * @param string[] $configurationFilters The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * @param string[] $configurationTriggers A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * @param string $configurationFlowSid The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. * @param int $configurationRetryCount The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * @return UpdateWebhookOptions Options builder */ public static function update( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationRetryCount = Values::INT_NONE ): UpdateWebhookOptions { return new UpdateWebhookOptions( $configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationRetryCount ); } } class CreateWebhookOptions extends Options { /** * @param string $configurationUrl The URL of the webhook to call using the `configuration.method`. * @param string $configurationMethod * @param string[] $configurationFilters The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * @param string[] $configurationTriggers A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * @param string $configurationFlowSid The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` is `studio`. * @param int $configurationRetryCount The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. */ public function __construct( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationRetryCount = Values::INT_NONE ) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; } /** * The URL of the webhook to call using the `configuration.method`. * * @param string $configurationUrl The URL of the webhook to call using the `configuration.method`. * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * * @param string[] $configurationFilters The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * * @param string[] $configurationTriggers A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` is `studio`. * * @param string $configurationFlowSid The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` is `studio`. * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * * @param int $configurationRetryCount The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * @return $this Fluent Builder */ public function setConfigurationRetryCount(int $configurationRetryCount): self { $this->options['configurationRetryCount'] = $configurationRetryCount; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.CreateWebhookOptions ' . $options . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $configurationUrl The URL of the webhook to call using the `configuration.method`. * @param string $configurationMethod * @param string[] $configurationFilters The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * @param string[] $configurationTriggers A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * @param string $configurationFlowSid The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. * @param int $configurationRetryCount The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. */ public function __construct( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationRetryCount = Values::INT_NONE ) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; } /** * The URL of the webhook to call using the `configuration.method`. * * @param string $configurationUrl The URL of the webhook to call using the `configuration.method`. * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * * @param string[] $configurationFilters The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * * @param string[] $configurationTriggers A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. * * @param string $configurationFlowSid The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * * @param int $configurationRetryCount The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * @return $this Fluent Builder */ public function setConfigurationRetryCount(int $configurationRetryCount): self { $this->options['configurationRetryCount'] = $configurationRetryCount; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateWebhookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteList.php 0000644 00000016351 15021223077 0017226 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class InviteList extends ListResource { /** * Construct the InviteList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Invite resource under. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the new Invite resource belongs to. This value can be the Channel resource's `sid` or `unique_name`. */ public function __construct( Version $version, string $serviceSid, string $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites'; } /** * Create the InviteInstance * * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info. * @param array|Options $options Optional Arguments * @return InviteInstance Created InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): InviteInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads InviteInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InviteInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InvitePage Page of InviteInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InvitePage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InvitePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InviteInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InvitePage Page of InviteInstance */ public function getPage(string $targetUrl): InvitePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InvitePage($this->version, $response, $this->solution); } /** * Constructs a InviteContext * * @param string $sid The SID of the Invite resource to delete. */ public function getContext( string $sid ): InviteContext { return new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.InviteList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookPage.php 0000644 00000003140 15021223077 0017317 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WebhookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return WebhookInstance \Twilio\Rest\Chat\V2\Service\Channel\WebhookInstance */ public function buildInstance(array $payload): WebhookInstance { return new WebhookInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.WebhookPage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteContext.php 0000644 00000005606 15021223077 0017740 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class InviteContext extends InstanceContext { /** * Initialize the InviteContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Invite resource under. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the new Invite resource belongs to. This value can be the Channel resource's `sid` or `unique_name`. * @param string $sid The SID of the Invite resource to delete. */ public function __construct( Version $version, $serviceSid, $channelSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites/' . \rawurlencode($sid) .''; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.InviteContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteInstance.php 0000644 00000011462 15021223077 0020055 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $channelSid * @property string|null $serviceSid * @property string|null $identity * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $roleSid * @property string|null $createdBy * @property string|null $url */ class InviteInstance extends InstanceResource { /** * Initialize the InviteInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Invite resource under. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the new Invite resource belongs to. This value can be the Channel resource's `sid` or `unique_name`. * @param string $sid The SID of the Invite resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'createdBy' => Values::array_get($payload, 'created_by'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InviteContext Context for this InviteInstance */ protected function proxy(): InviteContext { if (!$this->context) { $this->context = new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.InviteInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookList.php 0000644 00000016310 15021223077 0017361 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) with the Channel to create the Webhook resource under. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the new Channel Webhook resource belongs to. This value can be the Channel resource's `sid` or `unique_name`. */ public function __construct( Version $version, string $serviceSid, string $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Webhooks'; } /** * Create the WebhookInstance * * @param string $type * @param array|Options $options Optional Arguments * @return WebhookInstance Created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function ($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.RetryCount' => $options['configurationRetryCount'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WebhookPage Page of WebhookInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WebhookPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WebhookPage Page of WebhookInstance */ public function getPage(string $targetUrl): WebhookPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Constructs a WebhookContext * * @param string $sid The SID of the Channel Webhook resource to delete. */ public function getContext( string $sid ): WebhookContext { return new WebhookContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.WebhookList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteOptions.php 0000644 00000007634 15021223077 0017752 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class InviteOptions { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member. * @return CreateInviteOptions Options builder */ public static function create( string $roleSid = Values::NONE ): CreateInviteOptions { return new CreateInviteOptions( $roleSid ); } /** * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * @return ReadInviteOptions Options builder */ public static function read( array $identity = Values::ARRAY_NONE ): ReadInviteOptions { return new ReadInviteOptions( $identity ); } } class CreateInviteOptions extends Options { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member. */ public function __construct( string $roleSid = Values::NONE ) { $this->options['roleSid'] = $roleSid; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member. * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.CreateInviteOptions ' . $options . ']'; } } class ReadInviteOptions extends Options { /** * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.ReadInviteOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessagePage.php 0000644 00000003140 15021223077 0017305 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MessageInstance \Twilio\Rest\Chat\V2\Service\Channel\MessageInstance */ public function buildInstance(array $payload): MessageInstance { return new MessageInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.MessagePage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberPage.php 0000644 00000003132 15021223077 0017131 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MemberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MemberInstance \Twilio\Rest\Chat\V2\Service\Channel\MemberInstance */ public function buildInstance(array $payload): MemberInstance { return new MemberInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.MemberPage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberList.php 0000644 00000017577 15021223077 0017212 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class MemberList extends ListResource { /** * Construct the MemberList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Member resource under. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the new Member resource belongs to. This value can be the Channel resource's `sid` or `unique_name`. */ public function __construct( Version $version, string $serviceSid, string $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members'; } /** * Create the MemberInstance * * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info. * @param array|Options $options Optional Arguments * @return MemberInstance Created MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads MemberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MemberInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MemberPage Page of MemberInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MemberPage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MemberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MemberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MemberPage Page of MemberInstance */ public function getPage(string $targetUrl): MemberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MemberPage($this->version, $response, $this->solution); } /** * Constructs a MemberContext * * @param string $sid The SID of the Member resource to delete. This value can be either the Member's `sid` or its `identity` value. */ public function getContext( string $sid ): MemberContext { return new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.MemberList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InvitePage.php 0000644 00000003132 15021223077 0017160 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class InvitePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return InviteInstance \Twilio\Rest\Chat\V2\Service\Channel\InviteInstance */ public function buildInstance(array $payload): InviteInstance { return new InviteInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.InvitePage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageOptions.php 0000644 00000047243 15021223077 0020100 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $from The [Identity](https://www.twilio.com/docs/chat/identity) of the new message's author. The default value is `system`. * @param string $attributes A valid JSON string that contains application-specific data. * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @param string $lastUpdatedBy The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * @param string $body The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @param string $mediaSid The SID of the [Media](https://www.twilio.com/docs/chat/rest/media) to attach to the new Message. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateMessageOptions Options builder */ public static function create( string $from = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $lastUpdatedBy = Values::NONE, string $body = Values::NONE, string $mediaSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateMessageOptions { return new CreateMessageOptions( $from, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy, $body, $mediaSid, $xTwilioWebhookEnabled ); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return DeleteMessageOptions Options builder */ public static function delete( string $xTwilioWebhookEnabled = Values::NONE ): DeleteMessageOptions { return new DeleteMessageOptions( $xTwilioWebhookEnabled ); } /** * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. * @return ReadMessageOptions Options builder */ public static function read( string $order = Values::NONE ): ReadMessageOptions { return new ReadMessageOptions( $order ); } /** * @param string $body The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @param string $attributes A valid JSON string that contains application-specific data. * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @param string $lastUpdatedBy The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * @param string $from The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateMessageOptions Options builder */ public static function update( string $body = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $lastUpdatedBy = Values::NONE, string $from = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateMessageOptions { return new UpdateMessageOptions( $body, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy, $from, $xTwilioWebhookEnabled ); } } class CreateMessageOptions extends Options { /** * @param string $from The [Identity](https://www.twilio.com/docs/chat/identity) of the new message's author. The default value is `system`. * @param string $attributes A valid JSON string that contains application-specific data. * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @param string $lastUpdatedBy The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * @param string $body The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @param string $mediaSid The SID of the [Media](https://www.twilio.com/docs/chat/rest/media) to attach to the new Message. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $from = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $lastUpdatedBy = Values::NONE, string $body = Values::NONE, string $mediaSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['from'] = $from; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; $this->options['body'] = $body; $this->options['mediaSid'] = $mediaSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the new message's author. The default value is `system`. * * @param string $from The [Identity](https://www.twilio.com/docs/chat/identity) of the new message's author. The default value is `system`. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * * @param string $lastUpdatedBy The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * @return $this Fluent Builder */ public function setLastUpdatedBy(string $lastUpdatedBy): self { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * * @param string $body The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The SID of the [Media](https://www.twilio.com/docs/chat/rest/media) to attach to the new Message. * * @param string $mediaSid The SID of the [Media](https://www.twilio.com/docs/chat/rest/media) to attach to the new Message. * @return $this Fluent Builder */ public function setMediaSid(string $mediaSid): self { $this->options['mediaSid'] = $mediaSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.CreateMessageOptions ' . $options . ']'; } } class DeleteMessageOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.DeleteMessageOptions ' . $options . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. */ public function __construct( string $order = Values::NONE ) { $this->options['order'] = $order; } /** * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. * * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.ReadMessageOptions ' . $options . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $body The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @param string $attributes A valid JSON string that contains application-specific data. * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @param string $lastUpdatedBy The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * @param string $from The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $body = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $lastUpdatedBy = Values::NONE, string $from = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; $this->options['from'] = $from; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * * @param string $body The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * * @param string $lastUpdatedBy The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * @return $this Fluent Builder */ public function setLastUpdatedBy(string $lastUpdatedBy): self { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. * * @param string $from The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateMessageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageList.php 0000644 00000016576 15021223077 0017365 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Message resource under. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/chat/channels) the new Message resource belongs to. This value can be the Channel resource's `sid` or `unique_name`. */ public function __construct( Version $version, string $serviceSid, string $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Messages'; } /** * Create the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'From' => $options['from'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'LastUpdatedBy' => $options['lastUpdatedBy'], 'Body' => $options['body'], 'MediaSid' => $options['mediaSid'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagePage Page of MessageInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagePage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagePage Page of MessageInstance */ public function getPage(string $targetUrl): MessagePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid The SID of the Message resource to delete. */ public function getContext( string $sid ): MessageContext { return new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.MessageList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/BindingList.php 0000644 00000013523 15021223077 0015770 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class BindingList extends ListResource { /** * Construct the BindingList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to delete the Binding resource from. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Bindings'; } /** * Reads BindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BindingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams BindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BindingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BindingPage Page of BindingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BindingPage { $options = new Values($options); $params = Values::of([ 'BindingType' => $options['bindingType'], 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BindingPage Page of BindingInstance */ public function getPage(string $targetUrl): BindingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BindingPage($this->version, $response, $this->solution); } /** * Constructs a BindingContext * * @param string $sid The SID of the Binding resource to delete. */ public function getContext( string $sid ): BindingContext { return new BindingContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.BindingList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/ChannelOptions.php 0000644 00000050452 15021223077 0016510 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the Channel resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $type * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used in cases where a Channel is being recreated from a backup/separate source and where a Message was previously updated. * @param string $createdBy The `identity` of the User that created the channel. Default is: `system`. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateChannelOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $type = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateChannelOptions { return new CreateChannelOptions( $friendlyName, $uniqueName, $attributes, $type, $dateCreated, $dateUpdated, $createdBy, $xTwilioWebhookEnabled ); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return DeleteChannelOptions Options builder */ public static function delete( string $xTwilioWebhookEnabled = Values::NONE ): DeleteChannelOptions { return new DeleteChannelOptions( $xTwilioWebhookEnabled ); } /** * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. * @return ReadChannelOptions Options builder */ public static function read( array $type = Values::ARRAY_NONE ): ReadChannelOptions { return new ReadChannelOptions( $type ); } /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 256 characters long. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. * @param string $attributes A valid JSON string that contains application-specific data. * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @param string $createdBy The `identity` of the User that created the channel. Default is: `system`. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateChannelOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateChannelOptions { return new UpdateChannelOptions( $friendlyName, $uniqueName, $attributes, $dateCreated, $dateUpdated, $createdBy, $xTwilioWebhookEnabled ); } } class CreateChannelOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the Channel resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $type * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used in cases where a Channel is being recreated from a backup/separate source and where a Message was previously updated. * @param string $createdBy The `identity` of the User that created the channel. Default is: `system`. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $type = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the Channel resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the Channel resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * @param string $type * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used in cases where a Channel is being recreated from a backup/separate source and where a Message was previously updated. * * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used in cases where a Channel is being recreated from a backup/separate source and where a Message was previously updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The `identity` of the User that created the channel. Default is: `system`. * * @param string $createdBy The `identity` of the User that created the channel. Default is: `system`. * @return $this Fluent Builder */ public function setCreatedBy(string $createdBy): self { $this->options['createdBy'] = $createdBy; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.CreateChannelOptions ' . $options . ']'; } } class DeleteChannelOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.DeleteChannelOptions ' . $options . ']'; } } class ReadChannelOptions extends Options { /** * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. */ public function __construct( array $type = Values::ARRAY_NONE ) { $this->options['type'] = $type; } /** * The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. * * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. * @return $this Fluent Builder */ public function setType(array $type): self { $this->options['type'] = $type; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.ReadChannelOptions ' . $options . ']'; } } class UpdateChannelOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 256 characters long. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. * @param string $attributes A valid JSON string that contains application-specific data. * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @param string $createdBy The `identity` of the User that created the channel. Default is: `system`. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * A descriptive string that you create to describe the resource. It can be up to 256 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The `identity` of the User that created the channel. Default is: `system`. * * @param string $createdBy The `identity` of the User that created the channel. Default is: `system`. * @return $this Fluent Builder */ public function setCreatedBy(string $createdBy): self { $this->options['createdBy'] = $createdBy; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/ChannelInstance.php 0000644 00000014531 15021223077 0016617 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Chat\V2\Service\Channel\MemberList; use Twilio\Rest\Chat\V2\Service\Channel\InviteList; use Twilio\Rest\Chat\V2\Service\Channel\WebhookList; use Twilio\Rest\Chat\V2\Service\Channel\MessageList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $friendlyName * @property string|null $uniqueName * @property string|null $attributes * @property string $type * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy * @property int|null $membersCount * @property int|null $messagesCount * @property string|null $url * @property array|null $links */ class ChannelInstance extends InstanceResource { protected $_members; protected $_invites; protected $_webhooks; protected $_messages; /** * Initialize the ChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Channel resource under. * @param string $sid The SID of the Channel resource to delete. This value can be either the `sid` or the `unique_name` of the Channel resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'type' => Values::array_get($payload, 'type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'membersCount' => Values::array_get($payload, 'members_count'), 'messagesCount' => Values::array_get($payload, 'messages_count'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ChannelContext Context for this ChannelInstance */ protected function proxy(): ChannelContext { if (!$this->context) { $this->context = new ChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ChannelInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { return $this->proxy()->fetch(); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { return $this->proxy()->update($options); } /** * Access the members */ protected function getMembers(): MemberList { return $this->proxy()->members; } /** * Access the invites */ protected function getInvites(): InviteList { return $this->proxy()->invites; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.ChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/UserPage.php 0000644 00000003037 15021223077 0015274 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserInstance \Twilio\Rest\Chat\V2\Service\UserInstance */ public function buildInstance(array $payload): UserInstance { return new UserInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.UserPage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/BindingContext.php 0000644 00000005033 15021223077 0016476 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class BindingContext extends InstanceContext { /** * Initialize the BindingContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to delete the Binding resource from. * @param string $sid The SID of the Binding resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Bindings/' . \rawurlencode($sid) .''; } /** * Delete the BindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new BindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.BindingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingList.php 0000644 00000014330 15021223077 0017542 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserBindingList extends ListResource { /** * Construct the UserBindingList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to delete the User Binding resource from. * @param string $userSid The SID of the [User](https://www.twilio.com/docs/chat/rest/user-resource) with the User Binding resources to delete. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. */ public function __construct( Version $version, string $serviceSid, string $userSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Bindings'; } /** * Reads UserBindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserBindingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams UserBindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserBindingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserBindingPage Page of UserBindingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserBindingPage { $options = new Values($options); $params = Values::of([ 'BindingType' => $options['bindingType'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserBindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserBindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserBindingPage Page of UserBindingInstance */ public function getPage(string $targetUrl): UserBindingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserBindingPage($this->version, $response, $this->solution); } /** * Constructs a UserBindingContext * * @param string $sid The SID of the User Binding resource to delete. */ public function getContext( string $sid ): UserBindingContext { return new UserBindingContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.UserBindingList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelOptions.php 0000644 00000014115 15021223077 0020261 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Options; use Twilio\Values; abstract class UserChannelOptions { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return DeleteUserChannelOptions Options builder */ public static function delete( string $xTwilioWebhookEnabled = Values::NONE ): DeleteUserChannelOptions { return new DeleteUserChannelOptions( $xTwilioWebhookEnabled ); } /** * @param string $notificationLevel * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * @return UpdateUserChannelOptions Options builder */ public static function update( string $notificationLevel = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE, \DateTime $lastConsumptionTimestamp = null ): UpdateUserChannelOptions { return new UpdateUserChannelOptions( $notificationLevel, $lastConsumedMessageIndex, $lastConsumptionTimestamp ); } } class DeleteUserChannelOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.DeleteUserChannelOptions ' . $options . ']'; } } class UpdateUserChannelOptions extends Options { /** * @param string $notificationLevel * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). */ public function __construct( string $notificationLevel = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE, \DateTime $lastConsumptionTimestamp = null ) { $this->options['notificationLevel'] = $notificationLevel; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; } /** * @param string $notificationLevel * @return $this Fluent Builder */ public function setNotificationLevel(string $notificationLevel): self { $this->options['notificationLevel'] = $notificationLevel; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. * * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateUserChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingInstance.php 0000644 00000012221 15021223077 0020370 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $endpoint * @property string|null $identity * @property string|null $userSid * @property string|null $credentialSid * @property string $bindingType * @property string[]|null $messageTypes * @property string|null $url */ class UserBindingInstance extends InstanceResource { /** * Initialize the UserBindingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to delete the User Binding resource from. * @param string $userSid The SID of the [User](https://www.twilio.com/docs/chat/rest/user-resource) with the User Binding resources to delete. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * @param string $sid The SID of the User Binding resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $userSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endpoint' => Values::array_get($payload, 'endpoint'), 'identity' => Values::array_get($payload, 'identity'), 'userSid' => Values::array_get($payload, 'user_sid'), 'credentialSid' => Values::array_get($payload, 'credential_sid'), 'bindingType' => Values::array_get($payload, 'binding_type'), 'messageTypes' => Values::array_get($payload, 'message_types'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserBindingContext Context for this UserBindingInstance */ protected function proxy(): UserBindingContext { if (!$this->context) { $this->context = new UserBindingContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UserBindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserBindingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserBindingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelPage.php 0000644 00000003157 15021223077 0017506 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserChannelInstance \Twilio\Rest\Chat\V2\Service\User\UserChannelInstance */ public function buildInstance(array $payload): UserChannelInstance { return new UserChannelInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.UserChannelPage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelContext.php 0000644 00000010324 15021223077 0020250 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class UserChannelContext extends InstanceContext { /** * Initialize the UserChannelContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to read the resources from. * @param string $userSid The SID of the [User](https://www.twilio.com/docs/api/chat/rest/users) to read the User Channel resources from. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the resource belongs to. */ public function __construct( Version $version, $serviceSid, $userSid, $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Channels/' . \rawurlencode($channelSid) .''; } /** * Delete the UserChannelInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the UserChannelInstance * * @return UserChannelInstance Fetched UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserChannelInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } /** * Update the UserChannelInstance * * @param array|Options $options Optional Arguments * @return UserChannelInstance Updated UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserChannelInstance { $options = new Values($options); $data = Values::of([ 'NotificationLevel' => $options['notificationLevel'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelInstance.php 0000644 00000012674 15021223077 0020402 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $channelSid * @property string|null $userSid * @property string|null $memberSid * @property string $status * @property int|null $lastConsumedMessageIndex * @property int|null $unreadMessagesCount * @property array|null $links * @property string|null $url * @property string $notificationLevel */ class UserChannelInstance extends InstanceResource { /** * Initialize the UserChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to read the resources from. * @param string $userSid The SID of the [User](https://www.twilio.com/docs/api/chat/rest/users) to read the User Channel resources from. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the resource belongs to. */ public function __construct(Version $version, array $payload, string $serviceSid, string $userSid, string $channelSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'userSid' => Values::array_get($payload, 'user_sid'), 'memberSid' => Values::array_get($payload, 'member_sid'), 'status' => Values::array_get($payload, 'status'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), 'notificationLevel' => Values::array_get($payload, 'notification_level'), ]; $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid ?: $this->properties['channelSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserChannelContext Context for this UserChannelInstance */ protected function proxy(): UserChannelContext { if (!$this->context) { $this->context = new UserChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } return $this->context; } /** * Delete the UserChannelInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the UserChannelInstance * * @return UserChannelInstance Fetched UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserChannelInstance { return $this->proxy()->fetch(); } /** * Update the UserChannelInstance * * @param array|Options $options Optional Arguments * @return UserChannelInstance Updated UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserChannelInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingContext.php 0000644 00000005754 15021223077 0020265 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class UserBindingContext extends InstanceContext { /** * Initialize the UserBindingContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to delete the User Binding resource from. * @param string $userSid The SID of the [User](https://www.twilio.com/docs/chat/rest/user-resource) with the User Binding resources to delete. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * @param string $sid The SID of the User Binding resource to delete. */ public function __construct( Version $version, $serviceSid, $userSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Bindings/' . \rawurlencode($sid) .''; } /** * Delete the UserBindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserBindingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserBindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserBindingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingOptions.php 0000644 00000005123 15021223077 0020262 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Options; use Twilio\Values; abstract class UserBindingOptions { /** * @param string $bindingType The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * @return ReadUserBindingOptions Options builder */ public static function read( array $bindingType = Values::ARRAY_NONE ): ReadUserBindingOptions { return new ReadUserBindingOptions( $bindingType ); } } class ReadUserBindingOptions extends Options { /** * @param string $bindingType The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. */ public function __construct( array $bindingType = Values::ARRAY_NONE ) { $this->options['bindingType'] = $bindingType; } /** * The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * * @param string $bindingType The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * @return $this Fluent Builder */ public function setBindingType(array $bindingType): self { $this->options['bindingType'] = $bindingType; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.ReadUserBindingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelList.php 0000644 00000013505 15021223077 0017543 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserChannelList extends ListResource { /** * Construct the UserChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to read the resources from. * @param string $userSid The SID of the [User](https://www.twilio.com/docs/api/chat/rest/users) to read the User Channel resources from. */ public function __construct( Version $version, string $serviceSid, string $userSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Channels'; } /** * Reads UserChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserChannelInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserChannelPage Page of UserChannelInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserChannelPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserChannelPage Page of UserChannelInstance */ public function getPage(string $targetUrl): UserChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserChannelPage($this->version, $response, $this->solution); } /** * Constructs a UserChannelContext * * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the resource belongs to. */ public function getContext( string $channelSid ): UserChannelContext { return new UserChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $channelSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.UserChannelList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingPage.php 0000644 00000003157 15021223077 0017510 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserBindingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserBindingInstance \Twilio\Rest\Chat\V2\Service\User\UserBindingInstance */ public function buildInstance(array $payload): UserBindingInstance { return new UserBindingInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.UserBindingPage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/UserList.php 0000644 00000015344 15021223077 0015337 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the User resource under. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users'; } /** * Create the UserInstance * * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). This value is often a username or email address. See the Identity documentation for more info. * @param array|Options $options Optional Arguments * @return UserInstance Created UserInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads UserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserPage Page of UserInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserPage Page of UserInstance */ public function getPage(string $targetUrl): UserPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserPage($this->version, $response, $this->solution); } /** * Constructs a UserContext * * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. */ public function getContext( string $sid ): UserContext { return new UserContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.UserList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/RoleList.php 0000644 00000015021 15021223077 0015312 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class RoleList extends ListResource { /** * Construct the RoleList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the Role resource under. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $type * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type`. * @return RoleInstance Created RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $permission): RoleInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads RoleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoleInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RolePage Page of RoleInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RolePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RolePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RolePage Page of RoleInstance */ public function getPage(string $targetUrl): RolePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RolePage($this->version, $response, $this->solution); } /** * Constructs a RoleContext * * @param string $sid The SID of the Role resource to delete. */ public function getContext( string $sid ): RoleContext { return new RoleContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.RoleList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/UserInstance.php 0000644 00000013522 15021223077 0016164 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Chat\V2\Service\User\UserBindingList; use Twilio\Rest\Chat\V2\Service\User\UserChannelList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $attributes * @property string|null $friendlyName * @property string|null $roleSid * @property string|null $identity * @property bool|null $isOnline * @property bool|null $isNotifiable * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property int|null $joinedChannelsCount * @property array|null $links * @property string|null $url */ class UserInstance extends InstanceResource { protected $_userBindings; protected $_userChannels; /** * Initialize the UserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to create the User resource under. * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'identity' => Values::array_get($payload, 'identity'), 'isOnline' => Values::array_get($payload, 'is_online'), 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'joinedChannelsCount' => Values::array_get($payload, 'joined_channels_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserContext Context for this UserInstance */ protected function proxy(): UserContext { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { return $this->proxy()->update($options); } /** * Access the userBindings */ protected function getUserBindings(): UserBindingList { return $this->proxy()->userBindings; } /** * Access the userChannels */ protected function getUserChannels(): UserChannelList { return $this->proxy()->userChannels; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/BindingOptions.php 0000644 00000007404 15021223077 0016511 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Options; use Twilio\Values; abstract class BindingOptions { /** * @param string $bindingType The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * @return ReadBindingOptions Options builder */ public static function read( array $bindingType = Values::ARRAY_NONE, array $identity = Values::ARRAY_NONE ): ReadBindingOptions { return new ReadBindingOptions( $bindingType, $identity ); } } class ReadBindingOptions extends Options { /** * @param string $bindingType The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. */ public function __construct( array $bindingType = Values::ARRAY_NONE, array $identity = Values::ARRAY_NONE ) { $this->options['bindingType'] = $bindingType; $this->options['identity'] = $identity; } /** * The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * * @param string $bindingType The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * @return $this Fluent Builder */ public function setBindingType(array $bindingType): self { $this->options['bindingType'] = $bindingType; return $this; } /** * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.ReadBindingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/ServiceInstance.php 0000644 00000016246 15021223077 0015254 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Chat\V2\Service\ChannelList; use Twilio\Rest\Chat\V2\Service\BindingList; use Twilio\Rest\Chat\V2\Service\RoleList; use Twilio\Rest\Chat\V2\Service\UserList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $defaultServiceRoleSid * @property string|null $defaultChannelRoleSid * @property string|null $defaultChannelCreatorRoleSid * @property bool|null $readStatusEnabled * @property bool|null $reachabilityEnabled * @property int|null $typingIndicatorTimeout * @property int|null $consumptionReportInterval * @property array|null $limits * @property string|null $preWebhookUrl * @property string|null $postWebhookUrl * @property string|null $webhookMethod * @property string[]|null $webhookFilters * @property int|null $preWebhookRetryCount * @property int|null $postWebhookRetryCount * @property array|null $notifications * @property array|null $media * @property string|null $url * @property array|null $links */ class ServiceInstance extends InstanceResource { protected $_channels; protected $_bindings; protected $_roles; protected $_users; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Service resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'defaultServiceRoleSid' => Values::array_get($payload, 'default_service_role_sid'), 'defaultChannelRoleSid' => Values::array_get($payload, 'default_channel_role_sid'), 'defaultChannelCreatorRoleSid' => Values::array_get($payload, 'default_channel_creator_role_sid'), 'readStatusEnabled' => Values::array_get($payload, 'read_status_enabled'), 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), 'typingIndicatorTimeout' => Values::array_get($payload, 'typing_indicator_timeout'), 'consumptionReportInterval' => Values::array_get($payload, 'consumption_report_interval'), 'limits' => Values::array_get($payload, 'limits'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), 'preWebhookRetryCount' => Values::array_get($payload, 'pre_webhook_retry_count'), 'postWebhookRetryCount' => Values::array_get($payload, 'post_webhook_retry_count'), 'notifications' => Values::array_get($payload, 'notifications'), 'media' => Values::array_get($payload, 'media'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the channels */ protected function getChannels(): ChannelList { return $this->proxy()->channels; } /** * Access the bindings */ protected function getBindings(): BindingList { return $this->proxy()->bindings; } /** * Access the roles */ protected function getRoles(): RoleList { return $this->proxy()->roles; } /** * Access the users */ protected function getUsers(): UserList { return $this->proxy()->users; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/ServiceList.php 0000644 00000013310 15021223077 0014410 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName A descriptive string that you create to describe the new resource. * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): ServiceInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The SID of the Service resource to delete. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.ServiceList]'; } } sdk/src/Twilio/Rest/Chat/V2/ServiceOptions.php 0000644 00000113656 15021223077 0015146 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param string $friendlyName A descriptive string that you create to describe the resource. * @param string $defaultServiceRoleSid The service role assigned to users when they are added to the service. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * @param string $defaultChannelRoleSid The channel role assigned to users when they are added to a channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * @param string $defaultChannelCreatorRoleSid The channel role assigned to a channel creator when they join a new channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * @param bool $readStatusEnabled Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * @param bool $reachabilityEnabled Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * @param int $typingIndicatorTimeout How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * @param int $consumptionReportInterval DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * @param bool $notificationsNewMessageEnabled Whether to send a notification when a new message is added to a channel. The default is `false`. * @param string $notificationsNewMessageTemplate The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * @param string $notificationsNewMessageSound The name of the sound to play when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * @param bool $notificationsNewMessageBadgeCountEnabled Whether the new message badge is enabled. The default is `false`. * @param bool $notificationsAddedToChannelEnabled Whether to send a notification when a member is added to a channel. The default is `false`. * @param string $notificationsAddedToChannelTemplate The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * @param string $notificationsAddedToChannelSound The name of the sound to play when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * @param bool $notificationsRemovedFromChannelEnabled Whether to send a notification to a user when they are removed from a channel. The default is `false`. * @param string $notificationsRemovedFromChannelTemplate The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * @param string $notificationsRemovedFromChannelSound The name of the sound to play to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * @param bool $notificationsInvitedToChannelEnabled Whether to send a notification when a user is invited to a channel. The default is `false`. * @param string $notificationsInvitedToChannelTemplate The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * @param string $notificationsInvitedToChannelSound The name of the sound to play when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * @param string $preWebhookUrl The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @param string $postWebhookUrl The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @param string $webhookMethod The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @param string[] $webhookFilters The list of webhook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @param int $limitsChannelMembers The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * @param int $limitsUserChannels The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. * @param string $mediaCompatibilityMessage The message to send when a media message has no text. Can be used as placeholder message. * @param int $preWebhookRetryCount The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried. * @param int $postWebhookRetryCount The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried. * @param bool $notificationsLogEnabled Whether to log notifications. The default is `false`. * @return UpdateServiceOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $defaultServiceRoleSid = Values::NONE, string $defaultChannelRoleSid = Values::NONE, string $defaultChannelCreatorRoleSid = Values::NONE, bool $readStatusEnabled = Values::BOOL_NONE, bool $reachabilityEnabled = Values::BOOL_NONE, int $typingIndicatorTimeout = Values::INT_NONE, int $consumptionReportInterval = Values::INT_NONE, bool $notificationsNewMessageEnabled = Values::BOOL_NONE, string $notificationsNewMessageTemplate = Values::NONE, string $notificationsNewMessageSound = Values::NONE, bool $notificationsNewMessageBadgeCountEnabled = Values::BOOL_NONE, bool $notificationsAddedToChannelEnabled = Values::BOOL_NONE, string $notificationsAddedToChannelTemplate = Values::NONE, string $notificationsAddedToChannelSound = Values::NONE, bool $notificationsRemovedFromChannelEnabled = Values::BOOL_NONE, string $notificationsRemovedFromChannelTemplate = Values::NONE, string $notificationsRemovedFromChannelSound = Values::NONE, bool $notificationsInvitedToChannelEnabled = Values::BOOL_NONE, string $notificationsInvitedToChannelTemplate = Values::NONE, string $notificationsInvitedToChannelSound = Values::NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $webhookMethod = Values::NONE, array $webhookFilters = Values::ARRAY_NONE, int $limitsChannelMembers = Values::INT_NONE, int $limitsUserChannels = Values::INT_NONE, string $mediaCompatibilityMessage = Values::NONE, int $preWebhookRetryCount = Values::INT_NONE, int $postWebhookRetryCount = Values::INT_NONE, bool $notificationsLogEnabled = Values::BOOL_NONE ): UpdateServiceOptions { return new UpdateServiceOptions( $friendlyName, $defaultServiceRoleSid, $defaultChannelRoleSid, $defaultChannelCreatorRoleSid, $readStatusEnabled, $reachabilityEnabled, $typingIndicatorTimeout, $consumptionReportInterval, $notificationsNewMessageEnabled, $notificationsNewMessageTemplate, $notificationsNewMessageSound, $notificationsNewMessageBadgeCountEnabled, $notificationsAddedToChannelEnabled, $notificationsAddedToChannelTemplate, $notificationsAddedToChannelSound, $notificationsRemovedFromChannelEnabled, $notificationsRemovedFromChannelTemplate, $notificationsRemovedFromChannelSound, $notificationsInvitedToChannelEnabled, $notificationsInvitedToChannelTemplate, $notificationsInvitedToChannelSound, $preWebhookUrl, $postWebhookUrl, $webhookMethod, $webhookFilters, $limitsChannelMembers, $limitsUserChannels, $mediaCompatibilityMessage, $preWebhookRetryCount, $postWebhookRetryCount, $notificationsLogEnabled ); } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. * @param string $defaultServiceRoleSid The service role assigned to users when they are added to the service. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * @param string $defaultChannelRoleSid The channel role assigned to users when they are added to a channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * @param string $defaultChannelCreatorRoleSid The channel role assigned to a channel creator when they join a new channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * @param bool $readStatusEnabled Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * @param bool $reachabilityEnabled Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * @param int $typingIndicatorTimeout How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * @param int $consumptionReportInterval DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * @param bool $notificationsNewMessageEnabled Whether to send a notification when a new message is added to a channel. The default is `false`. * @param string $notificationsNewMessageTemplate The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * @param string $notificationsNewMessageSound The name of the sound to play when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * @param bool $notificationsNewMessageBadgeCountEnabled Whether the new message badge is enabled. The default is `false`. * @param bool $notificationsAddedToChannelEnabled Whether to send a notification when a member is added to a channel. The default is `false`. * @param string $notificationsAddedToChannelTemplate The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * @param string $notificationsAddedToChannelSound The name of the sound to play when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * @param bool $notificationsRemovedFromChannelEnabled Whether to send a notification to a user when they are removed from a channel. The default is `false`. * @param string $notificationsRemovedFromChannelTemplate The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * @param string $notificationsRemovedFromChannelSound The name of the sound to play to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * @param bool $notificationsInvitedToChannelEnabled Whether to send a notification when a user is invited to a channel. The default is `false`. * @param string $notificationsInvitedToChannelTemplate The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * @param string $notificationsInvitedToChannelSound The name of the sound to play when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * @param string $preWebhookUrl The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @param string $postWebhookUrl The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @param string $webhookMethod The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @param string[] $webhookFilters The list of webhook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @param int $limitsChannelMembers The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * @param int $limitsUserChannels The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. * @param string $mediaCompatibilityMessage The message to send when a media message has no text. Can be used as placeholder message. * @param int $preWebhookRetryCount The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried. * @param int $postWebhookRetryCount The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried. * @param bool $notificationsLogEnabled Whether to log notifications. The default is `false`. */ public function __construct( string $friendlyName = Values::NONE, string $defaultServiceRoleSid = Values::NONE, string $defaultChannelRoleSid = Values::NONE, string $defaultChannelCreatorRoleSid = Values::NONE, bool $readStatusEnabled = Values::BOOL_NONE, bool $reachabilityEnabled = Values::BOOL_NONE, int $typingIndicatorTimeout = Values::INT_NONE, int $consumptionReportInterval = Values::INT_NONE, bool $notificationsNewMessageEnabled = Values::BOOL_NONE, string $notificationsNewMessageTemplate = Values::NONE, string $notificationsNewMessageSound = Values::NONE, bool $notificationsNewMessageBadgeCountEnabled = Values::BOOL_NONE, bool $notificationsAddedToChannelEnabled = Values::BOOL_NONE, string $notificationsAddedToChannelTemplate = Values::NONE, string $notificationsAddedToChannelSound = Values::NONE, bool $notificationsRemovedFromChannelEnabled = Values::BOOL_NONE, string $notificationsRemovedFromChannelTemplate = Values::NONE, string $notificationsRemovedFromChannelSound = Values::NONE, bool $notificationsInvitedToChannelEnabled = Values::BOOL_NONE, string $notificationsInvitedToChannelTemplate = Values::NONE, string $notificationsInvitedToChannelSound = Values::NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $webhookMethod = Values::NONE, array $webhookFilters = Values::ARRAY_NONE, int $limitsChannelMembers = Values::INT_NONE, int $limitsUserChannels = Values::INT_NONE, string $mediaCompatibilityMessage = Values::NONE, int $preWebhookRetryCount = Values::INT_NONE, int $postWebhookRetryCount = Values::INT_NONE, bool $notificationsLogEnabled = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; $this->options['readStatusEnabled'] = $readStatusEnabled; $this->options['reachabilityEnabled'] = $reachabilityEnabled; $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; $this->options['consumptionReportInterval'] = $consumptionReportInterval; $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; } /** * A descriptive string that you create to describe the resource. * * @param string $friendlyName A descriptive string that you create to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The service role assigned to users when they are added to the service. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * * @param string $defaultServiceRoleSid The service role assigned to users when they are added to the service. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * @return $this Fluent Builder */ public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * The channel role assigned to users when they are added to a channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * * @param string $defaultChannelRoleSid The channel role assigned to users when they are added to a channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * @return $this Fluent Builder */ public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * The channel role assigned to a channel creator when they join a new channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * * @param string $defaultChannelCreatorRoleSid The channel role assigned to a channel creator when they join a new channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * * @param bool $readStatusEnabled Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * @return $this Fluent Builder */ public function setReadStatusEnabled(bool $readStatusEnabled): self { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * * @param bool $reachabilityEnabled Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * @return $this Fluent Builder */ public function setReachabilityEnabled(bool $reachabilityEnabled): self { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * * @param int $typingIndicatorTimeout How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * @return $this Fluent Builder */ public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * * @param int $consumptionReportInterval DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * @return $this Fluent Builder */ public function setConsumptionReportInterval(int $consumptionReportInterval): self { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * Whether to send a notification when a new message is added to a channel. The default is `false`. * * @param bool $notificationsNewMessageEnabled Whether to send a notification when a new message is added to a channel. The default is `false`. * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * * @param string $notificationsNewMessageTemplate The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * The name of the sound to play when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * * @param string $notificationsNewMessageSound The name of the sound to play when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsNewMessageSound(string $notificationsNewMessageSound): self { $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; return $this; } /** * Whether the new message badge is enabled. The default is `false`. * * @param bool $notificationsNewMessageBadgeCountEnabled Whether the new message badge is enabled. The default is `false`. * @return $this Fluent Builder */ public function setNotificationsNewMessageBadgeCountEnabled(bool $notificationsNewMessageBadgeCountEnabled): self { $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; return $this; } /** * Whether to send a notification when a member is added to a channel. The default is `false`. * * @param bool $notificationsAddedToChannelEnabled Whether to send a notification when a member is added to a channel. The default is `false`. * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * * @param string $notificationsAddedToChannelTemplate The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * The name of the sound to play when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * * @param string $notificationsAddedToChannelSound The name of the sound to play when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsAddedToChannelSound(string $notificationsAddedToChannelSound): self { $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; return $this; } /** * Whether to send a notification to a user when they are removed from a channel. The default is `false`. * * @param bool $notificationsRemovedFromChannelEnabled Whether to send a notification to a user when they are removed from a channel. The default is `false`. * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * * @param string $notificationsRemovedFromChannelTemplate The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * The name of the sound to play to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * * @param string $notificationsRemovedFromChannelSound The name of the sound to play to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelSound(string $notificationsRemovedFromChannelSound): self { $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; return $this; } /** * Whether to send a notification when a user is invited to a channel. The default is `false`. * * @param bool $notificationsInvitedToChannelEnabled Whether to send a notification when a user is invited to a channel. The default is `false`. * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * * @param string $notificationsInvitedToChannelTemplate The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * The name of the sound to play when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * * @param string $notificationsInvitedToChannelSound The name of the sound to play when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelSound(string $notificationsInvitedToChannelSound): self { $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; return $this; } /** * The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $preWebhookUrl The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @return $this Fluent Builder */ public function setPreWebhookUrl(string $preWebhookUrl): self { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $postWebhookUrl The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @return $this Fluent Builder */ public function setPostWebhookUrl(string $postWebhookUrl): self { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $webhookMethod The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @return $this Fluent Builder */ public function setWebhookMethod(string $webhookMethod): self { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * The list of webhook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string[] $webhookFilters The list of webhook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @return $this Fluent Builder */ public function setWebhookFilters(array $webhookFilters): self { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * * @param int $limitsChannelMembers The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * @return $this Fluent Builder */ public function setLimitsChannelMembers(int $limitsChannelMembers): self { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. * * @param int $limitsUserChannels The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. * @return $this Fluent Builder */ public function setLimitsUserChannels(int $limitsUserChannels): self { $this->options['limitsUserChannels'] = $limitsUserChannels; return $this; } /** * The message to send when a media message has no text. Can be used as placeholder message. * * @param string $mediaCompatibilityMessage The message to send when a media message has no text. Can be used as placeholder message. * @return $this Fluent Builder */ public function setMediaCompatibilityMessage(string $mediaCompatibilityMessage): self { $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; return $this; } /** * The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried. * * @param int $preWebhookRetryCount The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried. * @return $this Fluent Builder */ public function setPreWebhookRetryCount(int $preWebhookRetryCount): self { $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; return $this; } /** * The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried. * * @param int $postWebhookRetryCount The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried. * @return $this Fluent Builder */ public function setPostWebhookRetryCount(int $postWebhookRetryCount): self { $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; return $this; } /** * Whether to log notifications. The default is `false`. * * @param bool $notificationsLogEnabled Whether to log notifications. The default is `false`. * @return $this Fluent Builder */ public function setNotificationsLogEnabled(bool $notificationsLogEnabled): self { $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/.openapi-generator-ignore 0000644 00000002020 15021223077 0016340 0 ustar 00 # OpenAPI Generator Ignore # Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): #foo/*/qux # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux # You can recursively match patterns against a directory, file or extension with a double asterisk (**): #foo/**/qux # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux # You can also negate patterns with an exclamation (!). # For example, you can ignore all files in a docs folder with the file extension .md: #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md sdk/src/Twilio/Rest/Chat/V2/CredentialContext.php 0000644 00000006476 15021223077 0015612 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Credential resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($sid) .''; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.CredentialContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/CredentialOptions.php 0000644 00000033635 15021223077 0015616 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return CreateCredentialOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ): CreateCredentialOptions { return new CreateCredentialOptions( $friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret ); } /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return UpdateCredentialOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ): UpdateCredentialOptions { return new UpdateCredentialOptions( $friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret ); } } class CreateCredentialOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. */ public function __construct( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.CreateCredentialOptions ' . $options . ']'; } } class UpdateCredentialOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. */ public function __construct( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V2.UpdateCredentialOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V2/CredentialInstance.php 0000644 00000010724 15021223077 0015721 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string $type * @property string|null $sandbox * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Credential resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'sandbox' => Values::array_get($payload, 'sandbox'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialContext Context for this CredentialInstance */ protected function proxy(): CredentialContext { if (!$this->context) { $this->context = new CredentialContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/ServiceContext.php 0000644 00000022257 15021223077 0015133 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Chat\V2\Service\ChannelList; use Twilio\Rest\Chat\V2\Service\BindingList; use Twilio\Rest\Chat\V2\Service\RoleList; use Twilio\Rest\Chat\V2\Service\UserList; /** * @property ChannelList $channels * @property BindingList $bindings * @property RoleList $roles * @property UserList $users * @method \Twilio\Rest\Chat\V2\Service\BindingContext bindings(string $sid) * @method \Twilio\Rest\Chat\V2\Service\ChannelContext channels(string $sid) * @method \Twilio\Rest\Chat\V2\Service\RoleContext roles(string $sid) * @method \Twilio\Rest\Chat\V2\Service\UserContext users(string $sid) */ class ServiceContext extends InstanceContext { protected $_channels; protected $_bindings; protected $_roles; protected $_users; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Service resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) .''; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DefaultServiceRoleSid' => $options['defaultServiceRoleSid'], 'DefaultChannelRoleSid' => $options['defaultChannelRoleSid'], 'DefaultChannelCreatorRoleSid' => $options['defaultChannelCreatorRoleSid'], 'ReadStatusEnabled' => Serialize::booleanToString($options['readStatusEnabled']), 'ReachabilityEnabled' => Serialize::booleanToString($options['reachabilityEnabled']), 'TypingIndicatorTimeout' => $options['typingIndicatorTimeout'], 'ConsumptionReportInterval' => $options['consumptionReportInterval'], 'Notifications.NewMessage.Enabled' => Serialize::booleanToString($options['notificationsNewMessageEnabled']), 'Notifications.NewMessage.Template' => $options['notificationsNewMessageTemplate'], 'Notifications.NewMessage.Sound' => $options['notificationsNewMessageSound'], 'Notifications.NewMessage.BadgeCountEnabled' => Serialize::booleanToString($options['notificationsNewMessageBadgeCountEnabled']), 'Notifications.AddedToChannel.Enabled' => Serialize::booleanToString($options['notificationsAddedToChannelEnabled']), 'Notifications.AddedToChannel.Template' => $options['notificationsAddedToChannelTemplate'], 'Notifications.AddedToChannel.Sound' => $options['notificationsAddedToChannelSound'], 'Notifications.RemovedFromChannel.Enabled' => Serialize::booleanToString($options['notificationsRemovedFromChannelEnabled']), 'Notifications.RemovedFromChannel.Template' => $options['notificationsRemovedFromChannelTemplate'], 'Notifications.RemovedFromChannel.Sound' => $options['notificationsRemovedFromChannelSound'], 'Notifications.InvitedToChannel.Enabled' => Serialize::booleanToString($options['notificationsInvitedToChannelEnabled']), 'Notifications.InvitedToChannel.Template' => $options['notificationsInvitedToChannelTemplate'], 'Notifications.InvitedToChannel.Sound' => $options['notificationsInvitedToChannelSound'], 'PreWebhookUrl' => $options['preWebhookUrl'], 'PostWebhookUrl' => $options['postWebhookUrl'], 'WebhookMethod' => $options['webhookMethod'], 'WebhookFilters' => Serialize::map($options['webhookFilters'], function ($e) { return $e; }), 'Limits.ChannelMembers' => $options['limitsChannelMembers'], 'Limits.UserChannels' => $options['limitsUserChannels'], 'Media.CompatibilityMessage' => $options['mediaCompatibilityMessage'], 'PreWebhookRetryCount' => $options['preWebhookRetryCount'], 'PostWebhookRetryCount' => $options['postWebhookRetryCount'], 'Notifications.LogEnabled' => Serialize::booleanToString($options['notificationsLogEnabled']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the channels */ protected function getChannels(): ChannelList { if (!$this->_channels) { $this->_channels = new ChannelList( $this->version, $this->solution['sid'] ); } return $this->_channels; } /** * Access the bindings */ protected function getBindings(): BindingList { if (!$this->_bindings) { $this->_bindings = new BindingList( $this->version, $this->solution['sid'] ); } return $this->_bindings; } /** * Access the roles */ protected function getRoles(): RoleList { if (!$this->_roles) { $this->_roles = new RoleList( $this->version, $this->solution['sid'] ); } return $this->_roles; } /** * Access the users */ protected function getUsers(): UserList { if (!$this->_users) { $this->_users = new UserList( $this->version, $this->solution['sid'] ); } return $this->_users; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/ServicePage.php 0000644 00000003002 15021223077 0014346 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ServiceInstance \Twilio\Rest\Chat\V2\ServiceInstance */ public function buildInstance(array $payload): ServiceInstance { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.ServicePage]'; } } sdk/src/Twilio/Rest/Chat/V2/CredentialPage.php 0000644 00000003024 15021223077 0015024 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CredentialInstance \Twilio\Rest\Chat\V2\CredentialInstance */ public function buildInstance(array $payload): CredentialInstance { return new CredentialInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.CredentialPage]'; } } sdk/src/Twilio/Rest/Chat/V2/CredentialList.php 0000644 00000014370 15021223077 0015071 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Credentials'; } /** * Create the CredentialInstance * * @param string $type * @param array|Options $options Optional Arguments * @return CredentialInstance Created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): CredentialInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload ); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialPage Page of CredentialInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialPage Page of CredentialInstance */ public function getPage(string $targetUrl): CredentialPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Constructs a CredentialContext * * @param string $sid The SID of the Credential resource to delete. */ public function getContext( string $sid ): CredentialContext { return new CredentialContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2.CredentialList]'; } } sdk/src/Twilio/Rest/Chat/V2.php 0000644 00000005666 15021223077 0012173 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Chat\V2\CredentialList; use Twilio\Rest\Chat\V2\ServiceList; use Twilio\Version; /** * @property CredentialList $credentials * @property ServiceList $services * @method \Twilio\Rest\Chat\V2\CredentialContext credentials(string $sid) * @method \Twilio\Rest\Chat\V2\ServiceContext services(string $sid) */ class V2 extends Version { protected $_credentials; protected $_services; /** * Construct the V2 version of Chat * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v2'; } protected function getCredentials(): CredentialList { if (!$this->_credentials) { $this->_credentials = new CredentialList($this); } return $this->_credentials; } protected function getServices(): ServiceList { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V2]'; } } sdk/src/Twilio/Rest/Chat/V3/ChannelPage.php 0000644 00000003002 15021223077 0014317 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V3; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ChannelInstance \Twilio\Rest\Chat\V3\ChannelInstance */ public function buildInstance(array $payload): ChannelInstance { return new ChannelInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V3.ChannelPage]'; } } sdk/src/Twilio/Rest/Chat/V3/ChannelList.php 0000644 00000003113 15021223077 0014361 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V3; use Twilio\ListResource; use Twilio\Version; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a ChannelContext * * @param string $serviceSid The unique SID identifier of the Service. * * @param string $sid A 34 character string that uniquely identifies this Channel. */ public function getContext( string $serviceSid , string $sid ): ChannelContext { return new ChannelContext( $this->version, $serviceSid, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V3.ChannelList]'; } } sdk/src/Twilio/Rest/Chat/V3/.openapi-generator-ignore 0000644 00000002020 15021223077 0016341 0 ustar 00 # OpenAPI Generator Ignore # Generated by openapi-generator https://github.com/openapitools/openapi-generator # Use this file to prevent files from being overwritten by the generator. # The patterns follow closely to .gitignore or .dockerignore. # As an example, the C# client generator defines ApiClient.cs. # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: #ApiClient.cs # You can match any string of characters against a directory, file or extension with a single asterisk (*): #foo/*/qux # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux # You can recursively match patterns against a directory, file or extension with a double asterisk (**): #foo/**/qux # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux # You can also negate patterns with an exclamation (!). # For example, you can ignore all files in a docs folder with the file extension .md: #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md sdk/src/Twilio/Rest/Chat/V3/ChannelContext.php 0000644 00000005202 15021223077 0015073 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V3; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class ChannelContext extends InstanceContext { /** * Initialize the ChannelContext * * @param Version $version Version that contains the resource * @param string $serviceSid The unique SID identifier of the Service. * @param string $sid A 34 character string that uniquely identifies this Channel. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($sid) .''; } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { $options = new Values($options); $data = Values::of([ 'Type' => $options['type'], 'MessagingServiceSid' => $options['messagingServiceSid'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V3.ChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V3/ChannelOptions.php 0000644 00000006715 15021223077 0015114 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V3; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $type * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this channel belongs to. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateChannelOptions Options builder */ public static function update( string $type = Values::NONE, string $messagingServiceSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateChannelOptions { return new UpdateChannelOptions( $type, $messagingServiceSid, $xTwilioWebhookEnabled ); } } class UpdateChannelOptions extends Options { /** * @param string $type * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this channel belongs to. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $type = Values::NONE, string $messagingServiceSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['type'] = $type; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * @param string $type * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this channel belongs to. * * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this channel belongs to. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V3.UpdateChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V3/ChannelInstance.php 0000644 00000011453 15021223077 0015220 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V3; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $friendlyName * @property string|null $uniqueName * @property string|null $attributes * @property string $type * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy * @property int|null $membersCount * @property int|null $messagesCount * @property string|null $messagingServiceSid * @property string|null $url */ class ChannelInstance extends InstanceResource { /** * Initialize the ChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The unique SID identifier of the Service. * @param string $sid A 34 character string that uniquely identifies this Channel. */ public function __construct(Version $version, array $payload, string $serviceSid = null, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'type' => Values::array_get($payload, 'type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'membersCount' => Values::array_get($payload, 'members_count'), 'messagesCount' => Values::array_get($payload, 'messages_count'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid ?: $this->properties['serviceSid'], 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ChannelContext Context for this ChannelInstance */ protected function proxy(): ChannelContext { if (!$this->context) { $this->context = new ChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V3.ChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/UserOptions.php 0000644 00000015251 15021223077 0016053 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new User. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $friendlyName A descriptive string that you create to describe the new resource. This value is often used for display purposes. * @return CreateUserOptions Options builder */ public static function create( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE ): CreateUserOptions { return new CreateUserOptions( $roleSid, $attributes, $friendlyName ); } /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. * @return UpdateUserOptions Options builder */ public static function update( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE ): UpdateUserOptions { return new UpdateUserOptions( $roleSid, $attributes, $friendlyName ); } } class CreateUserOptions extends Options { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new User. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $friendlyName A descriptive string that you create to describe the new resource. This value is often used for display purposes. */ public function __construct( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new User. * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new User. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the new resource. This value is often used for display purposes. * * @param string $friendlyName A descriptive string that you create to describe the new resource. This value is often used for display purposes. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.CreateUserOptions ' . $options . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. */ public function __construct( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the resource. It is often used for display purposes. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.UpdateUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/UserContext.php 0000644 00000012020 15021223077 0016033 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Chat\V1\Service\User\UserChannelList; /** * @property UserChannelList $userChannels */ class UserContext extends InstanceContext { protected $_userChannels; /** * Initialize the UserContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. * @param string $sid The Twilio-provided string that uniquely identifies the User resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($sid) .''; } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the userChannels */ protected function getUserChannels(): UserChannelList { if (!$this->_userChannels) { $this->_userChannels = new UserChannelList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userChannels; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.UserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/RoleInstance.php 0000644 00000011760 15021223077 0016150 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $friendlyName * @property string $type * @property string[]|null $permissions * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. * @param string $sid The Twilio-provided string that uniquely identifies the Role resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoleContext Context for this RoleInstance */ protected function proxy(): RoleContext { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type` and are described in the documentation. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/ChannelPage.php 0000644 00000003061 15021223077 0015722 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ChannelInstance \Twilio\Rest\Chat\V1\Service\ChannelInstance */ public function buildInstance(array $payload): ChannelInstance { return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.ChannelPage]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/RoleContext.php 0000644 00000006751 15021223077 0016034 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. * @param string $sid The Twilio-provided string that uniquely identifies the Role resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Roles/' . \rawurlencode($sid) .''; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type` and are described in the documentation. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of([ 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.RoleContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/ChannelList.php 0000644 00000015152 15021223077 0015765 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels'; } /** * Create the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Created ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ChannelInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'Type' => $options['type'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads ChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ChannelPage Page of ChannelInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ChannelPage { $options = new Values($options); $params = Values::of([ 'Type' => $options['type'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ChannelPage Page of ChannelInstance */ public function getPage(string $targetUrl): ChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelPage($this->version, $response, $this->solution); } /** * Constructs a ChannelContext * * @param string $sid The Twilio-provided string that uniquely identifies the Channel resource to delete. */ public function getContext( string $sid ): ChannelContext { return new ChannelContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.ChannelList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/RolePage.php 0000644 00000003037 15021223077 0015256 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RolePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RoleInstance \Twilio\Rest\Chat\V1\Service\RoleInstance */ public function buildInstance(array $payload): RoleInstance { return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.RolePage]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/ChannelContext.php 0000644 00000014276 15021223077 0016504 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Chat\V1\Service\Channel\MemberList; use Twilio\Rest\Chat\V1\Service\Channel\InviteList; use Twilio\Rest\Chat\V1\Service\Channel\MessageList; /** * @property MemberList $members * @property InviteList $invites * @property MessageList $messages * @method \Twilio\Rest\Chat\V1\Service\Channel\MemberContext members(string $sid) * @method \Twilio\Rest\Chat\V1\Service\Channel\MessageContext messages(string $sid) * @method \Twilio\Rest\Chat\V1\Service\Channel\InviteContext invites(string $sid) */ class ChannelContext extends InstanceContext { protected $_members; protected $_invites; protected $_messages; /** * Initialize the ChannelContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. * @param string $sid The Twilio-provided string that uniquely identifies the Channel resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($sid) .''; } /** * Delete the ChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the members */ protected function getMembers(): MemberList { if (!$this->_members) { $this->_members = new MemberList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_members; } /** * Access the invites */ protected function getInvites(): InviteList { if (!$this->_invites) { $this->_invites = new InviteList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_invites; } /** * Access the messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.ChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageInstance.php 0000644 00000012722 15021223077 0020202 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $attributes * @property string|null $serviceSid * @property string|null $to * @property string|null $channelSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property bool|null $wasEdited * @property string|null $from * @property string|null $body * @property int|null $index * @property string|null $url */ class MessageInstance extends InstanceResource { /** * Initialize the MessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. * @param string $channelSid The unique ID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the new resource belongs to. Can be the Channel resource's `sid` or `unique_name`. * @param string $sid The Twilio-provided string that uniquely identifies the Message resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'to' => Values::array_get($payload, 'to'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'wasEdited' => Values::array_get($payload, 'was_edited'), 'from' => Values::array_get($payload, 'from'), 'body' => Values::array_get($payload, 'body'), 'index' => Values::array_get($payload, 'index'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessageContext Context for this MessageInstance */ protected function proxy(): MessageContext { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MessageInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageContext.php 0000644 00000007372 15021223077 0020067 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class MessageContext extends InstanceContext { /** * Initialize the MessageContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. * @param string $channelSid The unique ID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the new resource belongs to. Can be the Channel resource's `sid` or `unique_name`. * @param string $sid The Twilio-provided string that uniquely identifies the Message resource to delete. */ public function __construct( Version $version, $serviceSid, $channelSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Messages/' . \rawurlencode($sid) .''; } /** * Delete the MessageInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Body' => $options['body'], 'Attributes' => $options['attributes'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberInstance.php 0000644 00000012633 15021223077 0020026 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $channelSid * @property string|null $serviceSid * @property string|null $identity * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $roleSid * @property int|null $lastConsumedMessageIndex * @property \DateTime|null $lastConsumptionTimestamp * @property string|null $url */ class MemberInstance extends InstanceResource { /** * Initialize the MemberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. * @param string $channelSid The unique ID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the new member belongs to. Can be the Channel resource's `sid` or `unique_name`. * @param string $sid The Twilio-provided string that uniquely identifies the Member resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MemberContext Context for this MemberInstance */ protected function proxy(): MemberContext { if (!$this->context) { $this->context = new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MemberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { return $this->proxy()->fetch(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.MemberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberContext.php 0000644 00000007412 15021223077 0017705 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class MemberContext extends InstanceContext { /** * Initialize the MemberContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. * @param string $channelSid The unique ID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the new member belongs to. Can be the Channel resource's `sid` or `unique_name`. * @param string $sid The Twilio-provided string that uniquely identifies the Member resource to delete. */ public function __construct( Version $version, $serviceSid, $channelSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members/' . \rawurlencode($sid) .''; } /** * Delete the MemberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.MemberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberOptions.php 0000644 00000016753 15021223077 0017724 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * @return CreateMemberOptions Options builder */ public static function create( string $roleSid = Values::NONE ): CreateMemberOptions { return new CreateMemberOptions( $roleSid ); } /** * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * @return ReadMemberOptions Options builder */ public static function read( array $identity = Values::ARRAY_NONE ): ReadMemberOptions { return new ReadMemberOptions( $identity ); } /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). * @return UpdateMemberOptions Options builder */ public static function update( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE ): UpdateMemberOptions { return new UpdateMemberOptions( $roleSid, $lastConsumedMessageIndex ); } } class CreateMemberOptions extends Options { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). */ public function __construct( string $roleSid = Values::NONE ) { $this->options['roleSid'] = $roleSid; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.CreateMemberOptions ' . $options . ']'; } } class ReadMemberOptions extends Options { /** * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.ReadMemberOptions ' . $options . ']'; } } class UpdateMemberOptions extends Options { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). */ public function __construct( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE ) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). * * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.UpdateMemberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteList.php 0000644 00000016317 15021223077 0017227 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class InviteList extends ListResource { /** * Construct the InviteList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the new resource belongs to. */ public function __construct( Version $version, string $serviceSid, string $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites'; } /** * Create the InviteInstance * * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/api/chat/rest/v1/user) within the [Service](https://www.twilio.com/docs/api/chat/rest/v1/service). See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more info. * @param array|Options $options Optional Arguments * @return InviteInstance Created InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): InviteInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads InviteInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InviteInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InvitePage Page of InviteInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InvitePage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InvitePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InviteInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InvitePage Page of InviteInstance */ public function getPage(string $targetUrl): InvitePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InvitePage($this->version, $response, $this->solution); } /** * Constructs a InviteContext * * @param string $sid The Twilio-provided string that uniquely identifies the Invite resource to delete. */ public function getContext( string $sid ): InviteContext { return new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.InviteList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteContext.php 0000644 00000005545 15021223077 0017741 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class InviteContext extends InstanceContext { /** * Initialize the InviteContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the new resource belongs to. * @param string $sid The Twilio-provided string that uniquely identifies the Invite resource to delete. */ public function __construct( Version $version, $serviceSid, $channelSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites/' . \rawurlencode($sid) .''; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.InviteContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteInstance.php 0000644 00000011421 15021223077 0020047 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $channelSid * @property string|null $serviceSid * @property string|null $identity * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $roleSid * @property string|null $createdBy * @property string|null $url */ class InviteInstance extends InstanceResource { /** * Initialize the InviteInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the new resource belongs to. * @param string $sid The Twilio-provided string that uniquely identifies the Invite resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'createdBy' => Values::array_get($payload, 'created_by'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InviteContext Context for this InviteInstance */ protected function proxy(): InviteContext { if (!$this->context) { $this->context = new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.InviteInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteOptions.php 0000644 00000007660 15021223077 0017750 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class InviteOptions { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new member. * @return CreateInviteOptions Options builder */ public static function create( string $roleSid = Values::NONE ): CreateInviteOptions { return new CreateInviteOptions( $roleSid ); } /** * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * @return ReadInviteOptions Options builder */ public static function read( array $identity = Values::ARRAY_NONE ): ReadInviteOptions { return new ReadInviteOptions( $identity ); } } class CreateInviteOptions extends Options { /** * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new member. */ public function __construct( string $roleSid = Values::NONE ) { $this->options['roleSid'] = $roleSid; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new member. * * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new member. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.CreateInviteOptions ' . $options . ']'; } } class ReadInviteOptions extends Options { /** * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.ReadInviteOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessagePage.php 0000644 00000003140 15021223077 0017304 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MessageInstance \Twilio\Rest\Chat\V1\Service\Channel\MessageInstance */ public function buildInstance(array $payload): MessageInstance { return new MessageInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.MessagePage]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberPage.php 0000644 00000003132 15021223077 0017130 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MemberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MemberInstance \Twilio\Rest\Chat\V1\Service\Channel\MemberInstance */ public function buildInstance(array $payload): MemberInstance { return new MemberInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.MemberPage]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberList.php 0000644 00000016412 15021223077 0017174 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class MemberList extends ListResource { /** * Construct the MemberList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. * @param string $channelSid The unique ID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the new member belongs to. Can be the Channel resource's `sid` or `unique_name`. */ public function __construct( Version $version, string $serviceSid, string $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members'; } /** * Create the MemberInstance * * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/api/chat/rest/v1/user) within the [Service](https://www.twilio.com/docs/api/chat/rest/services). See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * @param array|Options $options Optional Arguments * @return MemberInstance Created MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads MemberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MemberInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MemberPage Page of MemberInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MemberPage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MemberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MemberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MemberPage Page of MemberInstance */ public function getPage(string $targetUrl): MemberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MemberPage($this->version, $response, $this->solution); } /** * Constructs a MemberContext * * @param string $sid The Twilio-provided string that uniquely identifies the Member resource to delete. */ public function getContext( string $sid ): MemberContext { return new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.MemberList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InvitePage.php 0000644 00000003132 15021223077 0017157 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class InvitePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return InviteInstance \Twilio\Rest\Chat\V1\Service\Channel\InviteInstance */ public function buildInstance(array $payload): InviteInstance { return new InviteInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.InvitePage]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageOptions.php 0000644 00000015451 15021223077 0020073 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $from The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message's author. The default value is `system`. * @param string $attributes A valid JSON string that contains application-specific data. * @return CreateMessageOptions Options builder */ public static function create( string $from = Values::NONE, string $attributes = Values::NONE ): CreateMessageOptions { return new CreateMessageOptions( $from, $attributes ); } /** * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. * @return ReadMessageOptions Options builder */ public static function read( string $order = Values::NONE ): ReadMessageOptions { return new ReadMessageOptions( $order ); } /** * @param string $body The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @param string $attributes A valid JSON string that contains application-specific data. * @return UpdateMessageOptions Options builder */ public static function update( string $body = Values::NONE, string $attributes = Values::NONE ): UpdateMessageOptions { return new UpdateMessageOptions( $body, $attributes ); } } class CreateMessageOptions extends Options { /** * @param string $from The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message's author. The default value is `system`. * @param string $attributes A valid JSON string that contains application-specific data. */ public function __construct( string $from = Values::NONE, string $attributes = Values::NONE ) { $this->options['from'] = $from; $this->options['attributes'] = $attributes; } /** * The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message's author. The default value is `system`. * * @param string $from The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message's author. The default value is `system`. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.CreateMessageOptions ' . $options . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. */ public function __construct( string $order = Values::NONE ) { $this->options['order'] = $order; } /** * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. * * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.ReadMessageOptions ' . $options . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $body The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @param string $attributes A valid JSON string that contains application-specific data. */ public function __construct( string $body = Values::NONE, string $attributes = Values::NONE ) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; } /** * The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * * @param string $body The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.UpdateMessageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageList.php 0000644 00000016240 15021223077 0017350 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. * @param string $channelSid The unique ID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the new resource belongs to. Can be the Channel resource's `sid` or `unique_name`. */ public function __construct( Version $version, string $serviceSid, string $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Messages'; } /** * Create the MessageInstance * * @param string $body The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * @param array|Options $options Optional Arguments * @return MessageInstance Created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $body, array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Body' => $body, 'From' => $options['from'], 'Attributes' => $options['attributes'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagePage Page of MessageInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagePage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagePage Page of MessageInstance */ public function getPage(string $targetUrl): MessagePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid The Twilio-provided string that uniquely identifies the Message resource to delete. */ public function getContext( string $sid ): MessageContext { return new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.MessageList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/ChannelOptions.php 0000644 00000023151 15021223077 0016503 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $type * @return CreateChannelOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $type = Values::NONE ): CreateChannelOptions { return new CreateChannelOptions( $friendlyName, $uniqueName, $attributes, $type ); } /** * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. * @return ReadChannelOptions Options builder */ public static function read( array $type = Values::ARRAY_NONE ): ReadChannelOptions { return new ReadChannelOptions( $type ); } /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * @param string $attributes A valid JSON string that contains application-specific data. * @return UpdateChannelOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE ): UpdateChannelOptions { return new UpdateChannelOptions( $friendlyName, $uniqueName, $attributes ); } } class CreateChannelOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * @param string $attributes A valid JSON string that contains application-specific data. * @param string $type */ public function __construct( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $type = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * @param string $type * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.CreateChannelOptions ' . $options . ']'; } } class ReadChannelOptions extends Options { /** * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. */ public function __construct( array $type = Values::ARRAY_NONE ) { $this->options['type'] = $type; } /** * The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. * * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. * @return $this Fluent Builder */ public function setType(array $type): self { $this->options['type'] = $type; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.ReadChannelOptions ' . $options . ']'; } } class UpdateChannelOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * @param string $attributes A valid JSON string that contains application-specific data. */ public function __construct( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains application-specific data. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.UpdateChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/ChannelInstance.php 0000644 00000013745 15021223077 0016624 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Chat\V1\Service\Channel\MemberList; use Twilio\Rest\Chat\V1\Service\Channel\InviteList; use Twilio\Rest\Chat\V1\Service\Channel\MessageList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $friendlyName * @property string|null $uniqueName * @property string|null $attributes * @property string $type * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy * @property int|null $membersCount * @property int|null $messagesCount * @property string|null $url * @property array|null $links */ class ChannelInstance extends InstanceResource { protected $_members; protected $_invites; protected $_messages; /** * Initialize the ChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. * @param string $sid The Twilio-provided string that uniquely identifies the Channel resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'type' => Values::array_get($payload, 'type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'membersCount' => Values::array_get($payload, 'members_count'), 'messagesCount' => Values::array_get($payload, 'messages_count'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ChannelContext Context for this ChannelInstance */ protected function proxy(): ChannelContext { if (!$this->context) { $this->context = new ChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { return $this->proxy()->fetch(); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { return $this->proxy()->update($options); } /** * Access the members */ protected function getMembers(): MemberList { return $this->proxy()->members; } /** * Access the invites */ protected function getInvites(): InviteList { return $this->proxy()->invites; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.ChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/UserPage.php 0000644 00000003037 15021223077 0015273 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserInstance \Twilio\Rest\Chat\V1\Service\UserInstance */ public function buildInstance(array $payload): UserInstance { return new UserInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.UserPage]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelPage.php 0000644 00000003157 15021223077 0017505 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\User; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserChannelInstance \Twilio\Rest\Chat\V1\Service\User\UserChannelInstance */ public function buildInstance(array $payload): UserChannelInstance { return new UserChannelInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.UserChannelPage]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelInstance.php 0000644 00000006210 15021223077 0020366 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $channelSid * @property string|null $memberSid * @property string $status * @property int|null $lastConsumedMessageIndex * @property int|null $unreadMessagesCount * @property array|null $links */ class UserChannelInstance extends InstanceResource { /** * Initialize the UserChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to read the resources from. * @param string $userSid The SID of the [User](https://www.twilio.com/docs/api/chat/rest/users) to read the User Channel resources from. */ public function __construct(Version $version, array $payload, string $serviceSid, string $userSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'memberSid' => Values::array_get($payload, 'member_sid'), 'status' => Values::array_get($payload, 'status'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.UserChannelInstance]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelList.php 0000644 00000012534 15021223077 0017543 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service\User; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserChannelList extends ListResource { /** * Construct the UserChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to read the resources from. * @param string $userSid The SID of the [User](https://www.twilio.com/docs/api/chat/rest/users) to read the User Channel resources from. */ public function __construct( Version $version, string $serviceSid, string $userSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Channels'; } /** * Reads UserChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserChannelInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserChannelPage Page of UserChannelInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserChannelPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserChannelPage Page of UserChannelInstance */ public function getPage(string $targetUrl): UserChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserChannelPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.UserChannelList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/UserList.php 0000644 00000015101 15021223077 0015325 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users'; } /** * Create the UserInstance * * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/api/chat/rest/v1/user) within the [Service](https://www.twilio.com/docs/api/chat/rest/v1/service). This value is often a username or email address. See the Identity documentation for more details. * @param array|Options $options Optional Arguments * @return UserInstance Created UserInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads UserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserPage Page of UserInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserPage Page of UserInstance */ public function getPage(string $targetUrl): UserPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserPage($this->version, $response, $this->solution); } /** * Constructs a UserContext * * @param string $sid The Twilio-provided string that uniquely identifies the User resource to delete. */ public function getContext( string $sid ): UserContext { return new UserContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.UserList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/RoleList.php 0000644 00000015130 15021223077 0015312 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class RoleList extends ListResource { /** * Construct the RoleList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $type * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type` and are described in the documentation. * @return RoleInstance Created RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $permission): RoleInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads RoleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoleInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RolePage Page of RoleInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RolePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RolePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RolePage Page of RoleInstance */ public function getPage(string $targetUrl): RolePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RolePage($this->version, $response, $this->solution); } /** * Constructs a RoleContext * * @param string $sid The Twilio-provided string that uniquely identifies the Role resource to delete. */ public function getContext( string $sid ): RoleContext { return new RoleContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.RoleList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/UserInstance.php 0000644 00000013046 15021223077 0016164 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Chat\V1\Service\User\UserChannelList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $attributes * @property string|null $friendlyName * @property string|null $roleSid * @property string|null $identity * @property bool|null $isOnline * @property bool|null $isNotifiable * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property int|null $joinedChannelsCount * @property array|null $links * @property string|null $url */ class UserInstance extends InstanceResource { protected $_userChannels; /** * Initialize the UserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. * @param string $sid The Twilio-provided string that uniquely identifies the User resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'identity' => Values::array_get($payload, 'identity'), 'isOnline' => Values::array_get($payload, 'is_online'), 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'joinedChannelsCount' => Values::array_get($payload, 'joined_channels_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserContext Context for this UserInstance */ protected function proxy(): UserContext { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { return $this->proxy()->update($options); } /** * Access the userChannels */ protected function getUserChannels(): UserChannelList { return $this->proxy()->userChannels; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/ServiceInstance.php 0000644 00000015347 15021223077 0015254 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Chat\V1\Service\ChannelList; use Twilio\Rest\Chat\V1\Service\RoleList; use Twilio\Rest\Chat\V1\Service\UserList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $defaultServiceRoleSid * @property string|null $defaultChannelRoleSid * @property string|null $defaultChannelCreatorRoleSid * @property bool|null $readStatusEnabled * @property bool|null $reachabilityEnabled * @property int|null $typingIndicatorTimeout * @property int|null $consumptionReportInterval * @property array|null $limits * @property array|null $webhooks * @property string|null $preWebhookUrl * @property string|null $postWebhookUrl * @property string|null $webhookMethod * @property string[]|null $webhookFilters * @property array|null $notifications * @property string|null $url * @property array|null $links */ class ServiceInstance extends InstanceResource { protected $_channels; protected $_roles; protected $_users; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The Twilio-provided string that uniquely identifies the Service resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'defaultServiceRoleSid' => Values::array_get($payload, 'default_service_role_sid'), 'defaultChannelRoleSid' => Values::array_get($payload, 'default_channel_role_sid'), 'defaultChannelCreatorRoleSid' => Values::array_get($payload, 'default_channel_creator_role_sid'), 'readStatusEnabled' => Values::array_get($payload, 'read_status_enabled'), 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), 'typingIndicatorTimeout' => Values::array_get($payload, 'typing_indicator_timeout'), 'consumptionReportInterval' => Values::array_get($payload, 'consumption_report_interval'), 'limits' => Values::array_get($payload, 'limits'), 'webhooks' => Values::array_get($payload, 'webhooks'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), 'notifications' => Values::array_get($payload, 'notifications'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the channels */ protected function getChannels(): ChannelList { return $this->proxy()->channels; } /** * Access the roles */ protected function getRoles(): RoleList { return $this->proxy()->roles; } /** * Access the users */ protected function getUsers(): UserList { return $this->proxy()->users; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/ServiceList.php 0000644 00000013421 15021223077 0014412 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): ServiceInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The Twilio-provided string that uniquely identifies the Service resource to delete. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Chat/V1/ServiceOptions.php 0000644 00000173667 15021223077 0015155 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $defaultServiceRoleSid The service role assigned to users when they are added to the service. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * @param string $defaultChannelRoleSid The channel role assigned to users when they are added to a channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * @param string $defaultChannelCreatorRoleSid The channel role assigned to a channel creator when they join a new channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * @param bool $readStatusEnabled Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * @param bool $reachabilityEnabled Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * @param int $typingIndicatorTimeout How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * @param int $consumptionReportInterval DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * @param bool $notificationsNewMessageEnabled Whether to send a notification when a new message is added to a channel. Can be: `true` or `false` and the default is `false`. * @param string $notificationsNewMessageTemplate The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * @param bool $notificationsAddedToChannelEnabled Whether to send a notification when a member is added to a channel. Can be: `true` or `false` and the default is `false`. * @param string $notificationsAddedToChannelTemplate The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * @param bool $notificationsRemovedFromChannelEnabled Whether to send a notification to a user when they are removed from a channel. Can be: `true` or `false` and the default is `false`. * @param string $notificationsRemovedFromChannelTemplate The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * @param bool $notificationsInvitedToChannelEnabled Whether to send a notification when a user is invited to a channel. Can be: `true` or `false` and the default is `false`. * @param string $notificationsInvitedToChannelTemplate The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * @param string $preWebhookUrl The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * @param string $postWebhookUrl The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * @param string $webhookMethod The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @param string[] $webhookFilters The list of WebHook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @param string $webhooksOnMessageSendUrl The URL of the webhook to call in response to the `on_message_send` event using the `webhooks.on_message_send.method` HTTP method. * @param string $webhooksOnMessageSendMethod The HTTP method to use when calling the `webhooks.on_message_send.url`. * @param string $webhooksOnMessageUpdateUrl The URL of the webhook to call in response to the `on_message_update` event using the `webhooks.on_message_update.method` HTTP method. * @param string $webhooksOnMessageUpdateMethod The HTTP method to use when calling the `webhooks.on_message_update.url`. * @param string $webhooksOnMessageRemoveUrl The URL of the webhook to call in response to the `on_message_remove` event using the `webhooks.on_message_remove.method` HTTP method. * @param string $webhooksOnMessageRemoveMethod The HTTP method to use when calling the `webhooks.on_message_remove.url`. * @param string $webhooksOnChannelAddUrl The URL of the webhook to call in response to the `on_channel_add` event using the `webhooks.on_channel_add.method` HTTP method. * @param string $webhooksOnChannelAddMethod The HTTP method to use when calling the `webhooks.on_channel_add.url`. * @param string $webhooksOnChannelDestroyUrl The URL of the webhook to call in response to the `on_channel_destroy` event using the `webhooks.on_channel_destroy.method` HTTP method. * @param string $webhooksOnChannelDestroyMethod The HTTP method to use when calling the `webhooks.on_channel_destroy.url`. * @param string $webhooksOnChannelUpdateUrl The URL of the webhook to call in response to the `on_channel_update` event using the `webhooks.on_channel_update.method` HTTP method. * @param string $webhooksOnChannelUpdateMethod The HTTP method to use when calling the `webhooks.on_channel_update.url`. * @param string $webhooksOnMemberAddUrl The URL of the webhook to call in response to the `on_member_add` event using the `webhooks.on_member_add.method` HTTP method. * @param string $webhooksOnMemberAddMethod The HTTP method to use when calling the `webhooks.on_member_add.url`. * @param string $webhooksOnMemberRemoveUrl The URL of the webhook to call in response to the `on_member_remove` event using the `webhooks.on_member_remove.method` HTTP method. * @param string $webhooksOnMemberRemoveMethod The HTTP method to use when calling the `webhooks.on_member_remove.url`. * @param string $webhooksOnMessageSentUrl The URL of the webhook to call in response to the `on_message_sent` event using the `webhooks.on_message_sent.method` HTTP method. * @param string $webhooksOnMessageSentMethod The URL of the webhook to call in response to the `on_message_sent` event`. * @param string $webhooksOnMessageUpdatedUrl The URL of the webhook to call in response to the `on_message_updated` event using the `webhooks.on_message_updated.method` HTTP method. * @param string $webhooksOnMessageUpdatedMethod The HTTP method to use when calling the `webhooks.on_message_updated.url`. * @param string $webhooksOnMessageRemovedUrl The URL of the webhook to call in response to the `on_message_removed` event using the `webhooks.on_message_removed.method` HTTP method. * @param string $webhooksOnMessageRemovedMethod The HTTP method to use when calling the `webhooks.on_message_removed.url`. * @param string $webhooksOnChannelAddedUrl The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_added.method` HTTP method. * @param string $webhooksOnChannelAddedMethod The URL of the webhook to call in response to the `on_channel_added` event`. * @param string $webhooksOnChannelDestroyedUrl The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_destroyed.method` HTTP method. * @param string $webhooksOnChannelDestroyedMethod The HTTP method to use when calling the `webhooks.on_channel_destroyed.url`. * @param string $webhooksOnChannelUpdatedUrl The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * @param string $webhooksOnChannelUpdatedMethod The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * @param string $webhooksOnMemberAddedUrl The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * @param string $webhooksOnMemberAddedMethod The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * @param string $webhooksOnMemberRemovedUrl The URL of the webhook to call in response to the `on_member_removed` event using the `webhooks.on_member_removed.method` HTTP method. * @param string $webhooksOnMemberRemovedMethod The HTTP method to use when calling the `webhooks.on_member_removed.url`. * @param int $limitsChannelMembers The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * @param int $limitsUserChannels The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. * @return UpdateServiceOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $defaultServiceRoleSid = Values::NONE, string $defaultChannelRoleSid = Values::NONE, string $defaultChannelCreatorRoleSid = Values::NONE, bool $readStatusEnabled = Values::BOOL_NONE, bool $reachabilityEnabled = Values::BOOL_NONE, int $typingIndicatorTimeout = Values::INT_NONE, int $consumptionReportInterval = Values::INT_NONE, bool $notificationsNewMessageEnabled = Values::BOOL_NONE, string $notificationsNewMessageTemplate = Values::NONE, bool $notificationsAddedToChannelEnabled = Values::BOOL_NONE, string $notificationsAddedToChannelTemplate = Values::NONE, bool $notificationsRemovedFromChannelEnabled = Values::BOOL_NONE, string $notificationsRemovedFromChannelTemplate = Values::NONE, bool $notificationsInvitedToChannelEnabled = Values::BOOL_NONE, string $notificationsInvitedToChannelTemplate = Values::NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $webhookMethod = Values::NONE, array $webhookFilters = Values::ARRAY_NONE, string $webhooksOnMessageSendUrl = Values::NONE, string $webhooksOnMessageSendMethod = Values::NONE, string $webhooksOnMessageUpdateUrl = Values::NONE, string $webhooksOnMessageUpdateMethod = Values::NONE, string $webhooksOnMessageRemoveUrl = Values::NONE, string $webhooksOnMessageRemoveMethod = Values::NONE, string $webhooksOnChannelAddUrl = Values::NONE, string $webhooksOnChannelAddMethod = Values::NONE, string $webhooksOnChannelDestroyUrl = Values::NONE, string $webhooksOnChannelDestroyMethod = Values::NONE, string $webhooksOnChannelUpdateUrl = Values::NONE, string $webhooksOnChannelUpdateMethod = Values::NONE, string $webhooksOnMemberAddUrl = Values::NONE, string $webhooksOnMemberAddMethod = Values::NONE, string $webhooksOnMemberRemoveUrl = Values::NONE, string $webhooksOnMemberRemoveMethod = Values::NONE, string $webhooksOnMessageSentUrl = Values::NONE, string $webhooksOnMessageSentMethod = Values::NONE, string $webhooksOnMessageUpdatedUrl = Values::NONE, string $webhooksOnMessageUpdatedMethod = Values::NONE, string $webhooksOnMessageRemovedUrl = Values::NONE, string $webhooksOnMessageRemovedMethod = Values::NONE, string $webhooksOnChannelAddedUrl = Values::NONE, string $webhooksOnChannelAddedMethod = Values::NONE, string $webhooksOnChannelDestroyedUrl = Values::NONE, string $webhooksOnChannelDestroyedMethod = Values::NONE, string $webhooksOnChannelUpdatedUrl = Values::NONE, string $webhooksOnChannelUpdatedMethod = Values::NONE, string $webhooksOnMemberAddedUrl = Values::NONE, string $webhooksOnMemberAddedMethod = Values::NONE, string $webhooksOnMemberRemovedUrl = Values::NONE, string $webhooksOnMemberRemovedMethod = Values::NONE, int $limitsChannelMembers = Values::INT_NONE, int $limitsUserChannels = Values::INT_NONE ): UpdateServiceOptions { return new UpdateServiceOptions( $friendlyName, $defaultServiceRoleSid, $defaultChannelRoleSid, $defaultChannelCreatorRoleSid, $readStatusEnabled, $reachabilityEnabled, $typingIndicatorTimeout, $consumptionReportInterval, $notificationsNewMessageEnabled, $notificationsNewMessageTemplate, $notificationsAddedToChannelEnabled, $notificationsAddedToChannelTemplate, $notificationsRemovedFromChannelEnabled, $notificationsRemovedFromChannelTemplate, $notificationsInvitedToChannelEnabled, $notificationsInvitedToChannelTemplate, $preWebhookUrl, $postWebhookUrl, $webhookMethod, $webhookFilters, $webhooksOnMessageSendUrl, $webhooksOnMessageSendMethod, $webhooksOnMessageUpdateUrl, $webhooksOnMessageUpdateMethod, $webhooksOnMessageRemoveUrl, $webhooksOnMessageRemoveMethod, $webhooksOnChannelAddUrl, $webhooksOnChannelAddMethod, $webhooksOnChannelDestroyUrl, $webhooksOnChannelDestroyMethod, $webhooksOnChannelUpdateUrl, $webhooksOnChannelUpdateMethod, $webhooksOnMemberAddUrl, $webhooksOnMemberAddMethod, $webhooksOnMemberRemoveUrl, $webhooksOnMemberRemoveMethod, $webhooksOnMessageSentUrl, $webhooksOnMessageSentMethod, $webhooksOnMessageUpdatedUrl, $webhooksOnMessageUpdatedMethod, $webhooksOnMessageRemovedUrl, $webhooksOnMessageRemovedMethod, $webhooksOnChannelAddedUrl, $webhooksOnChannelAddedMethod, $webhooksOnChannelDestroyedUrl, $webhooksOnChannelDestroyedMethod, $webhooksOnChannelUpdatedUrl, $webhooksOnChannelUpdatedMethod, $webhooksOnMemberAddedUrl, $webhooksOnMemberAddedMethod, $webhooksOnMemberRemovedUrl, $webhooksOnMemberRemovedMethod, $limitsChannelMembers, $limitsUserChannels ); } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $defaultServiceRoleSid The service role assigned to users when they are added to the service. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * @param string $defaultChannelRoleSid The channel role assigned to users when they are added to a channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * @param string $defaultChannelCreatorRoleSid The channel role assigned to a channel creator when they join a new channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * @param bool $readStatusEnabled Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * @param bool $reachabilityEnabled Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * @param int $typingIndicatorTimeout How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * @param int $consumptionReportInterval DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * @param bool $notificationsNewMessageEnabled Whether to send a notification when a new message is added to a channel. Can be: `true` or `false` and the default is `false`. * @param string $notificationsNewMessageTemplate The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * @param bool $notificationsAddedToChannelEnabled Whether to send a notification when a member is added to a channel. Can be: `true` or `false` and the default is `false`. * @param string $notificationsAddedToChannelTemplate The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * @param bool $notificationsRemovedFromChannelEnabled Whether to send a notification to a user when they are removed from a channel. Can be: `true` or `false` and the default is `false`. * @param string $notificationsRemovedFromChannelTemplate The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * @param bool $notificationsInvitedToChannelEnabled Whether to send a notification when a user is invited to a channel. Can be: `true` or `false` and the default is `false`. * @param string $notificationsInvitedToChannelTemplate The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * @param string $preWebhookUrl The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * @param string $postWebhookUrl The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * @param string $webhookMethod The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @param string[] $webhookFilters The list of WebHook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @param string $webhooksOnMessageSendUrl The URL of the webhook to call in response to the `on_message_send` event using the `webhooks.on_message_send.method` HTTP method. * @param string $webhooksOnMessageSendMethod The HTTP method to use when calling the `webhooks.on_message_send.url`. * @param string $webhooksOnMessageUpdateUrl The URL of the webhook to call in response to the `on_message_update` event using the `webhooks.on_message_update.method` HTTP method. * @param string $webhooksOnMessageUpdateMethod The HTTP method to use when calling the `webhooks.on_message_update.url`. * @param string $webhooksOnMessageRemoveUrl The URL of the webhook to call in response to the `on_message_remove` event using the `webhooks.on_message_remove.method` HTTP method. * @param string $webhooksOnMessageRemoveMethod The HTTP method to use when calling the `webhooks.on_message_remove.url`. * @param string $webhooksOnChannelAddUrl The URL of the webhook to call in response to the `on_channel_add` event using the `webhooks.on_channel_add.method` HTTP method. * @param string $webhooksOnChannelAddMethod The HTTP method to use when calling the `webhooks.on_channel_add.url`. * @param string $webhooksOnChannelDestroyUrl The URL of the webhook to call in response to the `on_channel_destroy` event using the `webhooks.on_channel_destroy.method` HTTP method. * @param string $webhooksOnChannelDestroyMethod The HTTP method to use when calling the `webhooks.on_channel_destroy.url`. * @param string $webhooksOnChannelUpdateUrl The URL of the webhook to call in response to the `on_channel_update` event using the `webhooks.on_channel_update.method` HTTP method. * @param string $webhooksOnChannelUpdateMethod The HTTP method to use when calling the `webhooks.on_channel_update.url`. * @param string $webhooksOnMemberAddUrl The URL of the webhook to call in response to the `on_member_add` event using the `webhooks.on_member_add.method` HTTP method. * @param string $webhooksOnMemberAddMethod The HTTP method to use when calling the `webhooks.on_member_add.url`. * @param string $webhooksOnMemberRemoveUrl The URL of the webhook to call in response to the `on_member_remove` event using the `webhooks.on_member_remove.method` HTTP method. * @param string $webhooksOnMemberRemoveMethod The HTTP method to use when calling the `webhooks.on_member_remove.url`. * @param string $webhooksOnMessageSentUrl The URL of the webhook to call in response to the `on_message_sent` event using the `webhooks.on_message_sent.method` HTTP method. * @param string $webhooksOnMessageSentMethod The URL of the webhook to call in response to the `on_message_sent` event`. * @param string $webhooksOnMessageUpdatedUrl The URL of the webhook to call in response to the `on_message_updated` event using the `webhooks.on_message_updated.method` HTTP method. * @param string $webhooksOnMessageUpdatedMethod The HTTP method to use when calling the `webhooks.on_message_updated.url`. * @param string $webhooksOnMessageRemovedUrl The URL of the webhook to call in response to the `on_message_removed` event using the `webhooks.on_message_removed.method` HTTP method. * @param string $webhooksOnMessageRemovedMethod The HTTP method to use when calling the `webhooks.on_message_removed.url`. * @param string $webhooksOnChannelAddedUrl The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_added.method` HTTP method. * @param string $webhooksOnChannelAddedMethod The URL of the webhook to call in response to the `on_channel_added` event`. * @param string $webhooksOnChannelDestroyedUrl The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_destroyed.method` HTTP method. * @param string $webhooksOnChannelDestroyedMethod The HTTP method to use when calling the `webhooks.on_channel_destroyed.url`. * @param string $webhooksOnChannelUpdatedUrl The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * @param string $webhooksOnChannelUpdatedMethod The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * @param string $webhooksOnMemberAddedUrl The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * @param string $webhooksOnMemberAddedMethod The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * @param string $webhooksOnMemberRemovedUrl The URL of the webhook to call in response to the `on_member_removed` event using the `webhooks.on_member_removed.method` HTTP method. * @param string $webhooksOnMemberRemovedMethod The HTTP method to use when calling the `webhooks.on_member_removed.url`. * @param int $limitsChannelMembers The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * @param int $limitsUserChannels The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. */ public function __construct( string $friendlyName = Values::NONE, string $defaultServiceRoleSid = Values::NONE, string $defaultChannelRoleSid = Values::NONE, string $defaultChannelCreatorRoleSid = Values::NONE, bool $readStatusEnabled = Values::BOOL_NONE, bool $reachabilityEnabled = Values::BOOL_NONE, int $typingIndicatorTimeout = Values::INT_NONE, int $consumptionReportInterval = Values::INT_NONE, bool $notificationsNewMessageEnabled = Values::BOOL_NONE, string $notificationsNewMessageTemplate = Values::NONE, bool $notificationsAddedToChannelEnabled = Values::BOOL_NONE, string $notificationsAddedToChannelTemplate = Values::NONE, bool $notificationsRemovedFromChannelEnabled = Values::BOOL_NONE, string $notificationsRemovedFromChannelTemplate = Values::NONE, bool $notificationsInvitedToChannelEnabled = Values::BOOL_NONE, string $notificationsInvitedToChannelTemplate = Values::NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $webhookMethod = Values::NONE, array $webhookFilters = Values::ARRAY_NONE, string $webhooksOnMessageSendUrl = Values::NONE, string $webhooksOnMessageSendMethod = Values::NONE, string $webhooksOnMessageUpdateUrl = Values::NONE, string $webhooksOnMessageUpdateMethod = Values::NONE, string $webhooksOnMessageRemoveUrl = Values::NONE, string $webhooksOnMessageRemoveMethod = Values::NONE, string $webhooksOnChannelAddUrl = Values::NONE, string $webhooksOnChannelAddMethod = Values::NONE, string $webhooksOnChannelDestroyUrl = Values::NONE, string $webhooksOnChannelDestroyMethod = Values::NONE, string $webhooksOnChannelUpdateUrl = Values::NONE, string $webhooksOnChannelUpdateMethod = Values::NONE, string $webhooksOnMemberAddUrl = Values::NONE, string $webhooksOnMemberAddMethod = Values::NONE, string $webhooksOnMemberRemoveUrl = Values::NONE, string $webhooksOnMemberRemoveMethod = Values::NONE, string $webhooksOnMessageSentUrl = Values::NONE, string $webhooksOnMessageSentMethod = Values::NONE, string $webhooksOnMessageUpdatedUrl = Values::NONE, string $webhooksOnMessageUpdatedMethod = Values::NONE, string $webhooksOnMessageRemovedUrl = Values::NONE, string $webhooksOnMessageRemovedMethod = Values::NONE, string $webhooksOnChannelAddedUrl = Values::NONE, string $webhooksOnChannelAddedMethod = Values::NONE, string $webhooksOnChannelDestroyedUrl = Values::NONE, string $webhooksOnChannelDestroyedMethod = Values::NONE, string $webhooksOnChannelUpdatedUrl = Values::NONE, string $webhooksOnChannelUpdatedMethod = Values::NONE, string $webhooksOnMemberAddedUrl = Values::NONE, string $webhooksOnMemberAddedMethod = Values::NONE, string $webhooksOnMemberRemovedUrl = Values::NONE, string $webhooksOnMemberRemovedMethod = Values::NONE, int $limitsChannelMembers = Values::INT_NONE, int $limitsUserChannels = Values::INT_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; $this->options['readStatusEnabled'] = $readStatusEnabled; $this->options['reachabilityEnabled'] = $reachabilityEnabled; $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; $this->options['consumptionReportInterval'] = $consumptionReportInterval; $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The service role assigned to users when they are added to the service. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * * @param string $defaultServiceRoleSid The service role assigned to users when they are added to the service. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * @return $this Fluent Builder */ public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * The channel role assigned to users when they are added to a channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * * @param string $defaultChannelRoleSid The channel role assigned to users when they are added to a channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * @return $this Fluent Builder */ public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * The channel role assigned to a channel creator when they join a new channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * * @param string $defaultChannelCreatorRoleSid The channel role assigned to a channel creator when they join a new channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * * @param bool $readStatusEnabled Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * @return $this Fluent Builder */ public function setReadStatusEnabled(bool $readStatusEnabled): self { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * * @param bool $reachabilityEnabled Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * @return $this Fluent Builder */ public function setReachabilityEnabled(bool $reachabilityEnabled): self { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * * @param int $typingIndicatorTimeout How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * @return $this Fluent Builder */ public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * * @param int $consumptionReportInterval DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * @return $this Fluent Builder */ public function setConsumptionReportInterval(int $consumptionReportInterval): self { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * Whether to send a notification when a new message is added to a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsNewMessageEnabled Whether to send a notification when a new message is added to a channel. Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * * @param string $notificationsNewMessageTemplate The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * Whether to send a notification when a member is added to a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsAddedToChannelEnabled Whether to send a notification when a member is added to a channel. Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * * @param string $notificationsAddedToChannelTemplate The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * Whether to send a notification to a user when they are removed from a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsRemovedFromChannelEnabled Whether to send a notification to a user when they are removed from a channel. Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * * @param string $notificationsRemovedFromChannelTemplate The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * Whether to send a notification when a user is invited to a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsInvitedToChannelEnabled Whether to send a notification when a user is invited to a channel. Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * * @param string $notificationsInvitedToChannelTemplate The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * * @param string $preWebhookUrl The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * @return $this Fluent Builder */ public function setPreWebhookUrl(string $preWebhookUrl): self { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * * @param string $postWebhookUrl The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * @return $this Fluent Builder */ public function setPostWebhookUrl(string $postWebhookUrl): self { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $webhookMethod The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @return $this Fluent Builder */ public function setWebhookMethod(string $webhookMethod): self { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * The list of WebHook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string[] $webhookFilters The list of WebHook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * @return $this Fluent Builder */ public function setWebhookFilters(array $webhookFilters): self { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * The URL of the webhook to call in response to the `on_message_send` event using the `webhooks.on_message_send.method` HTTP method. * * @param string $webhooksOnMessageSendUrl The URL of the webhook to call in response to the `on_message_send` event using the `webhooks.on_message_send.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMessageSendUrl(string $webhooksOnMessageSendUrl): self { $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_send.url`. * * @param string $webhooksOnMessageSendMethod The HTTP method to use when calling the `webhooks.on_message_send.url`. * @return $this Fluent Builder */ public function setWebhooksOnMessageSendMethod(string $webhooksOnMessageSendMethod): self { $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_update` event using the `webhooks.on_message_update.method` HTTP method. * * @param string $webhooksOnMessageUpdateUrl The URL of the webhook to call in response to the `on_message_update` event using the `webhooks.on_message_update.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateUrl(string $webhooksOnMessageUpdateUrl): self { $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_update.url`. * * @param string $webhooksOnMessageUpdateMethod The HTTP method to use when calling the `webhooks.on_message_update.url`. * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateMethod(string $webhooksOnMessageUpdateMethod): self { $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_remove` event using the `webhooks.on_message_remove.method` HTTP method. * * @param string $webhooksOnMessageRemoveUrl The URL of the webhook to call in response to the `on_message_remove` event using the `webhooks.on_message_remove.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveUrl(string $webhooksOnMessageRemoveUrl): self { $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_remove.url`. * * @param string $webhooksOnMessageRemoveMethod The HTTP method to use when calling the `webhooks.on_message_remove.url`. * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveMethod(string $webhooksOnMessageRemoveMethod): self { $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_add` event using the `webhooks.on_channel_add.method` HTTP method. * * @param string $webhooksOnChannelAddUrl The URL of the webhook to call in response to the `on_channel_add` event using the `webhooks.on_channel_add.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnChannelAddUrl(string $webhooksOnChannelAddUrl): self { $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_add.url`. * * @param string $webhooksOnChannelAddMethod The HTTP method to use when calling the `webhooks.on_channel_add.url`. * @return $this Fluent Builder */ public function setWebhooksOnChannelAddMethod(string $webhooksOnChannelAddMethod): self { $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_destroy` event using the `webhooks.on_channel_destroy.method` HTTP method. * * @param string $webhooksOnChannelDestroyUrl The URL of the webhook to call in response to the `on_channel_destroy` event using the `webhooks.on_channel_destroy.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyUrl(string $webhooksOnChannelDestroyUrl): self { $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_destroy.url`. * * @param string $webhooksOnChannelDestroyMethod The HTTP method to use when calling the `webhooks.on_channel_destroy.url`. * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyMethod(string $webhooksOnChannelDestroyMethod): self { $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_update` event using the `webhooks.on_channel_update.method` HTTP method. * * @param string $webhooksOnChannelUpdateUrl The URL of the webhook to call in response to the `on_channel_update` event using the `webhooks.on_channel_update.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateUrl(string $webhooksOnChannelUpdateUrl): self { $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_update.url`. * * @param string $webhooksOnChannelUpdateMethod The HTTP method to use when calling the `webhooks.on_channel_update.url`. * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateMethod(string $webhooksOnChannelUpdateMethod): self { $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; return $this; } /** * The URL of the webhook to call in response to the `on_member_add` event using the `webhooks.on_member_add.method` HTTP method. * * @param string $webhooksOnMemberAddUrl The URL of the webhook to call in response to the `on_member_add` event using the `webhooks.on_member_add.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMemberAddUrl(string $webhooksOnMemberAddUrl): self { $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_member_add.url`. * * @param string $webhooksOnMemberAddMethod The HTTP method to use when calling the `webhooks.on_member_add.url`. * @return $this Fluent Builder */ public function setWebhooksOnMemberAddMethod(string $webhooksOnMemberAddMethod): self { $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; return $this; } /** * The URL of the webhook to call in response to the `on_member_remove` event using the `webhooks.on_member_remove.method` HTTP method. * * @param string $webhooksOnMemberRemoveUrl The URL of the webhook to call in response to the `on_member_remove` event using the `webhooks.on_member_remove.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveUrl(string $webhooksOnMemberRemoveUrl): self { $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_member_remove.url`. * * @param string $webhooksOnMemberRemoveMethod The HTTP method to use when calling the `webhooks.on_member_remove.url`. * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveMethod(string $webhooksOnMemberRemoveMethod): self { $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_sent` event using the `webhooks.on_message_sent.method` HTTP method. * * @param string $webhooksOnMessageSentUrl The URL of the webhook to call in response to the `on_message_sent` event using the `webhooks.on_message_sent.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMessageSentUrl(string $webhooksOnMessageSentUrl): self { $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; return $this; } /** * The URL of the webhook to call in response to the `on_message_sent` event`. * * @param string $webhooksOnMessageSentMethod The URL of the webhook to call in response to the `on_message_sent` event`. * @return $this Fluent Builder */ public function setWebhooksOnMessageSentMethod(string $webhooksOnMessageSentMethod): self { $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_updated` event using the `webhooks.on_message_updated.method` HTTP method. * * @param string $webhooksOnMessageUpdatedUrl The URL of the webhook to call in response to the `on_message_updated` event using the `webhooks.on_message_updated.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedUrl(string $webhooksOnMessageUpdatedUrl): self { $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_updated.url`. * * @param string $webhooksOnMessageUpdatedMethod The HTTP method to use when calling the `webhooks.on_message_updated.url`. * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedMethod(string $webhooksOnMessageUpdatedMethod): self { $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_removed` event using the `webhooks.on_message_removed.method` HTTP method. * * @param string $webhooksOnMessageRemovedUrl The URL of the webhook to call in response to the `on_message_removed` event using the `webhooks.on_message_removed.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedUrl(string $webhooksOnMessageRemovedUrl): self { $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_removed.url`. * * @param string $webhooksOnMessageRemovedMethod The HTTP method to use when calling the `webhooks.on_message_removed.url`. * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedMethod(string $webhooksOnMessageRemovedMethod): self { $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_added.method` HTTP method. * * @param string $webhooksOnChannelAddedUrl The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_added.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedUrl(string $webhooksOnChannelAddedUrl): self { $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; return $this; } /** * The URL of the webhook to call in response to the `on_channel_added` event`. * * @param string $webhooksOnChannelAddedMethod The URL of the webhook to call in response to the `on_channel_added` event`. * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedMethod(string $webhooksOnChannelAddedMethod): self { $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_destroyed.method` HTTP method. * * @param string $webhooksOnChannelDestroyedUrl The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_destroyed.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedUrl(string $webhooksOnChannelDestroyedUrl): self { $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_destroyed.url`. * * @param string $webhooksOnChannelDestroyedMethod The HTTP method to use when calling the `webhooks.on_channel_destroyed.url`. * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedMethod(string $webhooksOnChannelDestroyedMethod): self { $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * * @param string $webhooksOnChannelUpdatedUrl The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedUrl(string $webhooksOnChannelUpdatedUrl): self { $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * * @param string $webhooksOnChannelUpdatedMethod The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedMethod(string $webhooksOnChannelUpdatedMethod): self { $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * * @param string $webhooksOnMemberAddedUrl The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedUrl(string $webhooksOnMemberAddedUrl): self { $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * * @param string $webhooksOnMemberAddedMethod The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedMethod(string $webhooksOnMemberAddedMethod): self { $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_member_removed` event using the `webhooks.on_member_removed.method` HTTP method. * * @param string $webhooksOnMemberRemovedUrl The URL of the webhook to call in response to the `on_member_removed` event using the `webhooks.on_member_removed.method` HTTP method. * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedUrl(string $webhooksOnMemberRemovedUrl): self { $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_member_removed.url`. * * @param string $webhooksOnMemberRemovedMethod The HTTP method to use when calling the `webhooks.on_member_removed.url`. * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedMethod(string $webhooksOnMemberRemovedMethod): self { $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; return $this; } /** * The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * * @param int $limitsChannelMembers The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * @return $this Fluent Builder */ public function setLimitsChannelMembers(int $limitsChannelMembers): self { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. * * @param int $limitsUserChannels The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. * @return $this Fluent Builder */ public function setLimitsUserChannels(int $limitsUserChannels): self { $this->options['limitsUserChannels'] = $limitsUserChannels; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V1/CredentialContext.php 0000644 00000006547 15021223077 0015610 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param Version $version Version that contains the resource * @param string $sid The Twilio-provided string that uniquely identifies the Credential resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($sid) .''; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.CredentialContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/CredentialOptions.php 0000644 00000034355 15021223077 0015615 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return CreateCredentialOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ): CreateCredentialOptions { return new CreateCredentialOptions( $friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret ); } /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return UpdateCredentialOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ): UpdateCredentialOptions { return new UpdateCredentialOptions( $friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret ); } } class CreateCredentialOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. */ public function __construct( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.CreateCredentialOptions ' . $options . ']'; } } class UpdateCredentialOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. */ public function __construct( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Chat.V1.UpdateCredentialOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Chat/V1/CredentialInstance.php 0000644 00000010775 15021223077 0015726 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string $type * @property string|null $sandbox * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The Twilio-provided string that uniquely identifies the Credential resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'sandbox' => Values::array_get($payload, 'sandbox'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialContext Context for this CredentialInstance */ protected function proxy(): CredentialContext { if (!$this->context) { $this->context = new CredentialContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/ServiceContext.php 0000644 00000025752 15021223077 0015135 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Chat\V1\Service\ChannelList; use Twilio\Rest\Chat\V1\Service\RoleList; use Twilio\Rest\Chat\V1\Service\UserList; /** * @property ChannelList $channels * @property RoleList $roles * @property UserList $users * @method \Twilio\Rest\Chat\V1\Service\ChannelContext channels(string $sid) * @method \Twilio\Rest\Chat\V1\Service\RoleContext roles(string $sid) * @method \Twilio\Rest\Chat\V1\Service\UserContext users(string $sid) */ class ServiceContext extends InstanceContext { protected $_channels; protected $_roles; protected $_users; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The Twilio-provided string that uniquely identifies the Service resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) .''; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DefaultServiceRoleSid' => $options['defaultServiceRoleSid'], 'DefaultChannelRoleSid' => $options['defaultChannelRoleSid'], 'DefaultChannelCreatorRoleSid' => $options['defaultChannelCreatorRoleSid'], 'ReadStatusEnabled' => Serialize::booleanToString($options['readStatusEnabled']), 'ReachabilityEnabled' => Serialize::booleanToString($options['reachabilityEnabled']), 'TypingIndicatorTimeout' => $options['typingIndicatorTimeout'], 'ConsumptionReportInterval' => $options['consumptionReportInterval'], 'Notifications.NewMessage.Enabled' => Serialize::booleanToString($options['notificationsNewMessageEnabled']), 'Notifications.NewMessage.Template' => $options['notificationsNewMessageTemplate'], 'Notifications.AddedToChannel.Enabled' => Serialize::booleanToString($options['notificationsAddedToChannelEnabled']), 'Notifications.AddedToChannel.Template' => $options['notificationsAddedToChannelTemplate'], 'Notifications.RemovedFromChannel.Enabled' => Serialize::booleanToString($options['notificationsRemovedFromChannelEnabled']), 'Notifications.RemovedFromChannel.Template' => $options['notificationsRemovedFromChannelTemplate'], 'Notifications.InvitedToChannel.Enabled' => Serialize::booleanToString($options['notificationsInvitedToChannelEnabled']), 'Notifications.InvitedToChannel.Template' => $options['notificationsInvitedToChannelTemplate'], 'PreWebhookUrl' => $options['preWebhookUrl'], 'PostWebhookUrl' => $options['postWebhookUrl'], 'WebhookMethod' => $options['webhookMethod'], 'WebhookFilters' => Serialize::map($options['webhookFilters'], function ($e) { return $e; }), 'Webhooks.OnMessageSend.Url' => $options['webhooksOnMessageSendUrl'], 'Webhooks.OnMessageSend.Method' => $options['webhooksOnMessageSendMethod'], 'Webhooks.OnMessageUpdate.Url' => $options['webhooksOnMessageUpdateUrl'], 'Webhooks.OnMessageUpdate.Method' => $options['webhooksOnMessageUpdateMethod'], 'Webhooks.OnMessageRemove.Url' => $options['webhooksOnMessageRemoveUrl'], 'Webhooks.OnMessageRemove.Method' => $options['webhooksOnMessageRemoveMethod'], 'Webhooks.OnChannelAdd.Url' => $options['webhooksOnChannelAddUrl'], 'Webhooks.OnChannelAdd.Method' => $options['webhooksOnChannelAddMethod'], 'Webhooks.OnChannelDestroy.Url' => $options['webhooksOnChannelDestroyUrl'], 'Webhooks.OnChannelDestroy.Method' => $options['webhooksOnChannelDestroyMethod'], 'Webhooks.OnChannelUpdate.Url' => $options['webhooksOnChannelUpdateUrl'], 'Webhooks.OnChannelUpdate.Method' => $options['webhooksOnChannelUpdateMethod'], 'Webhooks.OnMemberAdd.Url' => $options['webhooksOnMemberAddUrl'], 'Webhooks.OnMemberAdd.Method' => $options['webhooksOnMemberAddMethod'], 'Webhooks.OnMemberRemove.Url' => $options['webhooksOnMemberRemoveUrl'], 'Webhooks.OnMemberRemove.Method' => $options['webhooksOnMemberRemoveMethod'], 'Webhooks.OnMessageSent.Url' => $options['webhooksOnMessageSentUrl'], 'Webhooks.OnMessageSent.Method' => $options['webhooksOnMessageSentMethod'], 'Webhooks.OnMessageUpdated.Url' => $options['webhooksOnMessageUpdatedUrl'], 'Webhooks.OnMessageUpdated.Method' => $options['webhooksOnMessageUpdatedMethod'], 'Webhooks.OnMessageRemoved.Url' => $options['webhooksOnMessageRemovedUrl'], 'Webhooks.OnMessageRemoved.Method' => $options['webhooksOnMessageRemovedMethod'], 'Webhooks.OnChannelAdded.Url' => $options['webhooksOnChannelAddedUrl'], 'Webhooks.OnChannelAdded.Method' => $options['webhooksOnChannelAddedMethod'], 'Webhooks.OnChannelDestroyed.Url' => $options['webhooksOnChannelDestroyedUrl'], 'Webhooks.OnChannelDestroyed.Method' => $options['webhooksOnChannelDestroyedMethod'], 'Webhooks.OnChannelUpdated.Url' => $options['webhooksOnChannelUpdatedUrl'], 'Webhooks.OnChannelUpdated.Method' => $options['webhooksOnChannelUpdatedMethod'], 'Webhooks.OnMemberAdded.Url' => $options['webhooksOnMemberAddedUrl'], 'Webhooks.OnMemberAdded.Method' => $options['webhooksOnMemberAddedMethod'], 'Webhooks.OnMemberRemoved.Url' => $options['webhooksOnMemberRemovedUrl'], 'Webhooks.OnMemberRemoved.Method' => $options['webhooksOnMemberRemovedMethod'], 'Limits.ChannelMembers' => $options['limitsChannelMembers'], 'Limits.UserChannels' => $options['limitsUserChannels'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the channels */ protected function getChannels(): ChannelList { if (!$this->_channels) { $this->_channels = new ChannelList( $this->version, $this->solution['sid'] ); } return $this->_channels; } /** * Access the roles */ protected function getRoles(): RoleList { if (!$this->_roles) { $this->_roles = new RoleList( $this->version, $this->solution['sid'] ); } return $this->_roles; } /** * Access the users */ protected function getUsers(): UserList { if (!$this->_users) { $this->_users = new UserList( $this->version, $this->solution['sid'] ); } return $this->_users; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/ServicePage.php 0000644 00000003002 15021223077 0014345 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ServiceInstance \Twilio\Rest\Chat\V1\ServiceInstance */ public function buildInstance(array $payload): ServiceInstance { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.ServicePage]'; } } sdk/src/Twilio/Rest/Chat/V1/CredentialPage.php 0000644 00000003024 15021223077 0015023 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CredentialInstance \Twilio\Rest\Chat\V1\CredentialInstance */ public function buildInstance(array $payload): CredentialInstance { return new CredentialInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.CredentialPage]'; } } sdk/src/Twilio/Rest/Chat/V1/CredentialList.php 0000644 00000014441 15021223077 0015067 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Credentials'; } /** * Create the CredentialInstance * * @param string $type * @param array|Options $options Optional Arguments * @return CredentialInstance Created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): CredentialInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload ); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialPage Page of CredentialInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialPage Page of CredentialInstance */ public function getPage(string $targetUrl): CredentialPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Constructs a CredentialContext * * @param string $sid The Twilio-provided string that uniquely identifies the Credential resource to delete. */ public function getContext( string $sid ): CredentialContext { return new CredentialContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1.CredentialList]'; } } sdk/src/Twilio/Rest/Chat/V1.php 0000644 00000005666 15021223077 0012172 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Chat * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Chat; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Chat\V1\CredentialList; use Twilio\Rest\Chat\V1\ServiceList; use Twilio\Version; /** * @property CredentialList $credentials * @property ServiceList $services * @method \Twilio\Rest\Chat\V1\CredentialContext credentials(string $sid) * @method \Twilio\Rest\Chat\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_credentials; protected $_services; /** * Construct the V1 version of Chat * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getCredentials(): CredentialList { if (!$this->_credentials) { $this->_credentials = new CredentialList($this); } return $this->_credentials; } protected function getServices(): ServiceList { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat.V1]'; } } sdk/src/Twilio/Rest/ServerlessBase.php 0000644 00000004556 15021223077 0013752 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Serverless\V1; /** * @property \Twilio\Rest\Serverless\V1 $v1 */ class ServerlessBase extends Domain { protected $_v1; /** * Construct the Serverless Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://serverless.twilio.com'; } /** * @return V1 Version v1 of serverless */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Serverless]'; } } sdk/src/Twilio/Rest/MessagingBase.php 0000644 00000004547 15021223077 0013532 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Messaging\V1; /** * @property \Twilio\Rest\Messaging\V1 $v1 */ class MessagingBase extends Domain { protected $_v1; /** * Construct the Messaging Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://messaging.twilio.com'; } /** * @return V1 Version v1 of messaging */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Messaging]'; } } sdk/src/Twilio/Rest/MicrovisorBase.php 0000644 00000004556 15021223077 0013751 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Microvisor\V1; /** * @property \Twilio\Rest\Microvisor\V1 $v1 */ class MicrovisorBase extends Domain { protected $_v1; /** * Construct the Microvisor Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://microvisor.twilio.com'; } /** * @return V1 Version v1 of microvisor */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Microvisor]'; } } sdk/src/Twilio/Rest/Api/V2010.php 0000644 00000025420 15021223077 0012234 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\AccountInstance; use Twilio\Rest\Api\V2010\AccountList; use Twilio\Rest\Api\V2010\AccountContext; use Twilio\Version; /** * @property AccountList $accounts * @property AccountContext $account * @property \Twilio\Rest\Api\V2010\Account\RecordingList $recordings * @property \Twilio\Rest\Api\V2010\Account\UsageList $usage * @property \Twilio\Rest\Api\V2010\Account\MessageList $messages * @property \Twilio\Rest\Api\V2010\Account\KeyList $keys * @property \Twilio\Rest\Api\V2010\Account\NewKeyList $newKeys * @property \Twilio\Rest\Api\V2010\Account\ApplicationList $applications * @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList $incomingPhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\ConferenceList $conferences * @property \Twilio\Rest\Api\V2010\Account\CallList $calls * @property \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList $outgoingCallerIds * @property \Twilio\Rest\Api\V2010\Account\ValidationRequestList $validationRequests * @property \Twilio\Rest\Api\V2010\Account\TranscriptionList $transcriptions * @property \Twilio\Rest\Api\V2010\Account\ConnectAppList $connectApps * @property \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList $authorizedConnectApps * @property \Twilio\Rest\Api\V2010\Account\TokenList $tokens * @property \Twilio\Rest\Api\V2010\Account\BalanceList $balance * @property \Twilio\Rest\Api\V2010\Account\SipList $sip * @property \Twilio\Rest\Api\V2010\Account\NotificationList $notifications * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList $availablePhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\AddressList $addresses * @property \Twilio\Rest\Api\V2010\Account\QueueList $queues * @property \Twilio\Rest\Api\V2010\Account\ShortCodeList $shortCodes * @property \Twilio\Rest\Api\V2010\Account\SigningKeyList $signingKeys * @property \Twilio\Rest\Api\V2010\Account\NewSigningKeyList $newSigningKeys * @method \Twilio\Rest\Api\V2010\AccountContext accounts(string $sid) * @method \Twilio\Rest\Api\V2010\Account\AddressContext addresses(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ApplicationContext applications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext authorizedConnectApps(string $connectAppSid) * @method \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext availablePhoneNumbers(string $countryCode) * @method \Twilio\Rest\Api\V2010\Account\CallContext calls(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid) * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid) * @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid) * @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid) * @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid) * @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ShortCodeContext shortCodes(string $sid) * @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid) */ class V2010 extends Version { protected $_accounts; protected $_account = null; protected $_recordings = null; protected $_usage = null; protected $_messages = null; protected $_keys = null; protected $_newKeys = null; protected $_applications = null; protected $_incomingPhoneNumbers = null; protected $_conferences = null; protected $_calls = null; protected $_outgoingCallerIds = null; protected $_validationRequests = null; protected $_transcriptions = null; protected $_connectApps = null; protected $_authorizedConnectApps = null; protected $_tokens = null; protected $_balance = null; protected $_sip = null; protected $_notifications = null; protected $_availablePhoneNumbers = null; protected $_addresses = null; protected $_queues = null; protected $_shortCodes = null; protected $_signingKeys = null; protected $_newSigningKeys = null; /** * Construct the V2010 version of Api * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = '2010-04-01'; } protected function getAccounts(): AccountList { if (!$this->_accounts) { $this->_accounts = new AccountList($this); } return $this->_accounts; } /** * @return AccountContext Account provided as the authenticating account */ protected function getAccount(): AccountContext { if (!$this->_account) { $this->_account = new AccountContext( $this, $this->domain->getClient()->getAccountSid() ); } return $this->_account; } /** * Setter to override the primary account * * @param AccountContext|AccountInstance $account account to use as the primary * account */ public function setAccount($account): void { $this->_account = $account; } protected function getRecordings(): \Twilio\Rest\Api\V2010\Account\RecordingList { return $this->account->recordings; } protected function getUsage(): \Twilio\Rest\Api\V2010\Account\UsageList { return $this->account->usage; } protected function getMessages(): \Twilio\Rest\Api\V2010\Account\MessageList { return $this->account->messages; } protected function getKeys(): \Twilio\Rest\Api\V2010\Account\KeyList { return $this->account->keys; } protected function getNewKeys(): \Twilio\Rest\Api\V2010\Account\NewKeyList { return $this->account->newKeys; } protected function getApplications(): \Twilio\Rest\Api\V2010\Account\ApplicationList { return $this->account->applications; } protected function getIncomingPhoneNumbers(): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList { return $this->account->incomingPhoneNumbers; } protected function getConferences(): \Twilio\Rest\Api\V2010\Account\ConferenceList { return $this->account->conferences; } protected function getCalls(): \Twilio\Rest\Api\V2010\Account\CallList { return $this->account->calls; } protected function getOutgoingCallerIds(): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList { return $this->account->outgoingCallerIds; } protected function getValidationRequests(): \Twilio\Rest\Api\V2010\Account\ValidationRequestList { return $this->account->validationRequests; } protected function getTranscriptions(): \Twilio\Rest\Api\V2010\Account\TranscriptionList { return $this->account->transcriptions; } protected function getConnectApps(): \Twilio\Rest\Api\V2010\Account\ConnectAppList { return $this->account->connectApps; } protected function getAuthorizedConnectApps(): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList { return $this->account->authorizedConnectApps; } protected function getTokens(): \Twilio\Rest\Api\V2010\Account\TokenList { return $this->account->tokens; } protected function getBalance(): \Twilio\Rest\Api\V2010\Account\BalanceList { return $this->account->balance; } protected function getSip(): \Twilio\Rest\Api\V2010\Account\SipList { return $this->account->sip; } protected function getNotifications(): \Twilio\Rest\Api\V2010\Account\NotificationList { return $this->account->notifications; } protected function getAvailablePhoneNumbers(): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList { return $this->account->availablePhoneNumbers; } protected function getAddresses(): \Twilio\Rest\Api\V2010\Account\AddressList { return $this->account->addresses; } protected function getQueues(): \Twilio\Rest\Api\V2010\Account\QueueList { return $this->account->queues; } protected function getShortCodes(): \Twilio\Rest\Api\V2010\Account\ShortCodeList { return $this->account->shortCodes; } protected function getSigningKeys(): \Twilio\Rest\Api\V2010\Account\SigningKeyList { return $this->account->signingKeys; } protected function getNewSigningKeys(): \Twilio\Rest\Api\V2010\Account\NewSigningKeyList { return $this->account->newSigningKeys; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010]'; } } sdk/src/Twilio/Rest/Api/V2010/AccountContext.php 0000644 00000040111 15021223077 0015167 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\RecordingList; use Twilio\Rest\Api\V2010\Account\UsageList; use Twilio\Rest\Api\V2010\Account\MessageList; use Twilio\Rest\Api\V2010\Account\KeyList; use Twilio\Rest\Api\V2010\Account\NewKeyList; use Twilio\Rest\Api\V2010\Account\ApplicationList; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList; use Twilio\Rest\Api\V2010\Account\ConferenceList; use Twilio\Rest\Api\V2010\Account\CallList; use Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList; use Twilio\Rest\Api\V2010\Account\ValidationRequestList; use Twilio\Rest\Api\V2010\Account\TranscriptionList; use Twilio\Rest\Api\V2010\Account\ConnectAppList; use Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList; use Twilio\Rest\Api\V2010\Account\TokenList; use Twilio\Rest\Api\V2010\Account\BalanceList; use Twilio\Rest\Api\V2010\Account\SipList; use Twilio\Rest\Api\V2010\Account\NotificationList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList; use Twilio\Rest\Api\V2010\Account\AddressList; use Twilio\Rest\Api\V2010\Account\QueueList; use Twilio\Rest\Api\V2010\Account\ShortCodeList; use Twilio\Rest\Api\V2010\Account\SigningKeyList; use Twilio\Rest\Api\V2010\Account\NewSigningKeyList; /** * @property RecordingList $recordings * @property UsageList $usage * @property MessageList $messages * @property KeyList $keys * @property NewKeyList $newKeys * @property ApplicationList $applications * @property IncomingPhoneNumberList $incomingPhoneNumbers * @property ConferenceList $conferences * @property CallList $calls * @property OutgoingCallerIdList $outgoingCallerIds * @property ValidationRequestList $validationRequests * @property TranscriptionList $transcriptions * @property ConnectAppList $connectApps * @property AuthorizedConnectAppList $authorizedConnectApps * @property TokenList $tokens * @property BalanceList $balance * @property SipList $sip * @property NotificationList $notifications * @property AvailablePhoneNumberCountryList $availablePhoneNumbers * @property AddressList $addresses * @property QueueList $queues * @property ShortCodeList $shortCodes * @property SigningKeyList $signingKeys * @property NewSigningKeyList $newSigningKeys * @method \Twilio\Rest\Api\V2010\Account\ApplicationContext applications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid) * @method \Twilio\Rest\Api\V2010\Account\CallContext calls(string $sid) * @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ShortCodeContext shortCodes(string $sid) * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid) * @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid) * @method \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext authorizedConnectApps(string $connectAppSid) * @method \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext availablePhoneNumbers(string $countryCode) * @method \Twilio\Rest\Api\V2010\Account\AddressContext addresses(string $sid) * @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid) * @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid) */ class AccountContext extends InstanceContext { protected $_recordings; protected $_usage; protected $_messages; protected $_keys; protected $_newKeys; protected $_applications; protected $_incomingPhoneNumbers; protected $_conferences; protected $_calls; protected $_outgoingCallerIds; protected $_validationRequests; protected $_transcriptions; protected $_connectApps; protected $_authorizedConnectApps; protected $_tokens; protected $_balance; protected $_sip; protected $_notifications; protected $_availablePhoneNumbers; protected $_addresses; protected $_queues; protected $_shortCodes; protected $_signingKeys; protected $_newSigningKeys; /** * Initialize the AccountContext * * @param Version $version Version that contains the resource * @param string $sid The Account Sid that uniquely identifies the account to fetch */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($sid) .'.json'; } /** * Fetch the AccountInstance * * @return AccountInstance Fetched AccountInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AccountInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AccountInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the AccountInstance * * @param array|Options $options Optional Arguments * @return AccountInstance Updated AccountInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AccountInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'Status' => $options['status'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AccountInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the recordings */ protected function getRecordings(): RecordingList { if (!$this->_recordings) { $this->_recordings = new RecordingList( $this->version, $this->solution['sid'] ); } return $this->_recordings; } /** * Access the usage */ protected function getUsage(): UsageList { if (!$this->_usage) { $this->_usage = new UsageList( $this->version, $this->solution['sid'] ); } return $this->_usage; } /** * Access the messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['sid'] ); } return $this->_messages; } /** * Access the keys */ protected function getKeys(): KeyList { if (!$this->_keys) { $this->_keys = new KeyList( $this->version, $this->solution['sid'] ); } return $this->_keys; } /** * Access the newKeys */ protected function getNewKeys(): NewKeyList { if (!$this->_newKeys) { $this->_newKeys = new NewKeyList( $this->version, $this->solution['sid'] ); } return $this->_newKeys; } /** * Access the applications */ protected function getApplications(): ApplicationList { if (!$this->_applications) { $this->_applications = new ApplicationList( $this->version, $this->solution['sid'] ); } return $this->_applications; } /** * Access the incomingPhoneNumbers */ protected function getIncomingPhoneNumbers(): IncomingPhoneNumberList { if (!$this->_incomingPhoneNumbers) { $this->_incomingPhoneNumbers = new IncomingPhoneNumberList( $this->version, $this->solution['sid'] ); } return $this->_incomingPhoneNumbers; } /** * Access the conferences */ protected function getConferences(): ConferenceList { if (!$this->_conferences) { $this->_conferences = new ConferenceList( $this->version, $this->solution['sid'] ); } return $this->_conferences; } /** * Access the calls */ protected function getCalls(): CallList { if (!$this->_calls) { $this->_calls = new CallList( $this->version, $this->solution['sid'] ); } return $this->_calls; } /** * Access the outgoingCallerIds */ protected function getOutgoingCallerIds(): OutgoingCallerIdList { if (!$this->_outgoingCallerIds) { $this->_outgoingCallerIds = new OutgoingCallerIdList( $this->version, $this->solution['sid'] ); } return $this->_outgoingCallerIds; } /** * Access the validationRequests */ protected function getValidationRequests(): ValidationRequestList { if (!$this->_validationRequests) { $this->_validationRequests = new ValidationRequestList( $this->version, $this->solution['sid'] ); } return $this->_validationRequests; } /** * Access the transcriptions */ protected function getTranscriptions(): TranscriptionList { if (!$this->_transcriptions) { $this->_transcriptions = new TranscriptionList( $this->version, $this->solution['sid'] ); } return $this->_transcriptions; } /** * Access the connectApps */ protected function getConnectApps(): ConnectAppList { if (!$this->_connectApps) { $this->_connectApps = new ConnectAppList( $this->version, $this->solution['sid'] ); } return $this->_connectApps; } /** * Access the authorizedConnectApps */ protected function getAuthorizedConnectApps(): AuthorizedConnectAppList { if (!$this->_authorizedConnectApps) { $this->_authorizedConnectApps = new AuthorizedConnectAppList( $this->version, $this->solution['sid'] ); } return $this->_authorizedConnectApps; } /** * Access the tokens */ protected function getTokens(): TokenList { if (!$this->_tokens) { $this->_tokens = new TokenList( $this->version, $this->solution['sid'] ); } return $this->_tokens; } /** * Access the balance */ protected function getBalance(): BalanceList { if (!$this->_balance) { $this->_balance = new BalanceList( $this->version, $this->solution['sid'] ); } return $this->_balance; } /** * Access the sip */ protected function getSip(): SipList { if (!$this->_sip) { $this->_sip = new SipList( $this->version, $this->solution['sid'] ); } return $this->_sip; } /** * Access the notifications */ protected function getNotifications(): NotificationList { if (!$this->_notifications) { $this->_notifications = new NotificationList( $this->version, $this->solution['sid'] ); } return $this->_notifications; } /** * Access the availablePhoneNumbers */ protected function getAvailablePhoneNumbers(): AvailablePhoneNumberCountryList { if (!$this->_availablePhoneNumbers) { $this->_availablePhoneNumbers = new AvailablePhoneNumberCountryList( $this->version, $this->solution['sid'] ); } return $this->_availablePhoneNumbers; } /** * Access the addresses */ protected function getAddresses(): AddressList { if (!$this->_addresses) { $this->_addresses = new AddressList( $this->version, $this->solution['sid'] ); } return $this->_addresses; } /** * Access the queues */ protected function getQueues(): QueueList { if (!$this->_queues) { $this->_queues = new QueueList( $this->version, $this->solution['sid'] ); } return $this->_queues; } /** * Access the shortCodes */ protected function getShortCodes(): ShortCodeList { if (!$this->_shortCodes) { $this->_shortCodes = new ShortCodeList( $this->version, $this->solution['sid'] ); } return $this->_shortCodes; } /** * Access the signingKeys */ protected function getSigningKeys(): SigningKeyList { if (!$this->_signingKeys) { $this->_signingKeys = new SigningKeyList( $this->version, $this->solution['sid'] ); } return $this->_signingKeys; } /** * Access the newSigningKeys */ protected function getNewSigningKeys(): NewSigningKeyList { if (!$this->_newSigningKeys) { $this->_newSigningKeys = new NewSigningKeyList( $this->version, $this->solution['sid'] ); } return $this->_newSigningKeys; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AccountContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/AccountOptions.php 0000644 00000014224 15021223077 0015204 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010; use Twilio\Options; use Twilio\Values; abstract class AccountOptions { /** * @param string $friendlyName A human readable description of the account to create, defaults to `SubAccount Created at {YYYY-MM-DD HH:MM meridian}` * @return CreateAccountOptions Options builder */ public static function create( string $friendlyName = Values::NONE ): CreateAccountOptions { return new CreateAccountOptions( $friendlyName ); } /** * @param string $friendlyName Only return the Account resources with friendly names that exactly match this name. * @param string $status Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. * @return ReadAccountOptions Options builder */ public static function read( string $friendlyName = Values::NONE, string $status = Values::NONE ): ReadAccountOptions { return new ReadAccountOptions( $friendlyName, $status ); } /** * @param string $friendlyName Update the human-readable description of this Account * @param string $status * @return UpdateAccountOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $status = Values::NONE ): UpdateAccountOptions { return new UpdateAccountOptions( $friendlyName, $status ); } } class CreateAccountOptions extends Options { /** * @param string $friendlyName A human readable description of the account to create, defaults to `SubAccount Created at {YYYY-MM-DD HH:MM meridian}` */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A human readable description of the account to create, defaults to `SubAccount Created at {YYYY-MM-DD HH:MM meridian}` * * @param string $friendlyName A human readable description of the account to create, defaults to `SubAccount Created at {YYYY-MM-DD HH:MM meridian}` * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateAccountOptions ' . $options . ']'; } } class ReadAccountOptions extends Options { /** * @param string $friendlyName Only return the Account resources with friendly names that exactly match this name. * @param string $status Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. */ public function __construct( string $friendlyName = Values::NONE, string $status = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['status'] = $status; } /** * Only return the Account resources with friendly names that exactly match this name. * * @param string $friendlyName Only return the Account resources with friendly names that exactly match this name. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. * * @param string $status Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadAccountOptions ' . $options . ']'; } } class UpdateAccountOptions extends Options { /** * @param string $friendlyName Update the human-readable description of this Account * @param string $status */ public function __construct( string $friendlyName = Values::NONE, string $status = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['status'] = $status; } /** * Update the human-readable description of this Account * * @param string $friendlyName Update the human-readable description of this Account * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateAccountOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/AccountPage.php 0000644 00000003007 15021223077 0014422 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AccountPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AccountInstance \Twilio\Rest\Api\V2010\AccountInstance */ public function buildInstance(array $payload): AccountInstance { return new AccountInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AccountPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryList.php 0000644 00000013631 15021223077 0022074 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AvailablePhoneNumberCountryList extends ListResource { /** * Construct the AvailablePhoneNumberCountryList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the available phone number Country resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers.json'; } /** * Reads AvailablePhoneNumberCountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AvailablePhoneNumberCountryInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AvailablePhoneNumberCountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AvailablePhoneNumberCountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AvailablePhoneNumberCountryPage Page of AvailablePhoneNumberCountryInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AvailablePhoneNumberCountryPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AvailablePhoneNumberCountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AvailablePhoneNumberCountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AvailablePhoneNumberCountryPage Page of AvailablePhoneNumberCountryInstance */ public function getPage(string $targetUrl): AvailablePhoneNumberCountryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AvailablePhoneNumberCountryPage($this->version, $response, $this->solution); } /** * Constructs a AvailablePhoneNumberCountryContext * * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country to fetch available phone number information about. */ public function getContext( string $countryCode ): AvailablePhoneNumberCountryContext { return new AvailablePhoneNumberCountryContext( $this->version, $this->solution['accountSid'], $countryCode ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AvailablePhoneNumberCountryList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConferencePage.php 0000644 00000003110 15021223077 0016464 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConferencePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ConferenceInstance \Twilio\Rest\Api\V2010\Account\ConferenceInstance */ public function buildInstance(array $payload): ConferenceInstance { return new ConferenceInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ConferencePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyList.php 0000644 00000012446 15021223077 0016537 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SigningKeyList extends ListResource { /** * Construct the SigningKeyList * * @param Version $version Version that contains the resource * @param string $accountSid */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SigningKeys.json'; } /** * Reads SigningKeyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SigningKeyInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SigningKeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SigningKeyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SigningKeyPage Page of SigningKeyInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SigningKeyPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SigningKeyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SigningKeyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SigningKeyPage Page of SigningKeyInstance */ public function getPage(string $targetUrl): SigningKeyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SigningKeyPage($this->version, $response, $this->solution); } /** * Constructs a SigningKeyContext * * @param string $sid */ public function getContext( string $sid ): SigningKeyContext { return new SigningKeyContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.SigningKeyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/RecordingOptions.php 0000644 00000030502 15021223077 0017115 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class RecordingOptions { /** * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. * @return FetchRecordingOptions Options builder */ public static function fetch( bool $includeSoftDeleted = Values::BOOL_NONE ): FetchRecordingOptions { return new FetchRecordingOptions( $includeSoftDeleted ); } /** * @param string $dateCreatedBefore Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @param string $dateCreated Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @param string $dateCreatedAfter Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. * @param string $conferenceSid The Conference SID that identifies the conference associated with the recording to read. * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. * @return ReadRecordingOptions Options builder */ public static function read( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null, string $callSid = Values::NONE, string $conferenceSid = Values::NONE, bool $includeSoftDeleted = Values::BOOL_NONE ): ReadRecordingOptions { return new ReadRecordingOptions( $dateCreatedBefore, $dateCreated, $dateCreatedAfter, $callSid, $conferenceSid, $includeSoftDeleted ); } } class FetchRecordingOptions extends Options { /** * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. */ public function __construct( bool $includeSoftDeleted = Values::BOOL_NONE ) { $this->options['includeSoftDeleted'] = $includeSoftDeleted; } /** * A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. * * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. * @return $this Fluent Builder */ public function setIncludeSoftDeleted(bool $includeSoftDeleted): self { $this->options['includeSoftDeleted'] = $includeSoftDeleted; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.FetchRecordingOptions ' . $options . ']'; } } class ReadRecordingOptions extends Options { /** * @param string $dateCreatedBefore Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @param string $dateCreated Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @param string $dateCreatedAfter Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. * @param string $conferenceSid The Conference SID that identifies the conference associated with the recording to read. * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. */ public function __construct( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null, string $callSid = Values::NONE, string $conferenceSid = Values::NONE, bool $includeSoftDeleted = Values::BOOL_NONE ) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['callSid'] = $callSid; $this->options['conferenceSid'] = $conferenceSid; $this->options['includeSoftDeleted'] = $includeSoftDeleted; } /** * Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * * @param string $dateCreatedBefore Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @return $this Fluent Builder */ public function setDateCreatedBefore(string $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * * @param string $dateCreated Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @return $this Fluent Builder */ public function setDateCreated(string $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * * @param string $dateCreatedAfter Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * @return $this Fluent Builder */ public function setDateCreatedAfter(string $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. * * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. * @return $this Fluent Builder */ public function setCallSid(string $callSid): self { $this->options['callSid'] = $callSid; return $this; } /** * The Conference SID that identifies the conference associated with the recording to read. * * @param string $conferenceSid The Conference SID that identifies the conference associated with the recording to read. * @return $this Fluent Builder */ public function setConferenceSid(string $conferenceSid): self { $this->options['conferenceSid'] = $conferenceSid; return $this; } /** * A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. * * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. * @return $this Fluent Builder */ public function setIncludeSoftDeleted(bool $includeSoftDeleted): self { $this->options['includeSoftDeleted'] = $includeSoftDeleted; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadRecordingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/QueueContext.php 0000644 00000012000 15021223077 0016247 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Queue\MemberList; /** * @property MemberList $members * @method \Twilio\Rest\Api\V2010\Account\Queue\MemberContext members(string $callSid) */ class QueueContext extends InstanceContext { protected $_members; /** * Initialize the QueueContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $sid The Twilio-provided string that uniquely identifies the Queue resource to delete */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Queues/' . \rawurlencode($sid) .'.json'; } /** * Delete the QueueInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the QueueInstance * * @return QueueInstance Fetched QueueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): QueueInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new QueueInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the QueueInstance * * @param array|Options $options Optional Arguments * @return QueueInstance Updated QueueInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): QueueInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'MaxSize' => $options['maxSize'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new QueueInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the members */ protected function getMembers(): MemberList { if (!$this->_members) { $this->_members = new MemberList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_members; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.QueueContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/BalanceInstance.php 0000644 00000004467 15021223077 0016652 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $balance * @property string|null $currency */ class BalanceInstance extends InstanceResource { /** * Initialize the BalanceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique SID identifier of the Account. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'balance' => Values::array_get($payload, 'balance'), 'currency' => Values::array_get($payload, 'currency'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.BalanceInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppPage.php 0000644 00000003204 15021223077 0020512 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthorizedConnectAppPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AuthorizedConnectAppInstance \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppInstance */ public function buildInstance(array $payload): AuthorizedConnectAppInstance { return new AuthorizedConnectAppInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthorizedConnectAppPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionContext.php 0000644 00000005222 15021223077 0020032 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class TranscriptionContext extends InstanceContext { /** * Initialize the TranscriptionContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resources to delete. * @param string $sid The Twilio-provided string that uniquely identifies the Transcription resource to delete. */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Transcriptions/' . \rawurlencode($sid) .'.json'; } /** * Delete the TranscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the TranscriptionInstance * * @return TranscriptionInstance Fetched TranscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TranscriptionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new TranscriptionInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.TranscriptionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/MessageInstance.php 0000644 00000014533 15021223077 0016704 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Api\V2010\Account\Message\FeedbackList; use Twilio\Rest\Api\V2010\Account\Message\MediaList; /** * @property string|null $body * @property string|null $numSegments * @property string $direction * @property string|null $from * @property string|null $to * @property \DateTime|null $dateUpdated * @property string|null $price * @property string|null $errorMessage * @property string|null $uri * @property string|null $accountSid * @property string|null $numMedia * @property string $status * @property string|null $messagingServiceSid * @property string|null $sid * @property \DateTime|null $dateSent * @property \DateTime|null $dateCreated * @property int|null $errorCode * @property string|null $priceUnit * @property string|null $apiVersion * @property array|null $subresourceUris */ class MessageInstance extends InstanceResource { protected $_feedback; protected $_media; /** * Initialize the MessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) creating the Message resource. * @param string $sid The SID of the Message resource you wish to delete */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'body' => Values::array_get($payload, 'body'), 'numSegments' => Values::array_get($payload, 'num_segments'), 'direction' => Values::array_get($payload, 'direction'), 'from' => Values::array_get($payload, 'from'), 'to' => Values::array_get($payload, 'to'), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'price' => Values::array_get($payload, 'price'), 'errorMessage' => Values::array_get($payload, 'error_message'), 'uri' => Values::array_get($payload, 'uri'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'numMedia' => Values::array_get($payload, 'num_media'), 'status' => Values::array_get($payload, 'status'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'dateSent' => Deserialize::dateTime(Values::array_get($payload, 'date_sent')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'errorCode' => Values::array_get($payload, 'error_code'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessageContext Context for this MessageInstance */ protected function proxy(): MessageContext { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MessageInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { return $this->proxy()->update($options); } /** * Access the feedback */ protected function getFeedback(): FeedbackList { return $this->proxy()->feedback; } /** * Access the media */ protected function getMedia(): MediaList { return $this->proxy()->media; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyList.php 0000644 00000004362 15021223077 0017207 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class NewSigningKeyList extends ListResource { /** * Construct the NewSigningKeyList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will be responsible for the new Key resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SigningKeys.json'; } /** * Create the NewSigningKeyInstance * * @param array|Options $options Optional Arguments * @return NewSigningKeyInstance Created NewSigningKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): NewSigningKeyInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new NewSigningKeyInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NewSigningKeyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationContext.php 0000644 00000011130 15021223077 0017431 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class ApplicationContext extends InstanceContext { /** * Initialize the ApplicationContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $sid The Twilio-provided string that uniquely identifies the Application resource to delete. */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Applications/' . \rawurlencode($sid) .'.json'; } /** * Delete the ApplicationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ApplicationInstance * * @return ApplicationInstance Fetched ApplicationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ApplicationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ApplicationInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the ApplicationInstance * * @param array|Options $options Optional Arguments * @return ApplicationInstance Updated ApplicationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ApplicationInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'ApiVersion' => $options['apiVersion'], 'VoiceUrl' => $options['voiceUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'SmsUrl' => $options['smsUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsStatusCallback' => $options['smsStatusCallback'], 'MessageStatusCallback' => $options['messageStatusCallback'], 'PublicApplicationConnectEnabled' => Serialize::booleanToString($options['publicApplicationConnectEnabled']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ApplicationInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ApplicationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationInstance.php 0000644 00000014647 15021223077 0017571 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string|null $messageStatusCallback * @property string|null $sid * @property string|null $smsFallbackMethod * @property string|null $smsFallbackUrl * @property string|null $smsMethod * @property string|null $smsStatusCallback * @property string|null $smsUrl * @property string|null $statusCallback * @property string|null $statusCallbackMethod * @property string|null $uri * @property bool|null $voiceCallerIdLookup * @property string|null $voiceFallbackMethod * @property string|null $voiceFallbackUrl * @property string|null $voiceMethod * @property string|null $voiceUrl * @property bool|null $publicApplicationConnectEnabled */ class ApplicationInstance extends InstanceResource { /** * Initialize the ApplicationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $sid The Twilio-provided string that uniquely identifies the Application resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'messageStatusCallback' => Values::array_get($payload, 'message_status_callback'), 'sid' => Values::array_get($payload, 'sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsStatusCallback' => Values::array_get($payload, 'sms_status_callback'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'uri' => Values::array_get($payload, 'uri'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'publicApplicationConnectEnabled' => Values::array_get($payload, 'public_application_connect_enabled'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ApplicationContext Context for this ApplicationInstance */ protected function proxy(): ApplicationContext { if (!$this->context) { $this->context = new ApplicationContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ApplicationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ApplicationInstance * * @return ApplicationInstance Fetched ApplicationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ApplicationInstance { return $this->proxy()->fetch(); } /** * Update the ApplicationInstance * * @param array|Options $options Optional Arguments * @return ApplicationInstance Updated ApplicationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ApplicationInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ApplicationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/UsageList.php 0000644 00000006736 15021223077 0015541 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Usage\RecordList; use Twilio\Rest\Api\V2010\Account\Usage\TriggerList; /** * @property RecordList $records * @property TriggerList $triggers * @method \Twilio\Rest\Api\V2010\Account\Usage\TriggerContext triggers(string $sid) */ class UsageList extends ListResource { protected $_records = null; protected $_triggers = null; /** * Construct the UsageList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; } /** * Access the records */ protected function getRecords(): RecordList { if (!$this->_records) { $this->_records = new RecordList( $this->version, $this->solution['accountSid'] ); } return $this->_records; } /** * Access the triggers */ protected function getTriggers(): TriggerList { if (!$this->_triggers) { $this->_triggers = new TriggerList( $this->version, $this->solution['accountSid'] ); } return $this->_triggers; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.UsageList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/BalanceList.php 0000644 00000003532 15021223077 0016011 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; class BalanceList extends ListResource { /** * Construct the BalanceList * * @param Version $version Version that contains the resource * @param string $accountSid The unique SID identifier of the Account. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Balance.json'; } /** * Fetch the BalanceInstance * * @return BalanceInstance Fetched BalanceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BalanceInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new BalanceInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.BalanceList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TokenInstance.php 0000644 00000005541 15021223077 0016377 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string[]|null $iceServers * @property string|null $password * @property string|null $ttl * @property string|null $username */ class TokenInstance extends InstanceResource { /** * Initialize the TokenInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'iceServers' => Values::array_get($payload, 'ice_servers'), 'password' => Values::array_get($payload, 'password'), 'ttl' => Values::array_get($payload, 'ttl'), 'username' => Values::array_get($payload, 'username'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TokenInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/RecordingPage.php 0000644 00000003102 15021223077 0016332 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RecordingInstance \Twilio\Rest\Api\V2010\Account\RecordingInstance */ public function buildInstance(array $payload): RecordingInstance { return new RecordingInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.RecordingPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationOptions.php 0000644 00000101474 15021223077 0017453 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class ApplicationOptions { /** * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default API version. * @param string $voiceUrl The URL we should call when the phone number assigned to this application receives a call. * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. * @param bool $voiceCallerIdLookup Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. * @param string $smsStatusCallback The URL we should call using a POST method to send status information about SMS messages sent by the application. * @param string $messageStatusCallback The URL we should call using a POST method to send message status information to your application. * @param string $friendlyName A descriptive string that you create to describe the new application. It can be up to 64 characters long. * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. * @return CreateApplicationOptions Options builder */ public static function create( string $apiVersion = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsStatusCallback = Values::NONE, string $messageStatusCallback = Values::NONE, string $friendlyName = Values::NONE, bool $publicApplicationConnectEnabled = Values::BOOL_NONE ): CreateApplicationOptions { return new CreateApplicationOptions( $apiVersion, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $statusCallback, $statusCallbackMethod, $voiceCallerIdLookup, $smsUrl, $smsMethod, $smsFallbackUrl, $smsFallbackMethod, $smsStatusCallback, $messageStatusCallback, $friendlyName, $publicApplicationConnectEnabled ); } /** * @param string $friendlyName The string that identifies the Application resources to read. * @return ReadApplicationOptions Options builder */ public static function read( string $friendlyName = Values::NONE ): ReadApplicationOptions { return new ReadApplicationOptions( $friendlyName ); } /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version. * @param string $voiceUrl The URL we should call when the phone number assigned to this application receives a call. * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. * @param bool $voiceCallerIdLookup Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. * @param string $smsStatusCallback Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility. * @param string $messageStatusCallback The URL we should call using a POST method to send message status information to your application. * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. * @return UpdateApplicationOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $apiVersion = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsStatusCallback = Values::NONE, string $messageStatusCallback = Values::NONE, bool $publicApplicationConnectEnabled = Values::BOOL_NONE ): UpdateApplicationOptions { return new UpdateApplicationOptions( $friendlyName, $apiVersion, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $statusCallback, $statusCallbackMethod, $voiceCallerIdLookup, $smsUrl, $smsMethod, $smsFallbackUrl, $smsFallbackMethod, $smsStatusCallback, $messageStatusCallback, $publicApplicationConnectEnabled ); } } class CreateApplicationOptions extends Options { /** * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default API version. * @param string $voiceUrl The URL we should call when the phone number assigned to this application receives a call. * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. * @param bool $voiceCallerIdLookup Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. * @param string $smsStatusCallback The URL we should call using a POST method to send status information about SMS messages sent by the application. * @param string $messageStatusCallback The URL we should call using a POST method to send message status information to your application. * @param string $friendlyName A descriptive string that you create to describe the new application. It can be up to 64 characters long. * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. */ public function __construct( string $apiVersion = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsStatusCallback = Values::NONE, string $messageStatusCallback = Values::NONE, string $friendlyName = Values::NONE, bool $publicApplicationConnectEnabled = Values::BOOL_NONE ) { $this->options['apiVersion'] = $apiVersion; $this->options['voiceUrl'] = $voiceUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['smsUrl'] = $smsUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsStatusCallback'] = $smsStatusCallback; $this->options['messageStatusCallback'] = $messageStatusCallback; $this->options['friendlyName'] = $friendlyName; $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; } /** * The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default API version. * * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default API version. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * The URL we should call when the phone number assigned to this application receives a call. * * @param string $voiceUrl The URL we should call when the phone number assigned to this application receives a call. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. * * @param bool $voiceCallerIdLookup Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The URL we should call when the phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. * * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. * * @param string $smsFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. * * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL we should call using a POST method to send status information about SMS messages sent by the application. * * @param string $smsStatusCallback The URL we should call using a POST method to send status information about SMS messages sent by the application. * @return $this Fluent Builder */ public function setSmsStatusCallback(string $smsStatusCallback): self { $this->options['smsStatusCallback'] = $smsStatusCallback; return $this; } /** * The URL we should call using a POST method to send message status information to your application. * * @param string $messageStatusCallback The URL we should call using a POST method to send message status information to your application. * @return $this Fluent Builder */ public function setMessageStatusCallback(string $messageStatusCallback): self { $this->options['messageStatusCallback'] = $messageStatusCallback; return $this; } /** * A descriptive string that you create to describe the new application. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new application. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. * * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setPublicApplicationConnectEnabled(bool $publicApplicationConnectEnabled): self { $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateApplicationOptions ' . $options . ']'; } } class ReadApplicationOptions extends Options { /** * @param string $friendlyName The string that identifies the Application resources to read. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * The string that identifies the Application resources to read. * * @param string $friendlyName The string that identifies the Application resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadApplicationOptions ' . $options . ']'; } } class UpdateApplicationOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version. * @param string $voiceUrl The URL we should call when the phone number assigned to this application receives a call. * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. * @param bool $voiceCallerIdLookup Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. * @param string $smsStatusCallback Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility. * @param string $messageStatusCallback The URL we should call using a POST method to send message status information to your application. * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. */ public function __construct( string $friendlyName = Values::NONE, string $apiVersion = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsStatusCallback = Values::NONE, string $messageStatusCallback = Values::NONE, bool $publicApplicationConnectEnabled = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['apiVersion'] = $apiVersion; $this->options['voiceUrl'] = $voiceUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['smsUrl'] = $smsUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsStatusCallback'] = $smsStatusCallback; $this->options['messageStatusCallback'] = $messageStatusCallback; $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version. * * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * The URL we should call when the phone number assigned to this application receives a call. * * @param string $voiceUrl The URL we should call when the phone number assigned to this application receives a call. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. * * @param bool $voiceCallerIdLookup Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The URL we should call when the phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. * * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. * * @param string $smsFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. * * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility. * * @param string $smsStatusCallback Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility. * @return $this Fluent Builder */ public function setSmsStatusCallback(string $smsStatusCallback): self { $this->options['smsStatusCallback'] = $smsStatusCallback; return $this; } /** * The URL we should call using a POST method to send message status information to your application. * * @param string $messageStatusCallback The URL we should call using a POST method to send message status information to your application. * @return $this Fluent Builder */ public function setMessageStatusCallback(string $messageStatusCallback): self { $this->options['messageStatusCallback'] = $messageStatusCallback; return $this; } /** * Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. * * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setPublicApplicationConnectEnabled(bool $publicApplicationConnectEnabled): self { $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateApplicationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AddressContext.php 0000644 00000013275 15021223077 0016567 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberList; /** * @property DependentPhoneNumberList $dependentPhoneNumbers */ class AddressContext extends InstanceContext { protected $_dependentPhoneNumbers; /** * Initialize the AddressContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will be responsible for the new Address resource. * @param string $sid The Twilio-provided string that uniquely identifies the Address resource to delete. */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Addresses/' . \rawurlencode($sid) .'.json'; } /** * Delete the AddressInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the AddressInstance * * @return AddressInstance Fetched AddressInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AddressInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AddressInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the AddressInstance * * @param array|Options $options Optional Arguments * @return AddressInstance Updated AddressInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AddressInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'CustomerName' => $options['customerName'], 'Street' => $options['street'], 'City' => $options['city'], 'Region' => $options['region'], 'PostalCode' => $options['postalCode'], 'EmergencyEnabled' => Serialize::booleanToString($options['emergencyEnabled']), 'AutoCorrectAddress' => Serialize::booleanToString($options['autoCorrectAddress']), 'StreetSecondary' => $options['streetSecondary'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AddressInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the dependentPhoneNumbers */ protected function getDependentPhoneNumbers(): DependentPhoneNumberList { if (!$this->_dependentPhoneNumbers) { $this->_dependentPhoneNumbers = new DependentPhoneNumberList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_dependentPhoneNumbers; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AddressContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/MessageContext.php 0000644 00000012675 15021223077 0016571 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Message\FeedbackList; use Twilio\Rest\Api\V2010\Account\Message\MediaList; /** * @property FeedbackList $feedback * @property MediaList $media * @method \Twilio\Rest\Api\V2010\Account\Message\MediaContext media(string $sid) */ class MessageContext extends InstanceContext { protected $_feedback; protected $_media; /** * Initialize the MessageContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) creating the Message resource. * @param string $sid The SID of the Message resource you wish to delete */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Messages/' . \rawurlencode($sid) .'.json'; } /** * Delete the MessageInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessageInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Body' => $options['body'], 'Status' => $options['status'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new MessageInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the feedback */ protected function getFeedback(): FeedbackList { if (!$this->_feedback) { $this->_feedback = new FeedbackList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_feedback; } /** * Access the media */ protected function getMedia(): MediaList { if (!$this->_media) { $this->_media = new MediaList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_media; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/UsageInstance.php 0000644 00000003742 15021223077 0016364 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Version; class UsageInstance extends InstanceResource { /** * Initialize the UsageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.UsageInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryInstance.php 0000644 00000013406 15021223077 0022725 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalList; /** * @property string|null $countryCode * @property string|null $country * @property string|null $uri * @property bool|null $beta * @property array|null $subresourceUris */ class AvailablePhoneNumberCountryInstance extends InstanceResource { protected $_voip; protected $_national; protected $_mobile; protected $_machineToMachine; protected $_tollFree; protected $_sharedCost; protected $_local; /** * Initialize the AvailablePhoneNumberCountryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the available phone number Country resource. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country to fetch available phone number information about. */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'countryCode' => Values::array_get($payload, 'country_code'), 'country' => Values::array_get($payload, 'country'), 'uri' => Values::array_get($payload, 'uri'), 'beta' => Values::array_get($payload, 'beta'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode ?: $this->properties['countryCode'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AvailablePhoneNumberCountryContext Context for this AvailablePhoneNumberCountryInstance */ protected function proxy(): AvailablePhoneNumberCountryContext { if (!$this->context) { $this->context = new AvailablePhoneNumberCountryContext( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->context; } /** * Fetch the AvailablePhoneNumberCountryInstance * * @return AvailablePhoneNumberCountryInstance Fetched AvailablePhoneNumberCountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AvailablePhoneNumberCountryInstance { return $this->proxy()->fetch(); } /** * Access the voip */ protected function getVoip(): VoipList { return $this->proxy()->voip; } /** * Access the national */ protected function getNational(): NationalList { return $this->proxy()->national; } /** * Access the mobile */ protected function getMobile(): MobileList { return $this->proxy()->mobile; } /** * Access the machineToMachine */ protected function getMachineToMachine(): MachineToMachineList { return $this->proxy()->machineToMachine; } /** * Access the tollFree */ protected function getTollFree(): TollFreeList { return $this->proxy()->tollFree; } /** * Access the sharedCost */ protected function getSharedCost(): SharedCostList { return $this->proxy()->sharedCost; } /** * Access the local */ protected function getLocal(): LocalList { return $this->proxy()->local; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AvailablePhoneNumberCountryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AddressInstance.php 0000644 00000013571 15021223077 0016706 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberList; /** * @property string|null $accountSid * @property string|null $city * @property string|null $customerName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string|null $isoCountry * @property string|null $postalCode * @property string|null $region * @property string|null $sid * @property string|null $street * @property string|null $uri * @property bool|null $emergencyEnabled * @property bool|null $validated * @property bool|null $verified * @property string|null $streetSecondary */ class AddressInstance extends InstanceResource { protected $_dependentPhoneNumbers; /** * Initialize the AddressInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will be responsible for the new Address resource. * @param string $sid The Twilio-provided string that uniquely identifies the Address resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'city' => Values::array_get($payload, 'city'), 'customerName' => Values::array_get($payload, 'customer_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'region' => Values::array_get($payload, 'region'), 'sid' => Values::array_get($payload, 'sid'), 'street' => Values::array_get($payload, 'street'), 'uri' => Values::array_get($payload, 'uri'), 'emergencyEnabled' => Values::array_get($payload, 'emergency_enabled'), 'validated' => Values::array_get($payload, 'validated'), 'verified' => Values::array_get($payload, 'verified'), 'streetSecondary' => Values::array_get($payload, 'street_secondary'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AddressContext Context for this AddressInstance */ protected function proxy(): AddressContext { if (!$this->context) { $this->context = new AddressContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the AddressInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AddressInstance * * @return AddressInstance Fetched AddressInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AddressInstance { return $this->proxy()->fetch(); } /** * Update the AddressInstance * * @param array|Options $options Optional Arguments * @return AddressInstance Updated AddressInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AddressInstance { return $this->proxy()->update($options); } /** * Access the dependentPhoneNumbers */ protected function getDependentPhoneNumbers(): DependentPhoneNumberList { return $this->proxy()->dependentPhoneNumbers; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AddressInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/CallList.php 0000644 00000024326 15021223077 0015343 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class CallList extends ListResource { /** * Construct the CallList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls.json'; } /** * Create the CallInstance * * @param string $to The phone number, SIP address, or client identifier to call. * @param string $from The phone number or client identifier to use as the caller id. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `From` must also be a phone number. * @param array|Options $options Optional Arguments * @return CallInstance Created CallInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $to, string $from, array $options = []): CallInstance { $options = new Values($options); $data = Values::of([ 'To' => $to, 'From' => $from, 'Method' => $options['method'], 'FallbackUrl' => $options['fallbackUrl'], 'FallbackMethod' => $options['fallbackMethod'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackEvent' => Serialize::map($options['statusCallbackEvent'], function ($e) { return $e; }), 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'SendDigits' => $options['sendDigits'], 'Timeout' => $options['timeout'], 'Record' => Serialize::booleanToString($options['record']), 'RecordingChannels' => $options['recordingChannels'], 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'MachineDetection' => $options['machineDetection'], 'MachineDetectionTimeout' => $options['machineDetectionTimeout'], 'RecordingStatusCallbackEvent' => Serialize::map($options['recordingStatusCallbackEvent'], function ($e) { return $e; }), 'Trim' => $options['trim'], 'CallerId' => $options['callerId'], 'MachineDetectionSpeechThreshold' => $options['machineDetectionSpeechThreshold'], 'MachineDetectionSpeechEndThreshold' => $options['machineDetectionSpeechEndThreshold'], 'MachineDetectionSilenceTimeout' => $options['machineDetectionSilenceTimeout'], 'AsyncAmd' => $options['asyncAmd'], 'AsyncAmdStatusCallback' => $options['asyncAmdStatusCallback'], 'AsyncAmdStatusCallbackMethod' => $options['asyncAmdStatusCallbackMethod'], 'Byoc' => $options['byoc'], 'CallReason' => $options['callReason'], 'CallToken' => $options['callToken'], 'RecordingTrack' => $options['recordingTrack'], 'TimeLimit' => $options['timeLimit'], 'Url' => $options['url'], 'Twiml' => $options['twiml'], 'ApplicationSid' => $options['applicationSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CallInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads CallInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CallInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CallInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CallInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CallPage Page of CallInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CallPage { $options = new Values($options); $params = Values::of([ 'To' => $options['to'], 'From' => $options['from'], 'ParentCallSid' => $options['parentCallSid'], 'Status' => $options['status'], 'StartTime<' => Serialize::iso8601DateTime($options['startTimeBefore']), 'StartTime' => Serialize::iso8601DateTime($options['startTime']), 'StartTime>' => Serialize::iso8601DateTime($options['startTimeAfter']), 'EndTime<' => Serialize::iso8601DateTime($options['endTimeBefore']), 'EndTime' => Serialize::iso8601DateTime($options['endTime']), 'EndTime>' => Serialize::iso8601DateTime($options['endTimeAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CallPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CallInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CallPage Page of CallInstance */ public function getPage(string $targetUrl): CallPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CallPage($this->version, $response, $this->solution); } /** * Constructs a CallContext * * @param string $sid The Twilio-provided Call SID that uniquely identifies the Call resource to delete */ public function getContext( string $sid ): CallContext { return new CallContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.CallList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NotificationInstance.php 0000644 00000012241 15021223077 0017740 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $callSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $errorCode * @property string|null $log * @property \DateTime|null $messageDate * @property string|null $messageText * @property string|null $moreInfo * @property string|null $requestMethod * @property string|null $requestUrl * @property string|null $requestVariables * @property string|null $responseBody * @property string|null $responseHeaders * @property string|null $sid * @property string|null $uri */ class NotificationInstance extends InstanceResource { /** * Initialize the NotificationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Notification resource to fetch. * @param string $sid The Twilio-provided string that uniquely identifies the Notification resource to fetch. */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callSid' => Values::array_get($payload, 'call_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'errorCode' => Values::array_get($payload, 'error_code'), 'log' => Values::array_get($payload, 'log'), 'messageDate' => Deserialize::dateTime(Values::array_get($payload, 'message_date')), 'messageText' => Values::array_get($payload, 'message_text'), 'moreInfo' => Values::array_get($payload, 'more_info'), 'requestMethod' => Values::array_get($payload, 'request_method'), 'requestUrl' => Values::array_get($payload, 'request_url'), 'requestVariables' => Values::array_get($payload, 'request_variables'), 'responseBody' => Values::array_get($payload, 'response_body'), 'responseHeaders' => Values::array_get($payload, 'response_headers'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return NotificationContext Context for this NotificationInstance */ protected function proxy(): NotificationContext { if (!$this->context) { $this->context = new NotificationContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the NotificationInstance * * @return NotificationInstance Fetched NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NotificationInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.NotificationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackList.php 0000644 00000004766 15021223077 0017546 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class FeedbackList extends ListResource { /** * Construct the FeedbackList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) associated with the Message resource for which to create MessageFeedback. * @param string $messageSid The SID of the Message resource for which to create MessageFeedback. */ public function __construct( Version $version, string $accountSid, string $messageSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'messageSid' => $messageSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Messages/' . \rawurlencode($messageSid) .'/Feedback.json'; } /** * Create the FeedbackInstance * * @param array|Options $options Optional Arguments * @return FeedbackInstance Created FeedbackInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): FeedbackInstance { $options = new Values($options); $data = Values::of([ 'Outcome' => $options['outcome'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FeedbackInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['messageSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.FeedbackList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackPage.php 0000644 00000003153 15021223077 0017474 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FeedbackPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FeedbackInstance \Twilio\Rest\Api\V2010\Account\Message\FeedbackInstance */ public function buildInstance(array $payload): FeedbackInstance { return new FeedbackInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['messageSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.FeedbackPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaList.php 0000644 00000014346 15021223077 0017074 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class MediaList extends ListResource { /** * Construct the MediaList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is associated with the Media resource. * @param string $messageSid The SID of the Message resource that is associated with the Media resource. */ public function __construct( Version $version, string $accountSid, string $messageSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'messageSid' => $messageSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Messages/' . \rawurlencode($messageSid) .'/Media.json'; } /** * Reads MediaInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MediaInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MediaInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MediaInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MediaPage Page of MediaInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MediaPage { $options = new Values($options); $params = Values::of([ 'DateCreated<' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateCreated>' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MediaPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MediaInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MediaPage Page of MediaInstance */ public function getPage(string $targetUrl): MediaPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MediaPage($this->version, $response, $this->solution); } /** * Constructs a MediaContext * * @param string $sid The unique identifier of the to-be-deleted Media resource. */ public function getContext( string $sid ): MediaContext { return new MediaContext( $this->version, $this->solution['accountSid'], $this->solution['messageSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MediaList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaContext.php 0000644 00000005463 15021223077 0017605 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class MediaContext extends InstanceContext { /** * Initialize the MediaContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is associated with the Media resource. * @param string $messageSid The SID of the Message resource that is associated with the Media resource. * @param string $sid The unique identifier of the to-be-deleted Media resource. */ public function __construct( Version $version, $accountSid, $messageSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'messageSid' => $messageSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Messages/' . \rawurlencode($messageSid) .'/Media/' . \rawurlencode($sid) .'.json'; } /** * Delete the MediaInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the MediaInstance * * @return MediaInstance Fetched MediaInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MediaInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new MediaInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['messageSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.MediaContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackInstance.php 0000644 00000005704 15021223077 0020370 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $messageSid * @property string $outcome * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $uri */ class FeedbackInstance extends InstanceResource { /** * Initialize the FeedbackInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) associated with the Message resource for which to create MessageFeedback. * @param string $messageSid The SID of the Message resource for which to create MessageFeedback. */ public function __construct(Version $version, array $payload, string $accountSid, string $messageSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'messageSid' => Values::array_get($payload, 'message_sid'), 'outcome' => Values::array_get($payload, 'outcome'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'messageSid' => $messageSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.FeedbackInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaPage.php 0000644 00000003131 15021223077 0017023 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MediaPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MediaInstance \Twilio\Rest\Api\V2010\Account\Message\MediaInstance */ public function buildInstance(array $payload): MediaInstance { return new MediaInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['messageSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MediaPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackOptions.php 0000644 00000003250 15021223077 0020251 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Options; use Twilio\Values; abstract class FeedbackOptions { /** * @param string $outcome * @return CreateFeedbackOptions Options builder */ public static function create( string $outcome = Values::NONE ): CreateFeedbackOptions { return new CreateFeedbackOptions( $outcome ); } } class CreateFeedbackOptions extends Options { /** * @param string $outcome */ public function __construct( string $outcome = Values::NONE ) { $this->options['outcome'] = $outcome; } /** * @param string $outcome * @return $this Fluent Builder */ public function setOutcome(string $outcome): self { $this->options['outcome'] = $outcome; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateFeedbackOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaOptions.php 0000644 00000016752 15021223077 0017617 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Options; use Twilio\Values; abstract class MediaOptions { /** * @param string $dateCreatedBefore Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @param string $dateCreated Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @param string $dateCreatedAfter Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @return ReadMediaOptions Options builder */ public static function read( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null ): ReadMediaOptions { return new ReadMediaOptions( $dateCreatedBefore, $dateCreated, $dateCreatedAfter ); } } class ReadMediaOptions extends Options { /** * @param string $dateCreatedBefore Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @param string $dateCreated Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @param string $dateCreatedAfter Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. */ public function __construct( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null ) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; } /** * Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * * @param string $dateCreatedBefore Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @return $this Fluent Builder */ public function setDateCreatedBefore(string $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * * @param string $dateCreated Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @return $this Fluent Builder */ public function setDateCreated(string $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * * @param string $dateCreatedAfter Only include Media resources that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read Media that were created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read Media that were created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read Media that were created on or after midnight of this date. * @return $this Fluent Builder */ public function setDateCreatedAfter(string $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadMediaOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaInstance.php 0000644 00000010645 15021223077 0017723 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $contentType * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $parentSid * @property string|null $sid * @property string|null $uri */ class MediaInstance extends InstanceResource { /** * Initialize the MediaInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is associated with the Media resource. * @param string $messageSid The SID of the Message resource that is associated with the Media resource. * @param string $sid The unique identifier of the to-be-deleted Media resource. */ public function __construct(Version $version, array $payload, string $accountSid, string $messageSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'contentType' => Values::array_get($payload, 'content_type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'parentSid' => Values::array_get($payload, 'parent_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'messageSid' => $messageSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MediaContext Context for this MediaInstance */ protected function proxy(): MediaContext { if (!$this->context) { $this->context = new MediaContext( $this->version, $this->solution['accountSid'], $this->solution['messageSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MediaInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the MediaInstance * * @return MediaInstance Fetched MediaInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MediaInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.MediaInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/KeyList.php 0000644 00000012530 15021223077 0015212 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class KeyList extends ListResource { /** * Construct the KeyList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Key resources to delete. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Keys.json'; } /** * Reads KeyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return KeyInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams KeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of KeyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return KeyPage Page of KeyInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): KeyPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new KeyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of KeyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return KeyPage Page of KeyInstance */ public function getPage(string $targetUrl): KeyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new KeyPage($this->version, $response, $this->solution); } /** * Constructs a KeyContext * * @param string $sid The Twilio-provided string that uniquely identifies the Key resource to delete. */ public function getContext( string $sid ): KeyContext { return new KeyContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.KeyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/CallPage.php 0000644 00000003044 15021223077 0015276 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CallPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CallInstance \Twilio\Rest\Api\V2010\Account\CallInstance */ public function buildInstance(array $payload): CallInstance { return new CallInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.CallPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyOptions.php 0000644 00000003400 15021223077 0017245 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class SigningKeyOptions { /** * @param string $friendlyName * @return UpdateSigningKeyOptions Options builder */ public static function update( string $friendlyName = Values::NONE ): UpdateSigningKeyOptions { return new UpdateSigningKeyOptions( $friendlyName ); } } class UpdateSigningKeyOptions extends Options { /** * @param string $friendlyName */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateSigningKeyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppList.php 0000644 00000013256 15021223077 0020561 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AuthorizedConnectAppList extends ListResource { /** * Construct the AuthorizedConnectAppList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AuthorizedConnectApp resource to fetch. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AuthorizedConnectApps.json'; } /** * Reads AuthorizedConnectAppInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthorizedConnectAppInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AuthorizedConnectAppInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AuthorizedConnectAppInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AuthorizedConnectAppPage Page of AuthorizedConnectAppInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AuthorizedConnectAppPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AuthorizedConnectAppPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthorizedConnectAppInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AuthorizedConnectAppPage Page of AuthorizedConnectAppInstance */ public function getPage(string $targetUrl): AuthorizedConnectAppPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthorizedConnectAppPage($this->version, $response, $this->solution); } /** * Constructs a AuthorizedConnectAppContext * * @param string $connectAppSid The SID of the Connect App to fetch. */ public function getContext( string $connectAppSid ): AuthorizedConnectAppContext { return new AuthorizedConnectAppContext( $this->version, $this->solution['accountSid'], $connectAppSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthorizedConnectAppList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceList.php 0000644 00000014741 15021223077 0016537 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ConferenceList extends ListResource { /** * Construct the ConferenceList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference resource(s) to fetch. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Conferences.json'; } /** * Reads ConferenceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConferenceInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ConferenceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ConferenceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConferencePage Page of ConferenceInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ConferencePage { $options = new Values($options); $params = Values::of([ 'DateCreated<' => Serialize::iso8601Date($options['dateCreatedBefore']), 'DateCreated' => Serialize::iso8601Date($options['dateCreated']), 'DateCreated>' => Serialize::iso8601Date($options['dateCreatedAfter']), 'DateUpdated<' => Serialize::iso8601Date($options['dateUpdatedBefore']), 'DateUpdated' => Serialize::iso8601Date($options['dateUpdated']), 'DateUpdated>' => Serialize::iso8601Date($options['dateUpdatedAfter']), 'FriendlyName' => $options['friendlyName'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ConferencePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConferenceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ConferencePage Page of ConferenceInstance */ public function getPage(string $targetUrl): ConferencePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConferencePage($this->version, $response, $this->solution); } /** * Constructs a ConferenceContext * * @param string $sid The Twilio-provided string that uniquely identifies the Conference resource to fetch */ public function getContext( string $sid ): ConferenceContext { return new ConferenceContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ConferenceList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/QueueOptions.php 0000644 00000010534 15021223077 0016270 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class QueueOptions { /** * @param int $maxSize The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. * @return CreateQueueOptions Options builder */ public static function create( int $maxSize = Values::INT_NONE ): CreateQueueOptions { return new CreateQueueOptions( $maxSize ); } /** * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. * @param int $maxSize The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. * @return UpdateQueueOptions Options builder */ public static function update( string $friendlyName = Values::NONE, int $maxSize = Values::INT_NONE ): UpdateQueueOptions { return new UpdateQueueOptions( $friendlyName, $maxSize ); } } class CreateQueueOptions extends Options { /** * @param int $maxSize The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. */ public function __construct( int $maxSize = Values::INT_NONE ) { $this->options['maxSize'] = $maxSize; } /** * The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. * * @param int $maxSize The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. * @return $this Fluent Builder */ public function setMaxSize(int $maxSize): self { $this->options['maxSize'] = $maxSize; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateQueueOptions ' . $options . ']'; } } class UpdateQueueOptions extends Options { /** * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. * @param int $maxSize The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. */ public function __construct( string $friendlyName = Values::NONE, int $maxSize = Values::INT_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['maxSize'] = $maxSize; } /** * A descriptive string that you created to describe this resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. * * @param int $maxSize The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. * @return $this Fluent Builder */ public function setMaxSize(int $maxSize): self { $this->options['maxSize'] = $maxSize; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateQueueOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdContext.php 0000644 00000006722 15021223077 0020374 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class OutgoingCallerIdContext extends InstanceContext { /** * Initialize the OutgoingCallerIdContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the OutgoingCallerId resources to delete. * @param string $sid The Twilio-provided string that uniquely identifies the OutgoingCallerId resource to delete. */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/OutgoingCallerIds/' . \rawurlencode($sid) .'.json'; } /** * Delete the OutgoingCallerIdInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the OutgoingCallerIdInstance * * @return OutgoingCallerIdInstance Fetched OutgoingCallerIdInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): OutgoingCallerIdInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new OutgoingCallerIdInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the OutgoingCallerIdInstance * * @param array|Options $options Optional Arguments * @return OutgoingCallerIdInstance Updated OutgoingCallerIdInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): OutgoingCallerIdInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new OutgoingCallerIdInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.OutgoingCallerIdContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AddressOptions.php 0000644 00000036525 15021223077 0016601 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class AddressOptions { /** * @param string $friendlyName A descriptive string that you create to describe the new address. It can be up to 64 characters long. * @param bool $emergencyEnabled Whether to enable emergency calling on the new address. Can be: `true` or `false`. * @param bool $autoCorrectAddress Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. * @param string $streetSecondary The additional number and street address of the address. * @return CreateAddressOptions Options builder */ public static function create( string $friendlyName = Values::NONE, bool $emergencyEnabled = Values::BOOL_NONE, bool $autoCorrectAddress = Values::BOOL_NONE, string $streetSecondary = Values::NONE ): CreateAddressOptions { return new CreateAddressOptions( $friendlyName, $emergencyEnabled, $autoCorrectAddress, $streetSecondary ); } /** * @param string $customerName The `customer_name` of the Address resources to read. * @param string $friendlyName The string that identifies the Address resources to read. * @param string $isoCountry The ISO country code of the Address resources to read. * @return ReadAddressOptions Options builder */ public static function read( string $customerName = Values::NONE, string $friendlyName = Values::NONE, string $isoCountry = Values::NONE ): ReadAddressOptions { return new ReadAddressOptions( $customerName, $friendlyName, $isoCountry ); } /** * @param string $friendlyName A descriptive string that you create to describe the address. It can be up to 64 characters long. * @param string $customerName The name to associate with the address. * @param string $street The number and street address of the address. * @param string $city The city of the address. * @param string $region The state or region of the address. * @param string $postalCode The postal code of the address. * @param bool $emergencyEnabled Whether to enable emergency calling on the address. Can be: `true` or `false`. * @param bool $autoCorrectAddress Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. * @param string $streetSecondary The additional number and street address of the address. * @return UpdateAddressOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $customerName = Values::NONE, string $street = Values::NONE, string $city = Values::NONE, string $region = Values::NONE, string $postalCode = Values::NONE, bool $emergencyEnabled = Values::BOOL_NONE, bool $autoCorrectAddress = Values::BOOL_NONE, string $streetSecondary = Values::NONE ): UpdateAddressOptions { return new UpdateAddressOptions( $friendlyName, $customerName, $street, $city, $region, $postalCode, $emergencyEnabled, $autoCorrectAddress, $streetSecondary ); } } class CreateAddressOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the new address. It can be up to 64 characters long. * @param bool $emergencyEnabled Whether to enable emergency calling on the new address. Can be: `true` or `false`. * @param bool $autoCorrectAddress Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. * @param string $streetSecondary The additional number and street address of the address. */ public function __construct( string $friendlyName = Values::NONE, bool $emergencyEnabled = Values::BOOL_NONE, bool $autoCorrectAddress = Values::BOOL_NONE, string $streetSecondary = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['emergencyEnabled'] = $emergencyEnabled; $this->options['autoCorrectAddress'] = $autoCorrectAddress; $this->options['streetSecondary'] = $streetSecondary; } /** * A descriptive string that you create to describe the new address. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new address. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether to enable emergency calling on the new address. Can be: `true` or `false`. * * @param bool $emergencyEnabled Whether to enable emergency calling on the new address. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setEmergencyEnabled(bool $emergencyEnabled): self { $this->options['emergencyEnabled'] = $emergencyEnabled; return $this; } /** * Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. * * @param bool $autoCorrectAddress Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. * @return $this Fluent Builder */ public function setAutoCorrectAddress(bool $autoCorrectAddress): self { $this->options['autoCorrectAddress'] = $autoCorrectAddress; return $this; } /** * The additional number and street address of the address. * * @param string $streetSecondary The additional number and street address of the address. * @return $this Fluent Builder */ public function setStreetSecondary(string $streetSecondary): self { $this->options['streetSecondary'] = $streetSecondary; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateAddressOptions ' . $options . ']'; } } class ReadAddressOptions extends Options { /** * @param string $customerName The `customer_name` of the Address resources to read. * @param string $friendlyName The string that identifies the Address resources to read. * @param string $isoCountry The ISO country code of the Address resources to read. */ public function __construct( string $customerName = Values::NONE, string $friendlyName = Values::NONE, string $isoCountry = Values::NONE ) { $this->options['customerName'] = $customerName; $this->options['friendlyName'] = $friendlyName; $this->options['isoCountry'] = $isoCountry; } /** * The `customer_name` of the Address resources to read. * * @param string $customerName The `customer_name` of the Address resources to read. * @return $this Fluent Builder */ public function setCustomerName(string $customerName): self { $this->options['customerName'] = $customerName; return $this; } /** * The string that identifies the Address resources to read. * * @param string $friendlyName The string that identifies the Address resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The ISO country code of the Address resources to read. * * @param string $isoCountry The ISO country code of the Address resources to read. * @return $this Fluent Builder */ public function setIsoCountry(string $isoCountry): self { $this->options['isoCountry'] = $isoCountry; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadAddressOptions ' . $options . ']'; } } class UpdateAddressOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the address. It can be up to 64 characters long. * @param string $customerName The name to associate with the address. * @param string $street The number and street address of the address. * @param string $city The city of the address. * @param string $region The state or region of the address. * @param string $postalCode The postal code of the address. * @param bool $emergencyEnabled Whether to enable emergency calling on the address. Can be: `true` or `false`. * @param bool $autoCorrectAddress Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. * @param string $streetSecondary The additional number and street address of the address. */ public function __construct( string $friendlyName = Values::NONE, string $customerName = Values::NONE, string $street = Values::NONE, string $city = Values::NONE, string $region = Values::NONE, string $postalCode = Values::NONE, bool $emergencyEnabled = Values::BOOL_NONE, bool $autoCorrectAddress = Values::BOOL_NONE, string $streetSecondary = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['customerName'] = $customerName; $this->options['street'] = $street; $this->options['city'] = $city; $this->options['region'] = $region; $this->options['postalCode'] = $postalCode; $this->options['emergencyEnabled'] = $emergencyEnabled; $this->options['autoCorrectAddress'] = $autoCorrectAddress; $this->options['streetSecondary'] = $streetSecondary; } /** * A descriptive string that you create to describe the address. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the address. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The name to associate with the address. * * @param string $customerName The name to associate with the address. * @return $this Fluent Builder */ public function setCustomerName(string $customerName): self { $this->options['customerName'] = $customerName; return $this; } /** * The number and street address of the address. * * @param string $street The number and street address of the address. * @return $this Fluent Builder */ public function setStreet(string $street): self { $this->options['street'] = $street; return $this; } /** * The city of the address. * * @param string $city The city of the address. * @return $this Fluent Builder */ public function setCity(string $city): self { $this->options['city'] = $city; return $this; } /** * The state or region of the address. * * @param string $region The state or region of the address. * @return $this Fluent Builder */ public function setRegion(string $region): self { $this->options['region'] = $region; return $this; } /** * The postal code of the address. * * @param string $postalCode The postal code of the address. * @return $this Fluent Builder */ public function setPostalCode(string $postalCode): self { $this->options['postalCode'] = $postalCode; return $this; } /** * Whether to enable emergency calling on the address. Can be: `true` or `false`. * * @param bool $emergencyEnabled Whether to enable emergency calling on the address. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setEmergencyEnabled(bool $emergencyEnabled): self { $this->options['emergencyEnabled'] = $emergencyEnabled; return $this; } /** * Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. * * @param bool $autoCorrectAddress Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. * @return $this Fluent Builder */ public function setAutoCorrectAddress(bool $autoCorrectAddress): self { $this->options['autoCorrectAddress'] = $autoCorrectAddress; return $this; } /** * The additional number and street address of the address. * * @param string $streetSecondary The additional number and street address of the address. * @return $this Fluent Builder */ public function setStreetSecondary(string $streetSecondary): self { $this->options['streetSecondary'] = $streetSecondary; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateAddressOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppInstance.php 0000644 00000010555 15021223077 0021411 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $connectAppCompanyName * @property string|null $connectAppDescription * @property string|null $connectAppFriendlyName * @property string|null $connectAppHomepageUrl * @property string|null $connectAppSid * @property string[]|null $permissions * @property string|null $uri */ class AuthorizedConnectAppInstance extends InstanceResource { /** * Initialize the AuthorizedConnectAppInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AuthorizedConnectApp resource to fetch. * @param string $connectAppSid The SID of the Connect App to fetch. */ public function __construct(Version $version, array $payload, string $accountSid, string $connectAppSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'connectAppCompanyName' => Values::array_get($payload, 'connect_app_company_name'), 'connectAppDescription' => Values::array_get($payload, 'connect_app_description'), 'connectAppFriendlyName' => Values::array_get($payload, 'connect_app_friendly_name'), 'connectAppHomepageUrl' => Values::array_get($payload, 'connect_app_homepage_url'), 'connectAppSid' => Values::array_get($payload, 'connect_app_sid'), 'permissions' => Values::array_get($payload, 'permissions'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'connectAppSid' => $connectAppSid ?: $this->properties['connectAppSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AuthorizedConnectAppContext Context for this AuthorizedConnectAppInstance */ protected function proxy(): AuthorizedConnectAppContext { if (!$this->context) { $this->context = new AuthorizedConnectAppContext( $this->version, $this->solution['accountSid'], $this->solution['connectAppSid'] ); } return $this->context; } /** * Fetch the AuthorizedConnectAppInstance * * @return AuthorizedConnectAppInstance Fetched AuthorizedConnectAppInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthorizedConnectAppInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthorizedConnectAppInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppInstance.php 0000644 00000012222 15021223077 0017343 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $authorizeRedirectUrl * @property string|null $companyName * @property string|null $deauthorizeCallbackMethod * @property string|null $deauthorizeCallbackUrl * @property string|null $description * @property string|null $friendlyName * @property string|null $homepageUrl * @property string[]|null $permissions * @property string|null $sid * @property string|null $uri */ class ConnectAppInstance extends InstanceResource { /** * Initialize the ConnectAppInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ConnectApp resource to fetch. * @param string $sid The Twilio-provided string that uniquely identifies the ConnectApp resource to fetch. */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'authorizeRedirectUrl' => Values::array_get($payload, 'authorize_redirect_url'), 'companyName' => Values::array_get($payload, 'company_name'), 'deauthorizeCallbackMethod' => Values::array_get($payload, 'deauthorize_callback_method'), 'deauthorizeCallbackUrl' => Values::array_get($payload, 'deauthorize_callback_url'), 'description' => Values::array_get($payload, 'description'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'homepageUrl' => Values::array_get($payload, 'homepage_url'), 'permissions' => Values::array_get($payload, 'permissions'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ConnectAppContext Context for this ConnectAppInstance */ protected function proxy(): ConnectAppContext { if (!$this->context) { $this->context = new ConnectAppContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ConnectAppInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ConnectAppInstance * * @return ConnectAppInstance Fetched ConnectAppInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConnectAppInstance { return $this->proxy()->fetch(); } /** * Update the ConnectAppInstance * * @param array|Options $options Optional Arguments * @return ConnectAppInstance Updated ConnectAppInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConnectAppInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ConnectAppInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyPage.php 0000644 00000003060 15021223077 0015623 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NewKeyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return NewKeyInstance \Twilio\Rest\Api\V2010\Account\NewKeyInstance */ public function buildInstance(array $payload): NewKeyInstance { return new NewKeyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NewKeyPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionPage.php 0000644 00000003132 15021223077 0017260 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TranscriptionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TranscriptionInstance \Twilio\Rest\Api\V2010\Account\TranscriptionInstance */ public function buildInstance(array $payload): TranscriptionInstance { return new TranscriptionInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TranscriptionPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyInstance.php 0000644 00000005270 15021223077 0020037 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $secret */ class NewSigningKeyInstance extends InstanceResource { /** * Initialize the NewSigningKeyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will be responsible for the new Key resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'secret' => Values::array_get($payload, 'secret'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NewSigningKeyInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberInstance.php 0000644 00000012514 15021223077 0022753 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Address; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string|null $phoneNumber * @property string|null $voiceUrl * @property string|null $voiceMethod * @property string|null $voiceFallbackMethod * @property string|null $voiceFallbackUrl * @property bool|null $voiceCallerIdLookup * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $smsFallbackMethod * @property string|null $smsFallbackUrl * @property string|null $smsMethod * @property string|null $smsUrl * @property string $addressRequirements * @property array|null $capabilities * @property string|null $statusCallback * @property string|null $statusCallbackMethod * @property string|null $apiVersion * @property string|null $smsApplicationSid * @property string|null $voiceApplicationSid * @property string|null $trunkSid * @property string $emergencyStatus * @property string|null $emergencyAddressSid * @property string|null $uri */ class DependentPhoneNumberInstance extends InstanceResource { /** * Initialize the DependentPhoneNumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the DependentPhoneNumber resources to read. * @param string $addressSid The SID of the Address resource associated with the phone number. */ public function __construct(Version $version, array $payload, string $accountSid, string $addressSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'addressSid' => $addressSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.DependentPhoneNumberInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberList.php 0000644 00000012777 15021223077 0022135 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Address; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DependentPhoneNumberList extends ListResource { /** * Construct the DependentPhoneNumberList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the DependentPhoneNumber resources to read. * @param string $addressSid The SID of the Address resource associated with the phone number. */ public function __construct( Version $version, string $accountSid, string $addressSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'addressSid' => $addressSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Addresses/' . \rawurlencode($addressSid) .'/DependentPhoneNumbers.json'; } /** * Reads DependentPhoneNumberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DependentPhoneNumberInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DependentPhoneNumberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DependentPhoneNumberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DependentPhoneNumberPage Page of DependentPhoneNumberInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DependentPhoneNumberPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DependentPhoneNumberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DependentPhoneNumberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DependentPhoneNumberPage Page of DependentPhoneNumberInstance */ public function getPage(string $targetUrl): DependentPhoneNumberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DependentPhoneNumberPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.DependentPhoneNumberList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberPage.php 0000644 00000003263 15021223077 0022064 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Address; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DependentPhoneNumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DependentPhoneNumberInstance \Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberInstance */ public function buildInstance(array $payload): DependentPhoneNumberInstance { return new DependentPhoneNumberInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['addressSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.DependentPhoneNumberPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingOptions.php 0000644 00000021200 15021223077 0021157 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Options; use Twilio\Values; abstract class RecordingOptions { /** * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return ReadRecordingOptions Options builder */ public static function read( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null ): ReadRecordingOptions { return new ReadRecordingOptions( $dateCreatedBefore, $dateCreated, $dateCreatedAfter ); } /** * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. * @return UpdateRecordingOptions Options builder */ public static function update( string $pauseBehavior = Values::NONE ): UpdateRecordingOptions { return new UpdateRecordingOptions( $pauseBehavior ); } } class ReadRecordingOptions extends Options { /** * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ public function __construct( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null ) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return $this Fluent Builder */ public function setDateCreatedBefore(string $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return $this Fluent Builder */ public function setDateCreated(string $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return $this Fluent Builder */ public function setDateCreatedAfter(string $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadRecordingOptions ' . $options . ']'; } } class UpdateRecordingOptions extends Options { /** * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. */ public function __construct( string $pauseBehavior = Values::NONE ) { $this->options['pauseBehavior'] = $pauseBehavior; } /** * Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. * * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. * @return $this Fluent Builder */ public function setPauseBehavior(string $pauseBehavior): self { $this->options['pauseBehavior'] = $pauseBehavior; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateRecordingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingPage.php 0000644 00000003172 15021223077 0020410 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RecordingInstance \Twilio\Rest\Api\V2010\Account\Conference\RecordingInstance */ public function buildInstance(array $payload): RecordingInstance { return new RecordingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.RecordingPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingList.php 0000644 00000014607 15021223077 0020454 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class RecordingList extends ListResource { /** * Construct the RecordingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference Recording resources to delete. * @param string $conferenceSid The Conference SID that identifies the conference associated with the recording to delete. */ public function __construct( Version $version, string $accountSid, string $conferenceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Conferences/' . \rawurlencode($conferenceSid) .'/Recordings.json'; } /** * Reads RecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RecordingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RecordingPage Page of RecordingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RecordingPage { $options = new Values($options); $params = Values::of([ 'DateCreated<' => Serialize::iso8601Date($options['dateCreatedBefore']), 'DateCreated' => Serialize::iso8601Date($options['dateCreated']), 'DateCreated>' => Serialize::iso8601Date($options['dateCreatedAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RecordingPage Page of RecordingInstance */ public function getPage(string $targetUrl): RecordingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RecordingPage($this->version, $response, $this->solution); } /** * Constructs a RecordingContext * * @param string $sid The Twilio-provided string that uniquely identifies the Conference Recording resource to delete. */ public function getContext( string $sid ): RecordingContext { return new RecordingContext( $this->version, $this->solution['accountSid'], $this->solution['conferenceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.RecordingList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.php 0000644 00000233171 15021223077 0021535 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Options; use Twilio\Values; abstract class ParticipantOptions { /** * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`. * @param string[] $statusCallbackEvent The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`. * @param string $label A label for this participant. If one is supplied, it may subsequently be used to fetch, update or delete the participant. * @param int $timeout The number of seconds that we should allow the phone to ring before assuming there is no answer. Can be an integer between `5` and `600`, inclusive. The default value is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 would result in an actual timeout that was closer to 15 seconds. * @param bool $record Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. * @param bool $muted Whether the agent is muted in the conference. Can be `true` or `false` and the default is `false`. * @param string $beep Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. * @param int $maxParticipants The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * @param string $conferenceRecord Whether to record the conference the participant is joining. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * @param string $conferenceTrim Whether to trim leading and trailing silence from the conference recording. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string[] $conferenceStatusCallbackEvent The conference state changes that should generate a call to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `modify`, `speaker`, and `announcement`. Separate multiple values with a space. Defaults to `start end`. * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $sipAuthUsername The SIP username used for authentication. * @param string $sipAuthPassword The SIP password for authentication. * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string[] $recordingStatusCallbackEvent The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`. * @param string[] $conferenceRecordingStatusCallbackEvent The conference recording state changes that generate a call to `conference_recording_status_callback`. Can be: `in-progress`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'` * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. * @param string $jitterBufferSize Jitter buffer size for the connecting participant. Twilio will use this setting to apply Jitter Buffer before participant's audio is mixed into the conference. Can be: `off`, `small`, `medium`, and `large`. Default to `large`. * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) * @param string $callerId The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `callerId` must also be a phone number. If `to` is sip address, this value of `callerId` should be a username portion to be used to populate the From header that is passed to the SIP endpoint. * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is sent from Twilio. `both` records the audio that is received and sent by Twilio. * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. * @param string $amdStatusCallback The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. * @param string $amdStatusCallbackMethod The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * @param string $trim Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. * @return CreateParticipantOptions Options builder */ public static function create( string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, array $statusCallbackEvent = Values::ARRAY_NONE, string $label = Values::NONE, int $timeout = Values::INT_NONE, bool $record = Values::BOOL_NONE, bool $muted = Values::BOOL_NONE, string $beep = Values::NONE, bool $startConferenceOnEnter = Values::BOOL_NONE, bool $endConferenceOnExit = Values::BOOL_NONE, string $waitUrl = Values::NONE, string $waitMethod = Values::NONE, bool $earlyMedia = Values::BOOL_NONE, int $maxParticipants = Values::INT_NONE, string $conferenceRecord = Values::NONE, string $conferenceTrim = Values::NONE, string $conferenceStatusCallback = Values::NONE, string $conferenceStatusCallbackMethod = Values::NONE, array $conferenceStatusCallbackEvent = Values::ARRAY_NONE, string $recordingChannels = Values::NONE, string $recordingStatusCallback = Values::NONE, string $recordingStatusCallbackMethod = Values::NONE, string $sipAuthUsername = Values::NONE, string $sipAuthPassword = Values::NONE, string $region = Values::NONE, string $conferenceRecordingStatusCallback = Values::NONE, string $conferenceRecordingStatusCallbackMethod = Values::NONE, array $recordingStatusCallbackEvent = Values::ARRAY_NONE, array $conferenceRecordingStatusCallbackEvent = Values::ARRAY_NONE, bool $coaching = Values::BOOL_NONE, string $callSidToCoach = Values::NONE, string $jitterBufferSize = Values::NONE, string $byoc = Values::NONE, string $callerId = Values::NONE, string $callReason = Values::NONE, string $recordingTrack = Values::NONE, int $timeLimit = Values::INT_NONE, string $machineDetection = Values::NONE, int $machineDetectionTimeout = Values::INT_NONE, int $machineDetectionSpeechThreshold = Values::INT_NONE, int $machineDetectionSpeechEndThreshold = Values::INT_NONE, int $machineDetectionSilenceTimeout = Values::INT_NONE, string $amdStatusCallback = Values::NONE, string $amdStatusCallbackMethod = Values::NONE, string $trim = Values::NONE, string $callToken = Values::NONE ): CreateParticipantOptions { return new CreateParticipantOptions( $statusCallback, $statusCallbackMethod, $statusCallbackEvent, $label, $timeout, $record, $muted, $beep, $startConferenceOnEnter, $endConferenceOnExit, $waitUrl, $waitMethod, $earlyMedia, $maxParticipants, $conferenceRecord, $conferenceTrim, $conferenceStatusCallback, $conferenceStatusCallbackMethod, $conferenceStatusCallbackEvent, $recordingChannels, $recordingStatusCallback, $recordingStatusCallbackMethod, $sipAuthUsername, $sipAuthPassword, $region, $conferenceRecordingStatusCallback, $conferenceRecordingStatusCallbackMethod, $recordingStatusCallbackEvent, $conferenceRecordingStatusCallbackEvent, $coaching, $callSidToCoach, $jitterBufferSize, $byoc, $callerId, $callReason, $recordingTrack, $timeLimit, $machineDetection, $machineDetectionTimeout, $machineDetectionSpeechThreshold, $machineDetectionSpeechEndThreshold, $machineDetectionSilenceTimeout, $amdStatusCallback, $amdStatusCallbackMethod, $trim, $callToken ); } /** * @param bool $muted Whether to return only participants that are muted. Can be: `true` or `false`. * @param bool $hold Whether to return only participants that are on hold. Can be: `true` or `false`. * @param bool $coaching Whether to return only participants who are coaching another call. Can be: `true` or `false`. * @return ReadParticipantOptions Options builder */ public static function read( bool $muted = Values::BOOL_NONE, bool $hold = Values::BOOL_NONE, bool $coaching = Values::BOOL_NONE ): ReadParticipantOptions { return new ReadParticipantOptions( $muted, $hold, $coaching ); } /** * @param bool $muted Whether the participant should be muted. Can be `true` or `false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`. * @param bool $hold Whether the participant should be on hold. Can be: `true` or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference. * @param string $holdUrl The URL we call using the `hold_method` for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. * @param string $holdMethod The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. * @param string $announceUrl The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. * @param string $announceMethod The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $waitUrl The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * @param bool $beepOnExit Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. * @return UpdateParticipantOptions Options builder */ public static function update( bool $muted = Values::BOOL_NONE, bool $hold = Values::BOOL_NONE, string $holdUrl = Values::NONE, string $holdMethod = Values::NONE, string $announceUrl = Values::NONE, string $announceMethod = Values::NONE, string $waitUrl = Values::NONE, string $waitMethod = Values::NONE, bool $beepOnExit = Values::BOOL_NONE, bool $endConferenceOnExit = Values::BOOL_NONE, bool $coaching = Values::BOOL_NONE, string $callSidToCoach = Values::NONE ): UpdateParticipantOptions { return new UpdateParticipantOptions( $muted, $hold, $holdUrl, $holdMethod, $announceUrl, $announceMethod, $waitUrl, $waitMethod, $beepOnExit, $endConferenceOnExit, $coaching, $callSidToCoach ); } } class CreateParticipantOptions extends Options { /** * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`. * @param string[] $statusCallbackEvent The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`. * @param string $label A label for this participant. If one is supplied, it may subsequently be used to fetch, update or delete the participant. * @param int $timeout The number of seconds that we should allow the phone to ring before assuming there is no answer. Can be an integer between `5` and `600`, inclusive. The default value is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 would result in an actual timeout that was closer to 15 seconds. * @param bool $record Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. * @param bool $muted Whether the agent is muted in the conference. Can be `true` or `false` and the default is `false`. * @param string $beep Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. * @param int $maxParticipants The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * @param string $conferenceRecord Whether to record the conference the participant is joining. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * @param string $conferenceTrim Whether to trim leading and trailing silence from the conference recording. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string[] $conferenceStatusCallbackEvent The conference state changes that should generate a call to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `modify`, `speaker`, and `announcement`. Separate multiple values with a space. Defaults to `start end`. * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $sipAuthUsername The SIP username used for authentication. * @param string $sipAuthPassword The SIP password for authentication. * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string[] $recordingStatusCallbackEvent The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`. * @param string[] $conferenceRecordingStatusCallbackEvent The conference recording state changes that generate a call to `conference_recording_status_callback`. Can be: `in-progress`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'` * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. * @param string $jitterBufferSize Jitter buffer size for the connecting participant. Twilio will use this setting to apply Jitter Buffer before participant's audio is mixed into the conference. Can be: `off`, `small`, `medium`, and `large`. Default to `large`. * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) * @param string $callerId The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `callerId` must also be a phone number. If `to` is sip address, this value of `callerId` should be a username portion to be used to populate the From header that is passed to the SIP endpoint. * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is sent from Twilio. `both` records the audio that is received and sent by Twilio. * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. * @param string $amdStatusCallback The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. * @param string $amdStatusCallbackMethod The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * @param string $trim Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. */ public function __construct( string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, array $statusCallbackEvent = Values::ARRAY_NONE, string $label = Values::NONE, int $timeout = Values::INT_NONE, bool $record = Values::BOOL_NONE, bool $muted = Values::BOOL_NONE, string $beep = Values::NONE, bool $startConferenceOnEnter = Values::BOOL_NONE, bool $endConferenceOnExit = Values::BOOL_NONE, string $waitUrl = Values::NONE, string $waitMethod = Values::NONE, bool $earlyMedia = Values::BOOL_NONE, int $maxParticipants = Values::INT_NONE, string $conferenceRecord = Values::NONE, string $conferenceTrim = Values::NONE, string $conferenceStatusCallback = Values::NONE, string $conferenceStatusCallbackMethod = Values::NONE, array $conferenceStatusCallbackEvent = Values::ARRAY_NONE, string $recordingChannels = Values::NONE, string $recordingStatusCallback = Values::NONE, string $recordingStatusCallbackMethod = Values::NONE, string $sipAuthUsername = Values::NONE, string $sipAuthPassword = Values::NONE, string $region = Values::NONE, string $conferenceRecordingStatusCallback = Values::NONE, string $conferenceRecordingStatusCallbackMethod = Values::NONE, array $recordingStatusCallbackEvent = Values::ARRAY_NONE, array $conferenceRecordingStatusCallbackEvent = Values::ARRAY_NONE, bool $coaching = Values::BOOL_NONE, string $callSidToCoach = Values::NONE, string $jitterBufferSize = Values::NONE, string $byoc = Values::NONE, string $callerId = Values::NONE, string $callReason = Values::NONE, string $recordingTrack = Values::NONE, int $timeLimit = Values::INT_NONE, string $machineDetection = Values::NONE, int $machineDetectionTimeout = Values::INT_NONE, int $machineDetectionSpeechThreshold = Values::INT_NONE, int $machineDetectionSpeechEndThreshold = Values::INT_NONE, int $machineDetectionSilenceTimeout = Values::INT_NONE, string $amdStatusCallback = Values::NONE, string $amdStatusCallbackMethod = Values::NONE, string $trim = Values::NONE, string $callToken = Values::NONE ) { $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['statusCallbackEvent'] = $statusCallbackEvent; $this->options['label'] = $label; $this->options['timeout'] = $timeout; $this->options['record'] = $record; $this->options['muted'] = $muted; $this->options['beep'] = $beep; $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; $this->options['endConferenceOnExit'] = $endConferenceOnExit; $this->options['waitUrl'] = $waitUrl; $this->options['waitMethod'] = $waitMethod; $this->options['earlyMedia'] = $earlyMedia; $this->options['maxParticipants'] = $maxParticipants; $this->options['conferenceRecord'] = $conferenceRecord; $this->options['conferenceTrim'] = $conferenceTrim; $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; $this->options['recordingChannels'] = $recordingChannels; $this->options['recordingStatusCallback'] = $recordingStatusCallback; $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; $this->options['sipAuthUsername'] = $sipAuthUsername; $this->options['sipAuthPassword'] = $sipAuthPassword; $this->options['region'] = $region; $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; $this->options['conferenceRecordingStatusCallbackEvent'] = $conferenceRecordingStatusCallbackEvent; $this->options['coaching'] = $coaching; $this->options['callSidToCoach'] = $callSidToCoach; $this->options['jitterBufferSize'] = $jitterBufferSize; $this->options['byoc'] = $byoc; $this->options['callerId'] = $callerId; $this->options['callReason'] = $callReason; $this->options['recordingTrack'] = $recordingTrack; $this->options['timeLimit'] = $timeLimit; $this->options['machineDetection'] = $machineDetection; $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; $this->options['amdStatusCallback'] = $amdStatusCallback; $this->options['amdStatusCallbackMethod'] = $amdStatusCallbackMethod; $this->options['trim'] = $trim; $this->options['callToken'] = $callToken; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`. * * @param string[] $statusCallbackEvent The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`. * @return $this Fluent Builder */ public function setStatusCallbackEvent(array $statusCallbackEvent): self { $this->options['statusCallbackEvent'] = $statusCallbackEvent; return $this; } /** * A label for this participant. If one is supplied, it may subsequently be used to fetch, update or delete the participant. * * @param string $label A label for this participant. If one is supplied, it may subsequently be used to fetch, update or delete the participant. * @return $this Fluent Builder */ public function setLabel(string $label): self { $this->options['label'] = $label; return $this; } /** * The number of seconds that we should allow the phone to ring before assuming there is no answer. Can be an integer between `5` and `600`, inclusive. The default value is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 would result in an actual timeout that was closer to 15 seconds. * * @param int $timeout The number of seconds that we should allow the phone to ring before assuming there is no answer. Can be an integer between `5` and `600`, inclusive. The default value is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 would result in an actual timeout that was closer to 15 seconds. * @return $this Fluent Builder */ public function setTimeout(int $timeout): self { $this->options['timeout'] = $timeout; return $this; } /** * Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. * * @param bool $record Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setRecord(bool $record): self { $this->options['record'] = $record; return $this; } /** * Whether the agent is muted in the conference. Can be `true` or `false` and the default is `false`. * * @param bool $muted Whether the agent is muted in the conference. Can be `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setMuted(bool $muted): self { $this->options['muted'] = $muted; return $this; } /** * Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * * @param string $beep Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * @return $this Fluent Builder */ public function setBeep(string $beep): self { $this->options['beep'] = $beep; return $this; } /** * Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * @return $this Fluent Builder */ public function setStartConferenceOnEnter(bool $startConferenceOnEnter): self { $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; return $this; } /** * Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * @return $this Fluent Builder */ public function setEndConferenceOnExit(bool $endConferenceOnExit): self { $this->options['endConferenceOnExit'] = $endConferenceOnExit; return $this; } /** * The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * @return $this Fluent Builder */ public function setWaitUrl(string $waitUrl): self { $this->options['waitUrl'] = $waitUrl; return $this; } /** * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * @return $this Fluent Builder */ public function setWaitMethod(string $waitMethod): self { $this->options['waitMethod'] = $waitMethod; return $this; } /** * Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. * * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. * @return $this Fluent Builder */ public function setEarlyMedia(bool $earlyMedia): self { $this->options['earlyMedia'] = $earlyMedia; return $this; } /** * The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * * @param int $maxParticipants The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * @return $this Fluent Builder */ public function setMaxParticipants(int $maxParticipants): self { $this->options['maxParticipants'] = $maxParticipants; return $this; } /** * Whether to record the conference the participant is joining. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * * @param string $conferenceRecord Whether to record the conference the participant is joining. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * @return $this Fluent Builder */ public function setConferenceRecord(string $conferenceRecord): self { $this->options['conferenceRecord'] = $conferenceRecord; return $this; } /** * Whether to trim leading and trailing silence from the conference recording. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * * @param string $conferenceTrim Whether to trim leading and trailing silence from the conference recording. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * @return $this Fluent Builder */ public function setConferenceTrim(string $conferenceTrim): self { $this->options['conferenceTrim'] = $conferenceTrim; return $this; } /** * The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * @return $this Fluent Builder */ public function setConferenceStatusCallback(string $conferenceStatusCallback): self { $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; return $this; } /** * The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setConferenceStatusCallbackMethod(string $conferenceStatusCallbackMethod): self { $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; return $this; } /** * The conference state changes that should generate a call to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `modify`, `speaker`, and `announcement`. Separate multiple values with a space. Defaults to `start end`. * * @param string[] $conferenceStatusCallbackEvent The conference state changes that should generate a call to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `modify`, `speaker`, and `announcement`. Separate multiple values with a space. Defaults to `start end`. * @return $this Fluent Builder */ public function setConferenceStatusCallbackEvent(array $conferenceStatusCallbackEvent): self { $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; return $this; } /** * The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * @return $this Fluent Builder */ public function setRecordingChannels(string $recordingChannels): self { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The URL that we should call using the `recording_status_callback_method` when the recording status changes. * * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. * @return $this Fluent Builder */ public function setRecordingStatusCallback(string $recordingStatusCallback): self { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * The SIP username used for authentication. * * @param string $sipAuthUsername The SIP username used for authentication. * @return $this Fluent Builder */ public function setSipAuthUsername(string $sipAuthUsername): self { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The SIP password for authentication. * * @param string $sipAuthPassword The SIP password for authentication. * @return $this Fluent Builder */ public function setSipAuthPassword(string $sipAuthPassword): self { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * @return $this Fluent Builder */ public function setRegion(string $region): self { $this->options['region'] = $region; return $this; } /** * The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallback(string $conferenceRecordingStatusCallback): self { $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; return $this; } /** * The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallbackMethod(string $conferenceRecordingStatusCallbackMethod): self { $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; return $this; } /** * The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`. * * @param string[] $recordingStatusCallbackEvent The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`. * @return $this Fluent Builder */ public function setRecordingStatusCallbackEvent(array $recordingStatusCallbackEvent): self { $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; return $this; } /** * The conference recording state changes that generate a call to `conference_recording_status_callback`. Can be: `in-progress`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'` * * @param string[] $conferenceRecordingStatusCallbackEvent The conference recording state changes that generate a call to `conference_recording_status_callback`. Can be: `in-progress`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'` * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallbackEvent(array $conferenceRecordingStatusCallbackEvent): self { $this->options['conferenceRecordingStatusCallbackEvent'] = $conferenceRecordingStatusCallbackEvent; return $this; } /** * Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * @return $this Fluent Builder */ public function setCoaching(bool $coaching): self { $this->options['coaching'] = $coaching; return $this; } /** * The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. * * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. * @return $this Fluent Builder */ public function setCallSidToCoach(string $callSidToCoach): self { $this->options['callSidToCoach'] = $callSidToCoach; return $this; } /** * Jitter buffer size for the connecting participant. Twilio will use this setting to apply Jitter Buffer before participant's audio is mixed into the conference. Can be: `off`, `small`, `medium`, and `large`. Default to `large`. * * @param string $jitterBufferSize Jitter buffer size for the connecting participant. Twilio will use this setting to apply Jitter Buffer before participant's audio is mixed into the conference. Can be: `off`, `small`, `medium`, and `large`. Default to `large`. * @return $this Fluent Builder */ public function setJitterBufferSize(string $jitterBufferSize): self { $this->options['jitterBufferSize'] = $jitterBufferSize; return $this; } /** * The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) * * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) * @return $this Fluent Builder */ public function setByoc(string $byoc): self { $this->options['byoc'] = $byoc; return $this; } /** * The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `callerId` must also be a phone number. If `to` is sip address, this value of `callerId` should be a username portion to be used to populate the From header that is passed to the SIP endpoint. * * @param string $callerId The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `callerId` must also be a phone number. If `to` is sip address, this value of `callerId` should be a username portion to be used to populate the From header that is passed to the SIP endpoint. * @return $this Fluent Builder */ public function setCallerId(string $callerId): self { $this->options['callerId'] = $callerId; return $this; } /** * The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) * * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) * @return $this Fluent Builder */ public function setCallReason(string $callReason): self { $this->options['callReason'] = $callReason; return $this; } /** * The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is sent from Twilio. `both` records the audio that is received and sent by Twilio. * * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is sent from Twilio. `both` records the audio that is received and sent by Twilio. * @return $this Fluent Builder */ public function setRecordingTrack(string $recordingTrack): self { $this->options['recordingTrack'] = $recordingTrack; return $this; } /** * The maximum duration of the call in seconds. Constraints depend on account and configuration. * * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. * @return $this Fluent Builder */ public function setTimeLimit(int $timeLimit): self { $this->options['timeLimit'] = $timeLimit; return $this; } /** * Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * @return $this Fluent Builder */ public function setMachineDetection(string $machineDetection): self { $this->options['machineDetection'] = $machineDetection; return $this; } /** * The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. * * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. * @return $this Fluent Builder */ public function setMachineDetectionTimeout(int $machineDetectionTimeout): self { $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; return $this; } /** * The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. * * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. * @return $this Fluent Builder */ public function setMachineDetectionSpeechThreshold(int $machineDetectionSpeechThreshold): self { $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; return $this; } /** * The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. * * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. * @return $this Fluent Builder */ public function setMachineDetectionSpeechEndThreshold(int $machineDetectionSpeechEndThreshold): self { $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; return $this; } /** * The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. * * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. * @return $this Fluent Builder */ public function setMachineDetectionSilenceTimeout(int $machineDetectionSilenceTimeout): self { $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; return $this; } /** * The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. * * @param string $amdStatusCallback The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. * @return $this Fluent Builder */ public function setAmdStatusCallback(string $amdStatusCallback): self { $this->options['amdStatusCallback'] = $amdStatusCallback; return $this; } /** * The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * * @param string $amdStatusCallbackMethod The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setAmdStatusCallbackMethod(string $amdStatusCallbackMethod): self { $this->options['amdStatusCallbackMethod'] = $amdStatusCallbackMethod; return $this; } /** * Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. * * @param string $trim Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. * @return $this Fluent Builder */ public function setTrim(string $trim): self { $this->options['trim'] = $trim; return $this; } /** * A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. * * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. * @return $this Fluent Builder */ public function setCallToken(string $callToken): self { $this->options['callToken'] = $callToken; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateParticipantOptions ' . $options . ']'; } } class ReadParticipantOptions extends Options { /** * @param bool $muted Whether to return only participants that are muted. Can be: `true` or `false`. * @param bool $hold Whether to return only participants that are on hold. Can be: `true` or `false`. * @param bool $coaching Whether to return only participants who are coaching another call. Can be: `true` or `false`. */ public function __construct( bool $muted = Values::BOOL_NONE, bool $hold = Values::BOOL_NONE, bool $coaching = Values::BOOL_NONE ) { $this->options['muted'] = $muted; $this->options['hold'] = $hold; $this->options['coaching'] = $coaching; } /** * Whether to return only participants that are muted. Can be: `true` or `false`. * * @param bool $muted Whether to return only participants that are muted. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMuted(bool $muted): self { $this->options['muted'] = $muted; return $this; } /** * Whether to return only participants that are on hold. Can be: `true` or `false`. * * @param bool $hold Whether to return only participants that are on hold. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setHold(bool $hold): self { $this->options['hold'] = $hold; return $this; } /** * Whether to return only participants who are coaching another call. Can be: `true` or `false`. * * @param bool $coaching Whether to return only participants who are coaching another call. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setCoaching(bool $coaching): self { $this->options['coaching'] = $coaching; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadParticipantOptions ' . $options . ']'; } } class UpdateParticipantOptions extends Options { /** * @param bool $muted Whether the participant should be muted. Can be `true` or `false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`. * @param bool $hold Whether the participant should be on hold. Can be: `true` or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference. * @param string $holdUrl The URL we call using the `hold_method` for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. * @param string $holdMethod The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. * @param string $announceUrl The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. * @param string $announceMethod The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $waitUrl The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * @param bool $beepOnExit Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. */ public function __construct( bool $muted = Values::BOOL_NONE, bool $hold = Values::BOOL_NONE, string $holdUrl = Values::NONE, string $holdMethod = Values::NONE, string $announceUrl = Values::NONE, string $announceMethod = Values::NONE, string $waitUrl = Values::NONE, string $waitMethod = Values::NONE, bool $beepOnExit = Values::BOOL_NONE, bool $endConferenceOnExit = Values::BOOL_NONE, bool $coaching = Values::BOOL_NONE, string $callSidToCoach = Values::NONE ) { $this->options['muted'] = $muted; $this->options['hold'] = $hold; $this->options['holdUrl'] = $holdUrl; $this->options['holdMethod'] = $holdMethod; $this->options['announceUrl'] = $announceUrl; $this->options['announceMethod'] = $announceMethod; $this->options['waitUrl'] = $waitUrl; $this->options['waitMethod'] = $waitMethod; $this->options['beepOnExit'] = $beepOnExit; $this->options['endConferenceOnExit'] = $endConferenceOnExit; $this->options['coaching'] = $coaching; $this->options['callSidToCoach'] = $callSidToCoach; } /** * Whether the participant should be muted. Can be `true` or `false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`. * * @param bool $muted Whether the participant should be muted. Can be `true` or `false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`. * @return $this Fluent Builder */ public function setMuted(bool $muted): self { $this->options['muted'] = $muted; return $this; } /** * Whether the participant should be on hold. Can be: `true` or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference. * * @param bool $hold Whether the participant should be on hold. Can be: `true` or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference. * @return $this Fluent Builder */ public function setHold(bool $hold): self { $this->options['hold'] = $hold; return $this; } /** * The URL we call using the `hold_method` for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. * * @param string $holdUrl The URL we call using the `hold_method` for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. * @return $this Fluent Builder */ public function setHoldUrl(string $holdUrl): self { $this->options['holdUrl'] = $holdUrl; return $this; } /** * The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. * * @param string $holdMethod The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. * @return $this Fluent Builder */ public function setHoldMethod(string $holdMethod): self { $this->options['holdMethod'] = $holdMethod; return $this; } /** * The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. * * @param string $announceUrl The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. * @return $this Fluent Builder */ public function setAnnounceUrl(string $announceUrl): self { $this->options['announceUrl'] = $announceUrl; return $this; } /** * The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $announceMethod The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setAnnounceMethod(string $announceMethod): self { $this->options['announceMethod'] = $announceMethod; return $this; } /** * The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * * @param string $waitUrl The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * @return $this Fluent Builder */ public function setWaitUrl(string $waitUrl): self { $this->options['waitUrl'] = $waitUrl; return $this; } /** * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * @return $this Fluent Builder */ public function setWaitMethod(string $waitMethod): self { $this->options['waitMethod'] = $waitMethod; return $this; } /** * Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. * * @param bool $beepOnExit Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setBeepOnExit(bool $beepOnExit): self { $this->options['beepOnExit'] = $beepOnExit; return $this; } /** * Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * @return $this Fluent Builder */ public function setEndConferenceOnExit(bool $endConferenceOnExit): self { $this->options['endConferenceOnExit'] = $endConferenceOnExit; return $this; } /** * Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * @return $this Fluent Builder */ public function setCoaching(bool $coaching): self { $this->options['coaching'] = $coaching; return $this; } /** * The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. * * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. * @return $this Fluent Builder */ public function setCallSidToCoach(string $callSidToCoach): self { $this->options['callSidToCoach'] = $callSidToCoach; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateParticipantOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantInstance.php 0000644 00000013605 15021223077 0021644 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $callSid * @property string|null $label * @property string|null $callSidToCoach * @property bool|null $coaching * @property string|null $conferenceSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property bool|null $endConferenceOnExit * @property bool|null $muted * @property bool|null $hold * @property bool|null $startConferenceOnEnter * @property string $status * @property string|null $queueTime * @property string|null $uri */ class ParticipantInstance extends InstanceResource { /** * Initialize the ParticipantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $conferenceSid The SID of the participant's conference. * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID or label of the participant to delete. Non URL safe characters in a label must be percent encoded, for example, a space character is represented as %20. */ public function __construct(Version $version, array $payload, string $accountSid, string $conferenceSid, string $callSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'callSid' => Values::array_get($payload, 'call_sid'), 'label' => Values::array_get($payload, 'label'), 'callSidToCoach' => Values::array_get($payload, 'call_sid_to_coach'), 'coaching' => Values::array_get($payload, 'coaching'), 'conferenceSid' => Values::array_get($payload, 'conference_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endConferenceOnExit' => Values::array_get($payload, 'end_conference_on_exit'), 'muted' => Values::array_get($payload, 'muted'), 'hold' => Values::array_get($payload, 'hold'), 'startConferenceOnEnter' => Values::array_get($payload, 'start_conference_on_enter'), 'status' => Values::array_get($payload, 'status'), 'queueTime' => Values::array_get($payload, 'queue_time'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'callSid' => $callSid ?: $this->properties['callSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ParticipantContext Context for this ParticipantInstance */ protected function proxy(): ParticipantContext { if (!$this->context) { $this->context = new ParticipantContext( $this->version, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['callSid'] ); } return $this->context; } /** * Delete the ParticipantInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { return $this->proxy()->fetch(); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ParticipantInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ParticipantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantContext.php 0000644 00000011317 15021223077 0021522 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class ParticipantContext extends InstanceContext { /** * Initialize the ParticipantContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $conferenceSid The SID of the participant's conference. * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID or label of the participant to delete. Non URL safe characters in a label must be percent encoded, for example, a space character is represented as %20. */ public function __construct( Version $version, $accountSid, $conferenceSid, $callSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Conferences/' . \rawurlencode($conferenceSid) .'/Participants/' . \rawurlencode($callSid) .'.json'; } /** * Delete the ParticipantInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ParticipantInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['callSid'] ); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ParticipantInstance { $options = new Values($options); $data = Values::of([ 'Muted' => Serialize::booleanToString($options['muted']), 'Hold' => Serialize::booleanToString($options['hold']), 'HoldUrl' => $options['holdUrl'], 'HoldMethod' => $options['holdMethod'], 'AnnounceUrl' => $options['announceUrl'], 'AnnounceMethod' => $options['announceMethod'], 'WaitUrl' => $options['waitUrl'], 'WaitMethod' => $options['waitMethod'], 'BeepOnExit' => Serialize::booleanToString($options['beepOnExit']), 'EndConferenceOnExit' => Serialize::booleanToString($options['endConferenceOnExit']), 'Coaching' => Serialize::booleanToString($options['coaching']), 'CallSidToCoach' => $options['callSidToCoach'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ParticipantInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['callSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ParticipantContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantPage.php 0000644 00000003206 15021223077 0020750 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ParticipantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ParticipantInstance \Twilio\Rest\Api\V2010\Account\Conference\ParticipantInstance */ public function buildInstance(array $payload): ParticipantInstance { return new ParticipantInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ParticipantPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantList.php 0000644 00000030611 15021223077 0021007 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $conferenceSid The SID of the participant's conference. */ public function __construct( Version $version, string $accountSid, string $conferenceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Conferences/' . \rawurlencode($conferenceSid) .'/Participants.json'; } /** * Create the ParticipantInstance * * @param string $from The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `from` must also be a phone number. If `to` is sip address, this value of `from` should be a username portion to be used to populate the P-Asserted-Identity header that is passed to the SIP endpoint. * @param string $to The phone number, SIP address, or Client identifier that received this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as `sip:name@company.com`. Client identifiers are formatted `client:name`. [Custom parameters](https://www.twilio.com/docs/voice/api/conference-participant-resource#custom-parameters) may also be specified. * @param array|Options $options Optional Arguments * @return ParticipantInstance Created ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $from, string $to, array $options = []): ParticipantInstance { $options = new Values($options); $data = Values::of([ 'From' => $from, 'To' => $to, 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'StatusCallbackEvent' => Serialize::map($options['statusCallbackEvent'], function ($e) { return $e; }), 'Label' => $options['label'], 'Timeout' => $options['timeout'], 'Record' => Serialize::booleanToString($options['record']), 'Muted' => Serialize::booleanToString($options['muted']), 'Beep' => $options['beep'], 'StartConferenceOnEnter' => Serialize::booleanToString($options['startConferenceOnEnter']), 'EndConferenceOnExit' => Serialize::booleanToString($options['endConferenceOnExit']), 'WaitUrl' => $options['waitUrl'], 'WaitMethod' => $options['waitMethod'], 'EarlyMedia' => Serialize::booleanToString($options['earlyMedia']), 'MaxParticipants' => $options['maxParticipants'], 'ConferenceRecord' => $options['conferenceRecord'], 'ConferenceTrim' => $options['conferenceTrim'], 'ConferenceStatusCallback' => $options['conferenceStatusCallback'], 'ConferenceStatusCallbackMethod' => $options['conferenceStatusCallbackMethod'], 'ConferenceStatusCallbackEvent' => Serialize::map($options['conferenceStatusCallbackEvent'], function ($e) { return $e; }), 'RecordingChannels' => $options['recordingChannels'], 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'Region' => $options['region'], 'ConferenceRecordingStatusCallback' => $options['conferenceRecordingStatusCallback'], 'ConferenceRecordingStatusCallbackMethod' => $options['conferenceRecordingStatusCallbackMethod'], 'RecordingStatusCallbackEvent' => Serialize::map($options['recordingStatusCallbackEvent'], function ($e) { return $e; }), 'ConferenceRecordingStatusCallbackEvent' => Serialize::map($options['conferenceRecordingStatusCallbackEvent'], function ($e) { return $e; }), 'Coaching' => Serialize::booleanToString($options['coaching']), 'CallSidToCoach' => $options['callSidToCoach'], 'JitterBufferSize' => $options['jitterBufferSize'], 'Byoc' => $options['byoc'], 'CallerId' => $options['callerId'], 'CallReason' => $options['callReason'], 'RecordingTrack' => $options['recordingTrack'], 'TimeLimit' => $options['timeLimit'], 'MachineDetection' => $options['machineDetection'], 'MachineDetectionTimeout' => $options['machineDetectionTimeout'], 'MachineDetectionSpeechThreshold' => $options['machineDetectionSpeechThreshold'], 'MachineDetectionSpeechEndThreshold' => $options['machineDetectionSpeechEndThreshold'], 'MachineDetectionSilenceTimeout' => $options['machineDetectionSilenceTimeout'], 'AmdStatusCallback' => $options['amdStatusCallback'], 'AmdStatusCallbackMethod' => $options['amdStatusCallbackMethod'], 'Trim' => $options['trim'], 'CallToken' => $options['callToken'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ParticipantInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'] ); } /** * Reads ParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ParticipantPage Page of ParticipantInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ParticipantPage { $options = new Values($options); $params = Values::of([ 'Muted' => Serialize::booleanToString($options['muted']), 'Hold' => Serialize::booleanToString($options['hold']), 'Coaching' => Serialize::booleanToString($options['coaching']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ParticipantPage Page of ParticipantInstance */ public function getPage(string $targetUrl): ParticipantPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Constructs a ParticipantContext * * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID or label of the participant to delete. Non URL safe characters in a label must be percent encoded, for example, a space character is represented as %20. */ public function getContext( string $callSid ): ParticipantContext { return new ParticipantContext( $this->version, $this->solution['accountSid'], $this->solution['conferenceSid'], $callSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ParticipantList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingContext.php 0000644 00000007477 15021223077 0021174 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class RecordingContext extends InstanceContext { /** * Initialize the RecordingContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference Recording resources to delete. * @param string $conferenceSid The Conference SID that identifies the conference associated with the recording to delete. * @param string $sid The Twilio-provided string that uniquely identifies the Conference Recording resource to delete. */ public function __construct( Version $version, $accountSid, $conferenceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Conferences/' . \rawurlencode($conferenceSid) .'/Recordings/' . \rawurlencode($sid) .'.json'; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['sid'] ); } /** * Update the RecordingInstance * * @param string $status * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): RecordingInstance { $options = new Values($options); $data = Values::of([ 'Status' => $status, 'PauseBehavior' => $options['pauseBehavior'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingInstance.php 0000644 00000013776 15021223077 0021313 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $callSid * @property string|null $conferenceSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property \DateTime|null $startTime * @property string|null $duration * @property string|null $sid * @property string|null $price * @property string|null $priceUnit * @property string $status * @property int|null $channels * @property string $source * @property int|null $errorCode * @property array|null $encryptionDetails * @property string|null $uri */ class RecordingInstance extends InstanceResource { /** * Initialize the RecordingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference Recording resources to delete. * @param string $conferenceSid The Conference SID that identifies the conference associated with the recording to delete. * @param string $sid The Twilio-provided string that uniquely identifies the Conference Recording resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $conferenceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callSid' => Values::array_get($payload, 'call_sid'), 'conferenceSid' => Values::array_get($payload, 'conference_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'duration' => Values::array_get($payload, 'duration'), 'sid' => Values::array_get($payload, 'sid'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'status' => Values::array_get($payload, 'status'), 'channels' => Values::array_get($payload, 'channels'), 'source' => Values::array_get($payload, 'source'), 'errorCode' => Values::array_get($payload, 'error_code'), 'encryptionDetails' => Values::array_get($payload, 'encryption_details'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RecordingContext Context for this RecordingInstance */ protected function proxy(): RecordingContext { if (!$this->context) { $this->context = new RecordingContext( $this->version, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { return $this->proxy()->fetch(); } /** * Update the RecordingInstance * * @param string $status * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): RecordingInstance { return $this->proxy()->update($status, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TokenList.php 0000644 00000004207 15021223077 0015544 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class TokenList extends ListResource { /** * Construct the TokenList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Tokens.json'; } /** * Create the TokenInstance * * @param array|Options $options Optional Arguments * @return TokenInstance Created TokenInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): TokenInstance { $options = new Values($options); $data = Values::of([ 'Ttl' => $options['ttl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TokenInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TokenList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceContext.php 0000644 00000013052 15021223077 0017242 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Conference\ParticipantList; use Twilio\Rest\Api\V2010\Account\Conference\RecordingList; /** * @property ParticipantList $participants * @property RecordingList $recordings * @method \Twilio\Rest\Api\V2010\Account\Conference\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Conference\ParticipantContext participants(string $callSid) */ class ConferenceContext extends InstanceContext { protected $_participants; protected $_recordings; /** * Initialize the ConferenceContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference resource(s) to fetch. * @param string $sid The Twilio-provided string that uniquely identifies the Conference resource to fetch */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Conferences/' . \rawurlencode($sid) .'.json'; } /** * Fetch the ConferenceInstance * * @return ConferenceInstance Fetched ConferenceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConferenceInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConferenceInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the ConferenceInstance * * @param array|Options $options Optional Arguments * @return ConferenceInstance Updated ConferenceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConferenceInstance { $options = new Values($options); $data = Values::of([ 'Status' => $options['status'], 'AnnounceUrl' => $options['announceUrl'], 'AnnounceMethod' => $options['announceMethod'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ConferenceInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the participants */ protected function getParticipants(): ParticipantList { if (!$this->_participants) { $this->_participants = new ParticipantList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_participants; } /** * Access the recordings */ protected function getRecordings(): RecordingList { if (!$this->_recordings) { $this->_recordings = new RecordingList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_recordings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ConferenceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyInstance.php 0000644 00000010270 15021223077 0017361 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class SigningKeyInstance extends InstanceResource { /** * Initialize the SigningKeyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid * @param string $sid */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SigningKeyContext Context for this SigningKeyInstance */ protected function proxy(): SigningKeyContext { if (!$this->context) { $this->context = new SigningKeyContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the SigningKeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SigningKeyInstance * * @return SigningKeyInstance Fetched SigningKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SigningKeyInstance { return $this->proxy()->fetch(); } /** * Update the SigningKeyInstance * * @param array|Options $options Optional Arguments * @return SigningKeyInstance Updated SigningKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SigningKeyInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.SigningKeyInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionInstance.php 0000644 00000011701 15021223077 0020151 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $duration * @property string|null $price * @property string|null $priceUnit * @property string|null $recordingSid * @property string|null $sid * @property string $status * @property string|null $transcriptionText * @property string|null $type * @property string|null $uri */ class TranscriptionInstance extends InstanceResource { /** * Initialize the TranscriptionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resources to delete. * @param string $sid The Twilio-provided string that uniquely identifies the Transcription resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'duration' => Values::array_get($payload, 'duration'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'recordingSid' => Values::array_get($payload, 'recording_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'transcriptionText' => Values::array_get($payload, 'transcription_text'), 'type' => Values::array_get($payload, 'type'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TranscriptionContext Context for this TranscriptionInstance */ protected function proxy(): TranscriptionContext { if (!$this->context) { $this->context = new TranscriptionContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the TranscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TranscriptionInstance * * @return TranscriptionInstance Fetched TranscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TranscriptionInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.TranscriptionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TokenPage.php 0000644 00000003052 15021223077 0015502 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TokenPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TokenInstance \Twilio\Rest\Api\V2010\Account\TokenInstance */ public function buildInstance(array $payload): TokenInstance { return new TokenInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TokenPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberOptions.php 0000644 00000155234 15021223077 0021121 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class IncomingPhoneNumberOptions { /** * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * @param string $areaCode The desired area code for your new incoming phone number. Can be any three-digit, US or Canada area code. We will provision an available phone number within this area code for you. **You must provide an `area_code` or a `phone_number`.** (US and Canada only). * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the new phone number. * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @param string $emergencyStatus * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @param string $voiceReceiveMode * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * @return CreateIncomingPhoneNumberOptions Options builder */ public static function create( string $phoneNumber = Values::NONE, string $areaCode = Values::NONE, string $apiVersion = Values::NONE, string $friendlyName = Values::NONE, string $smsApplicationSid = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $voiceApplicationSid = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE ): CreateIncomingPhoneNumberOptions { return new CreateIncomingPhoneNumberOptions( $phoneNumber, $areaCode, $apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $emergencyStatus, $emergencyAddressSid, $trunkSid, $identitySid, $addressSid, $voiceReceiveMode, $bundleSid ); } /** * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $friendlyName A string that identifies the IncomingPhoneNumber resources to read. * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * @return ReadIncomingPhoneNumberOptions Options builder */ public static function read( bool $beta = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE ): ReadIncomingPhoneNumberOptions { return new ReadIncomingPhoneNumberOptions( $beta, $friendlyName, $phoneNumber, $origin ); } /** * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). * @param string $apiVersion The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. * @param string $friendlyName A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceApplicationSid The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceUrl The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @param string $emergencyStatus * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from this phone number. * @param string $trunkSid The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @param string $voiceReceiveMode * @param string $identitySid The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations. * @param string $addressSid The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * @return UpdateIncomingPhoneNumberOptions Options builder */ public static function update( string $accountSid = Values::NONE, string $apiVersion = Values::NONE, string $friendlyName = Values::NONE, string $smsApplicationSid = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $voiceApplicationSid = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $bundleSid = Values::NONE ): UpdateIncomingPhoneNumberOptions { return new UpdateIncomingPhoneNumberOptions( $accountSid, $apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $emergencyStatus, $emergencyAddressSid, $trunkSid, $voiceReceiveMode, $identitySid, $addressSid, $bundleSid ); } } class CreateIncomingPhoneNumberOptions extends Options { /** * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * @param string $areaCode The desired area code for your new incoming phone number. Can be any three-digit, US or Canada area code. We will provision an available phone number within this area code for you. **You must provide an `area_code` or a `phone_number`.** (US and Canada only). * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the new phone number. * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @param string $emergencyStatus * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @param string $voiceReceiveMode * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. */ public function __construct( string $phoneNumber = Values::NONE, string $areaCode = Values::NONE, string $apiVersion = Values::NONE, string $friendlyName = Values::NONE, string $smsApplicationSid = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $voiceApplicationSid = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE ) { $this->options['phoneNumber'] = $phoneNumber; $this->options['areaCode'] = $areaCode; $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * The desired area code for your new incoming phone number. Can be any three-digit, US or Canada area code. We will provision an available phone number within this area code for you. **You must provide an `area_code` or a `phone_number`.** (US and Canada only). * * @param string $areaCode The desired area code for your new incoming phone number. Can be any three-digit, US or Canada area code. We will provision an available phone number within this area code for you. **You must provide an `area_code` or a `phone_number`.** (US and Canada only). * @return $this Fluent Builder */ public function setAreaCode(string $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the new phone number. * * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the new phone number. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * @return $this Fluent Builder */ public function setSmsApplicationSid(string $smsApplicationSid): self { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call when the new phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @return $this Fluent Builder */ public function setVoiceApplicationSid(string $voiceApplicationSid): self { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @return $this Fluent Builder */ public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * @param string $emergencyStatus * @return $this Fluent Builder */ public function setEmergencyStatus(string $emergencyStatus): self { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The SID of the emergency address configuration to use for emergency calling from the new phone number. * * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @return $this Fluent Builder */ public function setEmergencyAddressSid(string $emergencyAddressSid): self { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @return $this Fluent Builder */ public function setTrunkSid(string $trunkSid): self { $this->options['trunkSid'] = $trunkSid; return $this; } /** * The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * @return $this Fluent Builder */ public function setIdentitySid(string $identitySid): self { $this->options['identitySid'] = $identitySid; return $this; } /** * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * @param string $voiceReceiveMode * @return $this Fluent Builder */ public function setVoiceReceiveMode(string $voiceReceiveMode): self { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * @return $this Fluent Builder */ public function setBundleSid(string $bundleSid): self { $this->options['bundleSid'] = $bundleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateIncomingPhoneNumberOptions ' . $options . ']'; } } class ReadIncomingPhoneNumberOptions extends Options { /** * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $friendlyName A string that identifies the IncomingPhoneNumber resources to read. * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ public function __construct( bool $beta = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE ) { $this->options['beta'] = $beta; $this->options['friendlyName'] = $friendlyName; $this->options['phoneNumber'] = $phoneNumber; $this->options['origin'] = $origin; } /** * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * A string that identifies the IncomingPhoneNumber resources to read. * * @param string $friendlyName A string that identifies the IncomingPhoneNumber resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * @return $this Fluent Builder */ public function setOrigin(string $origin): self { $this->options['origin'] = $origin; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadIncomingPhoneNumberOptions ' . $options . ']'; } } class UpdateIncomingPhoneNumberOptions extends Options { /** * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). * @param string $apiVersion The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. * @param string $friendlyName A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceApplicationSid The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceUrl The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @param string $emergencyStatus * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from this phone number. * @param string $trunkSid The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @param string $voiceReceiveMode * @param string $identitySid The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations. * @param string $addressSid The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. */ public function __construct( string $accountSid = Values::NONE, string $apiVersion = Values::NONE, string $friendlyName = Values::NONE, string $smsApplicationSid = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $voiceApplicationSid = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $bundleSid = Values::NONE ) { $this->options['accountSid'] = $accountSid; $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['bundleSid'] = $bundleSid; } /** * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). * * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). * @return $this Fluent Builder */ public function setAccountSid(string $accountSid): self { $this->options['accountSid'] = $accountSid; return $this; } /** * The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * * @param string $friendlyName A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * @return $this Fluent Builder */ public function setSmsApplicationSid(string $smsApplicationSid): self { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call when the phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * * @param string $voiceApplicationSid The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @return $this Fluent Builder */ public function setVoiceApplicationSid(string $voiceApplicationSid): self { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @return $this Fluent Builder */ public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * * @param string $voiceUrl The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * @param string $emergencyStatus * @return $this Fluent Builder */ public function setEmergencyStatus(string $emergencyStatus): self { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The SID of the emergency address configuration to use for emergency calling from this phone number. * * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from this phone number. * @return $this Fluent Builder */ public function setEmergencyAddressSid(string $emergencyAddressSid): self { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * * @param string $trunkSid The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @return $this Fluent Builder */ public function setTrunkSid(string $trunkSid): self { $this->options['trunkSid'] = $trunkSid; return $this; } /** * @param string $voiceReceiveMode * @return $this Fluent Builder */ public function setVoiceReceiveMode(string $voiceReceiveMode): self { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations. * * @param string $identitySid The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations. * @return $this Fluent Builder */ public function setIdentitySid(string $identitySid): self { $this->options['identitySid'] = $identitySid; return $this; } /** * The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. * * @param string $addressSid The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * @return $this Fluent Builder */ public function setBundleSid(string $bundleSid): self { $this->options['bundleSid'] = $bundleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateIncomingPhoneNumberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SipInstance.php 0000644 00000003732 15021223077 0016052 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Version; class SipInstance extends InstanceResource { /** * Initialize the SipInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the SipDomain resources to read. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.SipInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeList.php 0000644 00000013561 15021223077 0016361 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ShortCodeList extends ListResource { /** * Construct the ShortCodeList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ShortCode resource(s) to fetch. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SMS/ShortCodes.json'; } /** * Reads ShortCodeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ShortCodeInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ShortCodeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ShortCodeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ShortCodePage Page of ShortCodeInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ShortCodePage { $options = new Values($options); $params = Values::of([ 'FriendlyName' => $options['friendlyName'], 'ShortCode' => $options['shortCode'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ShortCodePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ShortCodeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ShortCodePage Page of ShortCodeInstance */ public function getPage(string $targetUrl): ShortCodePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ShortCodePage($this->version, $response, $this->solution); } /** * Constructs a ShortCodeContext * * @param string $sid The Twilio-provided string that uniquely identifies the ShortCode resource to fetch */ public function getContext( string $sid ): ShortCodeContext { return new ShortCodeContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ShortCodeList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestPage.php 0000644 00000003162 15021223077 0020067 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ValidationRequestPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ValidationRequestInstance \Twilio\Rest\Api\V2010\Account\ValidationRequestInstance */ public function buildInstance(array $payload): ValidationRequestInstance { return new ValidationRequestInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ValidationRequestPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/RecordingList.php 0000644 00000014445 15021223077 0016405 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class RecordingList extends ListResource { /** * Construct the RecordingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resources to delete. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings.json'; } /** * Reads RecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RecordingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RecordingPage Page of RecordingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RecordingPage { $options = new Values($options); $params = Values::of([ 'DateCreated<' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateCreated>' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'CallSid' => $options['callSid'], 'ConferenceSid' => $options['conferenceSid'], 'IncludeSoftDeleted' => Serialize::booleanToString($options['includeSoftDeleted']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RecordingPage Page of RecordingInstance */ public function getPage(string $targetUrl): RecordingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RecordingPage($this->version, $response, $this->solution); } /** * Constructs a RecordingContext * * @param string $sid The Twilio-provided string that uniquely identifies the Recording resource to delete. */ public function getContext( string $sid ): RecordingContext { return new RecordingContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.RecordingList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NotificationContext.php 0000644 00000004537 15021223077 0017631 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class NotificationContext extends InstanceContext { /** * Initialize the NotificationContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Notification resource to fetch. * @param string $sid The Twilio-provided string that uniquely identifies the Notification resource to fetch. */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Notifications/' . \rawurlencode($sid) .'.json'; } /** * Fetch the NotificationInstance * * @return NotificationInstance Fetched NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NotificationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new NotificationInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.NotificationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListContext.php 0000644 00000012135 15021223077 0020635 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialList; /** * @property CredentialList $credentials * @method \Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialContext credentials(string $sid) */ class CredentialListContext extends InstanceContext { protected $_credentials; /** * Initialize the CredentialListContext * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible for this resource. * @param string $sid The credential list Sid that uniquely identifies this resource */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/CredentialLists/' . \rawurlencode($sid) .'.json'; } /** * Delete the CredentialListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CredentialListInstance * * @return CredentialListInstance Fetched CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialListInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialListInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the CredentialListInstance * * @param string $friendlyName A human readable descriptive text for a CredentialList, up to 64 characters long. * @return CredentialListInstance Updated CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): CredentialListInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CredentialListInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the credentials */ protected function getCredentials(): CredentialList { if (!$this->_credentials) { $this->_credentials = new CredentialList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_credentials; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainInstance.php 0000644 00000016231 15021223077 0017257 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypesList; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $authType * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $domainName * @property string|null $friendlyName * @property string|null $sid * @property string|null $uri * @property string|null $voiceFallbackMethod * @property string|null $voiceFallbackUrl * @property string|null $voiceMethod * @property string|null $voiceStatusCallbackMethod * @property string|null $voiceStatusCallbackUrl * @property string|null $voiceUrl * @property array|null $subresourceUris * @property bool|null $sipRegistration * @property bool|null $emergencyCallingEnabled * @property bool|null $secure * @property string|null $byocTrunkSid * @property string|null $emergencyCallerSid */ class DomainInstance extends InstanceResource { protected $_credentialListMappings; protected $_ipAccessControlListMappings; protected $_auth; /** * Initialize the DomainInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $sid The Twilio-provided string that uniquely identifies the SipDomain resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'authType' => Values::array_get($payload, 'auth_type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'domainName' => Values::array_get($payload, 'domain_name'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceStatusCallbackMethod' => Values::array_get($payload, 'voice_status_callback_method'), 'voiceStatusCallbackUrl' => Values::array_get($payload, 'voice_status_callback_url'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'sipRegistration' => Values::array_get($payload, 'sip_registration'), 'emergencyCallingEnabled' => Values::array_get($payload, 'emergency_calling_enabled'), 'secure' => Values::array_get($payload, 'secure'), 'byocTrunkSid' => Values::array_get($payload, 'byoc_trunk_sid'), 'emergencyCallerSid' => Values::array_get($payload, 'emergency_caller_sid'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DomainContext Context for this DomainInstance */ protected function proxy(): DomainContext { if (!$this->context) { $this->context = new DomainContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the DomainInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DomainInstance * * @return DomainInstance Fetched DomainInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainInstance { return $this->proxy()->fetch(); } /** * Update the DomainInstance * * @param array|Options $options Optional Arguments * @return DomainInstance Updated DomainInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DomainInstance { return $this->proxy()->update($options); } /** * Access the credentialListMappings */ protected function getCredentialListMappings(): CredentialListMappingList { return $this->proxy()->credentialListMappings; } /** * Access the ipAccessControlListMappings */ protected function getIpAccessControlListMappings(): IpAccessControlListMappingList { return $this->proxy()->ipAccessControlListMappings; } /** * Access the auth */ protected function getAuth(): AuthTypesList { return $this->proxy()->auth; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.DomainInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListPage.php 0000644 00000003206 15021223077 0021045 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class IpAccessControlListPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return IpAccessControlListInstance \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlListInstance */ public function buildInstance(array $payload): IpAccessControlListInstance { return new IpAccessControlListInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.IpAccessControlListPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialContext.php 0000644 00000007244 15021223077 0022714 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible for this resource. * @param string $credentialListSid The unique id that identifies the credential list to include the created credential. * @param string $sid The unique id that identifies the resource to delete. */ public function __construct( Version $version, $accountSid, $credentialListSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'credentialListSid' => $credentialListSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/CredentialLists/' . \rawurlencode($credentialListSid) .'/Credentials/' . \rawurlencode($sid) .'.json'; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['credentialListSid'], $this->solution['sid'] ); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { $options = new Values($options); $data = Values::of([ 'Password' => $options['password'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['credentialListSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialOptions.php 0000644 00000004751 15021223077 0022723 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $password The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) * @return UpdateCredentialOptions Options builder */ public static function update( string $password = Values::NONE ): UpdateCredentialOptions { return new UpdateCredentialOptions( $password ); } } class UpdateCredentialOptions extends Options { /** * @param string $password The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) */ public function __construct( string $password = Values::NONE ) { $this->options['password'] = $password; } /** * The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) * * @param string $password The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) * @return $this Fluent Builder */ public function setPassword(string $password): self { $this->options['password'] = $password; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateCredentialOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialInstance.php 0000644 00000011566 15021223077 0023036 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $credentialListSid * @property string|null $username * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $uri */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique id of the Account that is responsible for this resource. * @param string $credentialListSid The unique id that identifies the credential list to include the created credential. * @param string $sid The unique id that identifies the resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $credentialListSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'credentialListSid' => Values::array_get($payload, 'credential_list_sid'), 'username' => Values::array_get($payload, 'username'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'credentialListSid' => $credentialListSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialContext Context for this CredentialInstance */ protected function proxy(): CredentialContext { if (!$this->context) { $this->context = new CredentialContext( $this->version, $this->solution['accountSid'], $this->solution['credentialListSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialPage.php 0000644 00000003224 15021223077 0022136 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CredentialInstance \Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialInstance */ public function buildInstance(array $payload): CredentialInstance { return new CredentialInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['credentialListSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.CredentialPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialList.php 0000644 00000015647 15021223077 0022211 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible for this resource. * @param string $credentialListSid The unique id that identifies the credential list to include the created credential. */ public function __construct( Version $version, string $accountSid, string $credentialListSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'credentialListSid' => $credentialListSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/CredentialLists/' . \rawurlencode($credentialListSid) .'/Credentials.json'; } /** * Create the CredentialInstance * * @param string $username The username that will be passed when authenticating SIP requests. The username should be sent in response to Twilio's challenge of the initial INVITE. It can be up to 32 characters long. * @param string $password The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) * @return CredentialInstance Created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $username, string $password): CredentialInstance { $data = Values::of([ 'Username' => $username, 'Password' => $password, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['credentialListSid'] ); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialPage Page of CredentialInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialPage Page of CredentialInstance */ public function getPage(string $targetUrl): CredentialPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Constructs a CredentialContext * * @param string $sid The unique id that identifies the resource to delete. */ public function getContext( string $sid ): CredentialContext { return new CredentialContext( $this->version, $this->solution['accountSid'], $this->solution['credentialListSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.CredentialList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListInstance.php 0000644 00000012133 15021223077 0021734 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property array|null $subresourceUris * @property string|null $uri */ class IpAccessControlListInstance extends InstanceResource { protected $_ipAddresses; /** * Initialize the IpAccessControlListInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return IpAccessControlListContext Context for this IpAccessControlListInstance */ protected function proxy(): IpAccessControlListContext { if (!$this->context) { $this->context = new IpAccessControlListContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the IpAccessControlListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the IpAccessControlListInstance * * @return IpAccessControlListInstance Fetched IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAccessControlListInstance { return $this->proxy()->fetch(); } /** * Update the IpAccessControlListInstance * * @param string $friendlyName A human readable descriptive text, up to 255 characters long. * @return IpAccessControlListInstance Updated IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): IpAccessControlListInstance { return $this->proxy()->update($friendlyName); } /** * Access the ipAddresses */ protected function getIpAddresses(): IpAddressList { return $this->proxy()->ipAddresses; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAccessControlListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListList.php 0000644 00000014665 15021223077 0021117 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class IpAccessControlListList extends ListResource { /** * Construct the IpAccessControlListList * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/IpAccessControlLists.json'; } /** * Create the IpAccessControlListInstance * * @param string $friendlyName A human readable descriptive text that describes the IpAccessControlList, up to 255 characters long. * @return IpAccessControlListInstance Created IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): IpAccessControlListInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IpAccessControlListInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads IpAccessControlListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpAccessControlListInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams IpAccessControlListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of IpAccessControlListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return IpAccessControlListPage Page of IpAccessControlListInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): IpAccessControlListPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new IpAccessControlListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpAccessControlListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return IpAccessControlListPage Page of IpAccessControlListInstance */ public function getPage(string $targetUrl): IpAccessControlListPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpAccessControlListPage($this->version, $response, $this->solution); } /** * Constructs a IpAccessControlListContext * * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function getContext( string $sid ): IpAccessControlListContext { return new IpAccessControlListContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.IpAccessControlListList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainPage.php 0000644 00000003070 15021223077 0016364 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DomainPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DomainInstance \Twilio\Rest\Api\V2010\Account\Sip\DomainInstance */ public function buildInstance(array $payload): DomainInstance { return new DomainInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.DomainPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListPage.php 0000644 00000003150 15021223077 0020062 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialListPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CredentialListInstance \Twilio\Rest\Api\V2010\Account\Sip\CredentialListInstance */ public function buildInstance(array $payload): CredentialListInstance { return new CredentialListInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.CredentialListPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainList.php 0000644 00000016541 15021223077 0016432 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class DomainList extends ListResource { /** * Construct the DomainList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains.json'; } /** * Create the DomainInstance * * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. * @param array|Options $options Optional Arguments * @return DomainInstance Created DomainInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $domainName, array $options = []): DomainInstance { $options = new Values($options); $data = Values::of([ 'DomainName' => $domainName, 'FriendlyName' => $options['friendlyName'], 'VoiceUrl' => $options['voiceUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceStatusCallbackUrl' => $options['voiceStatusCallbackUrl'], 'VoiceStatusCallbackMethod' => $options['voiceStatusCallbackMethod'], 'SipRegistration' => Serialize::booleanToString($options['sipRegistration']), 'EmergencyCallingEnabled' => Serialize::booleanToString($options['emergencyCallingEnabled']), 'Secure' => Serialize::booleanToString($options['secure']), 'ByocTrunkSid' => $options['byocTrunkSid'], 'EmergencyCallerSid' => $options['emergencyCallerSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DomainInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads DomainInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DomainInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DomainInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DomainInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DomainPage Page of DomainInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DomainPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DomainPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DomainInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DomainPage Page of DomainInstance */ public function getPage(string $targetUrl): DomainPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DomainPage($this->version, $response, $this->solution); } /** * Constructs a DomainContext * * @param string $sid The Twilio-provided string that uniquely identifies the SipDomain resource to delete. */ public function getContext( string $sid ): DomainContext { return new DomainContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.DomainList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainOptions.php 0000644 00000064245 15021223077 0017156 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Options; use Twilio\Values; abstract class DomainOptions { /** * @param string $friendlyName A descriptive string that you created to describe the resource. It can be up to 64 characters long. * @param string $voiceUrl The URL we should when the domain receives a call. * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @param string $voiceStatusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @param string $voiceStatusCallbackMethod The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. * @param bool $sipRegistration Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. * @param bool $emergencyCallingEnabled Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. * @param bool $secure Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. * @param string $byocTrunkSid The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. * @param string $emergencyCallerSid Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. * @return CreateDomainOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceStatusCallbackUrl = Values::NONE, string $voiceStatusCallbackMethod = Values::NONE, bool $sipRegistration = Values::BOOL_NONE, bool $emergencyCallingEnabled = Values::BOOL_NONE, bool $secure = Values::BOOL_NONE, string $byocTrunkSid = Values::NONE, string $emergencyCallerSid = Values::NONE ): CreateDomainOptions { return new CreateDomainOptions( $friendlyName, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $voiceStatusCallbackUrl, $voiceStatusCallbackMethod, $sipRegistration, $emergencyCallingEnabled, $secure, $byocTrunkSid, $emergencyCallerSid ); } /** * @param string $friendlyName A descriptive string that you created to describe the resource. It can be up to 64 characters long. * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. * @param string $voiceMethod The HTTP method we should use to call `voice_url` * @param string $voiceStatusCallbackMethod The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. * @param string $voiceStatusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @param string $voiceUrl The URL we should call when the domain receives a call. * @param bool $sipRegistration Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. * @param bool $emergencyCallingEnabled Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. * @param bool $secure Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. * @param string $byocTrunkSid The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. * @param string $emergencyCallerSid Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. * @return UpdateDomainOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceStatusCallbackMethod = Values::NONE, string $voiceStatusCallbackUrl = Values::NONE, string $voiceUrl = Values::NONE, bool $sipRegistration = Values::BOOL_NONE, string $domainName = Values::NONE, bool $emergencyCallingEnabled = Values::BOOL_NONE, bool $secure = Values::BOOL_NONE, string $byocTrunkSid = Values::NONE, string $emergencyCallerSid = Values::NONE ): UpdateDomainOptions { return new UpdateDomainOptions( $friendlyName, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceStatusCallbackMethod, $voiceStatusCallbackUrl, $voiceUrl, $sipRegistration, $domainName, $emergencyCallingEnabled, $secure, $byocTrunkSid, $emergencyCallerSid ); } } class CreateDomainOptions extends Options { /** * @param string $friendlyName A descriptive string that you created to describe the resource. It can be up to 64 characters long. * @param string $voiceUrl The URL we should when the domain receives a call. * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @param string $voiceStatusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @param string $voiceStatusCallbackMethod The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. * @param bool $sipRegistration Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. * @param bool $emergencyCallingEnabled Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. * @param bool $secure Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. * @param string $byocTrunkSid The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. * @param string $emergencyCallerSid Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. */ public function __construct( string $friendlyName = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceStatusCallbackUrl = Values::NONE, string $voiceStatusCallbackMethod = Values::NONE, bool $sipRegistration = Values::BOOL_NONE, bool $emergencyCallingEnabled = Values::BOOL_NONE, bool $secure = Values::BOOL_NONE, string $byocTrunkSid = Values::NONE, string $emergencyCallerSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['voiceUrl'] = $voiceUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; $this->options['sipRegistration'] = $sipRegistration; $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; $this->options['secure'] = $secure; $this->options['byocTrunkSid'] = $byocTrunkSid; $this->options['emergencyCallerSid'] = $emergencyCallerSid; } /** * A descriptive string that you created to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you created to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The URL we should when the domain receives a call. * * @param string $voiceUrl The URL we should when the domain receives a call. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call to pass status parameters (such as call ended) to your application. * * @param string $voiceStatusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @return $this Fluent Builder */ public function setVoiceStatusCallbackUrl(string $voiceStatusCallbackUrl): self { $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. * * @param string $voiceStatusCallbackMethod The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceStatusCallbackMethod(string $voiceStatusCallbackMethod): self { $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; return $this; } /** * Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. * * @param bool $sipRegistration Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. * @return $this Fluent Builder */ public function setSipRegistration(bool $sipRegistration): self { $this->options['sipRegistration'] = $sipRegistration; return $this; } /** * Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. * * @param bool $emergencyCallingEnabled Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. * @return $this Fluent Builder */ public function setEmergencyCallingEnabled(bool $emergencyCallingEnabled): self { $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; return $this; } /** * Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. * * @param bool $secure Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. * @return $this Fluent Builder */ public function setSecure(bool $secure): self { $this->options['secure'] = $secure; return $this; } /** * The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. * * @param string $byocTrunkSid The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. * @return $this Fluent Builder */ public function setByocTrunkSid(string $byocTrunkSid): self { $this->options['byocTrunkSid'] = $byocTrunkSid; return $this; } /** * Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. * * @param string $emergencyCallerSid Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. * @return $this Fluent Builder */ public function setEmergencyCallerSid(string $emergencyCallerSid): self { $this->options['emergencyCallerSid'] = $emergencyCallerSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateDomainOptions ' . $options . ']'; } } class UpdateDomainOptions extends Options { /** * @param string $friendlyName A descriptive string that you created to describe the resource. It can be up to 64 characters long. * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. * @param string $voiceMethod The HTTP method we should use to call `voice_url` * @param string $voiceStatusCallbackMethod The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. * @param string $voiceStatusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @param string $voiceUrl The URL we should call when the domain receives a call. * @param bool $sipRegistration Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. * @param bool $emergencyCallingEnabled Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. * @param bool $secure Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. * @param string $byocTrunkSid The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. * @param string $emergencyCallerSid Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. */ public function __construct( string $friendlyName = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceStatusCallbackMethod = Values::NONE, string $voiceStatusCallbackUrl = Values::NONE, string $voiceUrl = Values::NONE, bool $sipRegistration = Values::BOOL_NONE, string $domainName = Values::NONE, bool $emergencyCallingEnabled = Values::BOOL_NONE, bool $secure = Values::BOOL_NONE, string $byocTrunkSid = Values::NONE, string $emergencyCallerSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; $this->options['voiceUrl'] = $voiceUrl; $this->options['sipRegistration'] = $sipRegistration; $this->options['domainName'] = $domainName; $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; $this->options['secure'] = $secure; $this->options['byocTrunkSid'] = $byocTrunkSid; $this->options['emergencyCallerSid'] = $emergencyCallerSid; } /** * A descriptive string that you created to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you created to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_url` * * @param string $voiceMethod The HTTP method we should use to call `voice_url` * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. * * @param string $voiceStatusCallbackMethod The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceStatusCallbackMethod(string $voiceStatusCallbackMethod): self { $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; return $this; } /** * The URL that we should call to pass status parameters (such as call ended) to your application. * * @param string $voiceStatusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @return $this Fluent Builder */ public function setVoiceStatusCallbackUrl(string $voiceStatusCallbackUrl): self { $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; return $this; } /** * The URL we should call when the domain receives a call. * * @param string $voiceUrl The URL we should call when the domain receives a call. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. * * @param bool $sipRegistration Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. * @return $this Fluent Builder */ public function setSipRegistration(bool $sipRegistration): self { $this->options['sipRegistration'] = $sipRegistration; return $this; } /** * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. * * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. * @return $this Fluent Builder */ public function setDomainName(string $domainName): self { $this->options['domainName'] = $domainName; return $this; } /** * Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. * * @param bool $emergencyCallingEnabled Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. * @return $this Fluent Builder */ public function setEmergencyCallingEnabled(bool $emergencyCallingEnabled): self { $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; return $this; } /** * Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. * * @param bool $secure Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. * @return $this Fluent Builder */ public function setSecure(bool $secure): self { $this->options['secure'] = $secure; return $this; } /** * The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. * * @param string $byocTrunkSid The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. * @return $this Fluent Builder */ public function setByocTrunkSid(string $byocTrunkSid): self { $this->options['byocTrunkSid'] = $byocTrunkSid; return $this; } /** * Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. * * @param string $emergencyCallerSid Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. * @return $this Fluent Builder */ public function setEmergencyCallerSid(string $emergencyCallerSid): self { $this->options['emergencyCallerSid'] = $emergencyCallerSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateDomainOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListInstance.php 0000644 00000011755 15021223077 0020764 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialList; /** * @property string|null $accountSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string|null $sid * @property array|null $subresourceUris * @property string|null $uri */ class CredentialListInstance extends InstanceResource { protected $_credentials; /** * Initialize the CredentialListInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique id of the Account that is responsible for this resource. * @param string $sid The credential list Sid that uniquely identifies this resource */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialListContext Context for this CredentialListInstance */ protected function proxy(): CredentialListContext { if (!$this->context) { $this->context = new CredentialListContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialListInstance * * @return CredentialListInstance Fetched CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialListInstance { return $this->proxy()->fetch(); } /** * Update the CredentialListInstance * * @param string $friendlyName A human readable descriptive text for a CredentialList, up to 64 characters long. * @return CredentialListInstance Updated CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): CredentialListInstance { return $this->proxy()->update($friendlyName); } /** * Access the credentials */ protected function getCredentials(): CredentialList { return $this->proxy()->credentials; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListContext.php 0000644 00000012310 15021223077 0021611 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressList; /** * @property IpAddressList $ipAddresses * @method \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressContext ipAddresses(string $sid) */ class IpAccessControlListContext extends InstanceContext { protected $_ipAddresses; /** * Initialize the IpAccessControlListContext * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/IpAccessControlLists/' . \rawurlencode($sid) .'.json'; } /** * Delete the IpAccessControlListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the IpAccessControlListInstance * * @return IpAccessControlListInstance Fetched IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAccessControlListInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new IpAccessControlListInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the IpAccessControlListInstance * * @param string $friendlyName A human readable descriptive text, up to 255 characters long. * @return IpAccessControlListInstance Updated IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName): IpAccessControlListInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new IpAccessControlListInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the ipAddresses */ protected function getIpAddresses(): IpAddressList { if (!$this->_ipAddresses) { $this->_ipAddresses = new IpAddressList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_ipAddresses; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAccessControlListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php 0000644 00000016706 15021223077 0017146 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypesList; /** * @property CredentialListMappingList $credentialListMappings * @property IpAccessControlListMappingList $ipAccessControlListMappings * @property AuthTypesList $auth * @method \Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingContext ipAccessControlListMappings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingContext credentialListMappings(string $sid) */ class DomainContext extends InstanceContext { protected $_credentialListMappings; protected $_ipAccessControlListMappings; protected $_auth; /** * Initialize the DomainContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $sid The Twilio-provided string that uniquely identifies the SipDomain resource to delete. */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($sid) .'.json'; } /** * Delete the DomainInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the DomainInstance * * @return DomainInstance Fetched DomainInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DomainInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new DomainInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the DomainInstance * * @param array|Options $options Optional Arguments * @return DomainInstance Updated DomainInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DomainInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceStatusCallbackMethod' => $options['voiceStatusCallbackMethod'], 'VoiceStatusCallbackUrl' => $options['voiceStatusCallbackUrl'], 'VoiceUrl' => $options['voiceUrl'], 'SipRegistration' => Serialize::booleanToString($options['sipRegistration']), 'DomainName' => $options['domainName'], 'EmergencyCallingEnabled' => Serialize::booleanToString($options['emergencyCallingEnabled']), 'Secure' => Serialize::booleanToString($options['secure']), 'ByocTrunkSid' => $options['byocTrunkSid'], 'EmergencyCallerSid' => $options['emergencyCallerSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DomainInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the credentialListMappings */ protected function getCredentialListMappings(): CredentialListMappingList { if (!$this->_credentialListMappings) { $this->_credentialListMappings = new CredentialListMappingList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_credentialListMappings; } /** * Access the ipAccessControlListMappings */ protected function getIpAccessControlListMappings(): IpAccessControlListMappingList { if (!$this->_ipAccessControlListMappings) { $this->_ipAccessControlListMappings = new IpAccessControlListMappingList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_ipAccessControlListMappings; } /** * Access the auth */ protected function getAuth(): AuthTypesList { if (!$this->_auth) { $this->_auth = new AuthTypesList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_auth; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.DomainContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListList.php 0000644 00000014510 15021223077 0020123 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialList; class CredentialListList extends ListResource { /** * Construct the CredentialListList * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible for this resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/CredentialLists.json'; } /** * Create the CredentialListInstance * * @param string $friendlyName A human readable descriptive text that describes the CredentialList, up to 64 characters long. * @return CredentialListInstance Created CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): CredentialListInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialListInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads CredentialListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialListInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialListPage Page of CredentialListInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialListPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialListPage Page of CredentialListInstance */ public function getPage(string $targetUrl): CredentialListPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialListPage($this->version, $response, $this->solution); } /** * Constructs a CredentialListContext * * @param string $sid The credential list Sid that uniquely identifies this resource */ public function getContext( string $sid ): CredentialListContext { return new CredentialListContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.CredentialListList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingContext.php 0000644 00000005727 15021223077 0024352 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class IpAccessControlListMappingContext extends InstanceContext { /** * Initialize the IpAccessControlListMappingContext * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible for this resource. * @param string $domainSid A 34 character string that uniquely identifies the SIP domain. * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function __construct( Version $version, $accountSid, $domainSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/IpAccessControlListMappings/' . \rawurlencode($sid) .'.json'; } /** * Delete the IpAccessControlListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the IpAccessControlListMappingInstance * * @return IpAccessControlListMappingInstance Fetched IpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAccessControlListMappingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new IpAccessControlListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAccessControlListMappingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesInstance.php 0000644 00000004220 15021223077 0021200 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Version; class AuthTypesInstance extends InstanceResource { /** * Initialize the AuthTypesInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource to fetch. * @param string $domainSid The SID of the SIP domain that contains the resource to fetch. */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid) { parent::__construct($version); $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthTypesInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsPage.php 0000644 00000003242 15021223077 0023035 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthTypeCallsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AuthTypeCallsInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCallsInstance */ public function buildInstance(array $payload): AuthTypeCallsInstance { return new AuthTypeCallsInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthTypeCallsPage]'; } } Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingContext.php0000644 00000006254 15021223077 0035155 0 ustar 00 sdk/src/Twilio/Rest/Api/V2010 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class AuthRegistrationsCredentialListMappingContext extends InstanceContext { /** * Initialize the AuthRegistrationsCredentialListMappingContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $domainSid The SID of the SIP domain that will contain the new resource. * @param string $sid The Twilio-provided string that uniquely identifies the CredentialListMapping resource to delete. */ public function __construct( Version $version, $accountSid, $domainSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/Auth/Registrations/CredentialListMappings/' . \rawurlencode($sid) .'.json'; } /** * Delete the AuthRegistrationsCredentialListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the AuthRegistrationsCredentialListMappingInstance * * @return AuthRegistrationsCredentialListMappingInstance Fetched AuthRegistrationsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthRegistrationsCredentialListMappingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AuthRegistrationsCredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingContext ' . \implode(' ', $context) . ']'; } } Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingInstance.php 0000644 00000011235 15021223077 0035270 0 ustar 00 sdk/src/Twilio/Rest/Api/V2010/Account <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string|null $sid */ class AuthRegistrationsCredentialListMappingInstance extends InstanceResource { /** * Initialize the AuthRegistrationsCredentialListMappingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $domainSid The SID of the SIP domain that will contain the new resource. * @param string $sid The Twilio-provided string that uniquely identifies the CredentialListMapping resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), ]; $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AuthRegistrationsCredentialListMappingContext Context for this AuthRegistrationsCredentialListMappingInstance */ protected function proxy(): AuthRegistrationsCredentialListMappingContext { if (!$this->context) { $this->context = new AuthRegistrationsCredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the AuthRegistrationsCredentialListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AuthRegistrationsCredentialListMappingInstance * * @return AuthRegistrationsCredentialListMappingInstance Fetched AuthRegistrationsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthRegistrationsCredentialListMappingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingInstance ' . \implode(' ', $context) . ']'; } } Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingList.php 0000644 00000016364 15021223077 0034447 0 ustar 00 sdk/src/Twilio/Rest/Api/V2010 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AuthRegistrationsCredentialListMappingList extends ListResource { /** * Construct the AuthRegistrationsCredentialListMappingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $domainSid The SID of the SIP domain that will contain the new resource. */ public function __construct( Version $version, string $accountSid, string $domainSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/Auth/Registrations/CredentialListMappings.json'; } /** * Create the AuthRegistrationsCredentialListMappingInstance * * @param string $credentialListSid The SID of the CredentialList resource to map to the SIP domain. * @return AuthRegistrationsCredentialListMappingInstance Created AuthRegistrationsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $credentialListSid): AuthRegistrationsCredentialListMappingInstance { $data = Values::of([ 'CredentialListSid' => $credentialListSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AuthRegistrationsCredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Reads AuthRegistrationsCredentialListMappingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthRegistrationsCredentialListMappingInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AuthRegistrationsCredentialListMappingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AuthRegistrationsCredentialListMappingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AuthRegistrationsCredentialListMappingPage Page of AuthRegistrationsCredentialListMappingInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AuthRegistrationsCredentialListMappingPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AuthRegistrationsCredentialListMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthRegistrationsCredentialListMappingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AuthRegistrationsCredentialListMappingPage Page of AuthRegistrationsCredentialListMappingInstance */ public function getPage(string $targetUrl): AuthRegistrationsCredentialListMappingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthRegistrationsCredentialListMappingPage($this->version, $response, $this->solution); } /** * Constructs a AuthRegistrationsCredentialListMappingContext * * @param string $sid The Twilio-provided string that uniquely identifies the CredentialListMapping resource to delete. */ public function getContext( string $sid ): AuthRegistrationsCredentialListMappingContext { return new AuthRegistrationsCredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingList]'; } } Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingPage.php 0000644 00000003544 15021223077 0034404 0 ustar 00 sdk/src/Twilio/Rest/Api/V2010 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthRegistrationsCredentialListMappingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AuthRegistrationsCredentialListMappingInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations\AuthRegistrationsCredentialListMappingInstance */ public function buildInstance(array $payload): AuthRegistrationsCredentialListMappingInstance { return new AuthRegistrationsCredentialListMappingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsInstance.php 0000644 00000004276 15021223077 0025534 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Version; class AuthTypeRegistrationsInstance extends InstanceResource { /** * Initialize the AuthTypeRegistrationsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource to fetch. * @param string $domainSid The SID of the SIP domain that contains the resource to fetch. */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid) { parent::__construct($version); $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthTypeRegistrationsInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsList.php 0000644 00000010776 15021223077 0023106 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsIpAccessControlListMappingList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsCredentialListMappingList; /** * @property AuthCallsIpAccessControlListMappingList $ipAccessControlListMappings * @property AuthCallsCredentialListMappingList $credentialListMappings * @method \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsCredentialListMappingContext credentialListMappings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsIpAccessControlListMappingContext ipAccessControlListMappings(string $sid) */ class AuthTypeCallsList extends ListResource { protected $_ipAccessControlListMappings = null; protected $_credentialListMappings = null; /** * Construct the AuthTypeCallsList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource to fetch. * @param string $domainSid The SID of the SIP domain that contains the resource to fetch. */ public function __construct( Version $version, string $accountSid, string $domainSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, ]; } /** * Access the ipAccessControlListMappings */ protected function getIpAccessControlListMappings(): AuthCallsIpAccessControlListMappingList { if (!$this->_ipAccessControlListMappings) { $this->_ipAccessControlListMappings = new AuthCallsIpAccessControlListMappingList( $this->version, $this->solution['accountSid'], $this->solution['domainSid'] ); } return $this->_ipAccessControlListMappings; } /** * Access the credentialListMappings */ protected function getCredentialListMappings(): AuthCallsCredentialListMappingList { if (!$this->_credentialListMappings) { $this->_credentialListMappings = new AuthCallsCredentialListMappingList( $this->version, $this->solution['accountSid'], $this->solution['domainSid'] ); } return $this->_credentialListMappings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthTypeCallsList]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingList.php 0000644 00000016277 15021223077 0032035 0 ustar 00 sdk/src/Twilio/Rest <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AuthCallsIpAccessControlListMappingList extends ListResource { /** * Construct the AuthCallsIpAccessControlListMappingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $domainSid The SID of the SIP domain that will contain the new resource. */ public function __construct( Version $version, string $accountSid, string $domainSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/Auth/Calls/IpAccessControlListMappings.json'; } /** * Create the AuthCallsIpAccessControlListMappingInstance * * @param string $ipAccessControlListSid The SID of the IpAccessControlList resource to map to the SIP domain. * @return AuthCallsIpAccessControlListMappingInstance Created AuthCallsIpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $ipAccessControlListSid): AuthCallsIpAccessControlListMappingInstance { $data = Values::of([ 'IpAccessControlListSid' => $ipAccessControlListSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AuthCallsIpAccessControlListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Reads AuthCallsIpAccessControlListMappingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthCallsIpAccessControlListMappingInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AuthCallsIpAccessControlListMappingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AuthCallsIpAccessControlListMappingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AuthCallsIpAccessControlListMappingPage Page of AuthCallsIpAccessControlListMappingInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AuthCallsIpAccessControlListMappingPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AuthCallsIpAccessControlListMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthCallsIpAccessControlListMappingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AuthCallsIpAccessControlListMappingPage Page of AuthCallsIpAccessControlListMappingInstance */ public function getPage(string $targetUrl): AuthCallsIpAccessControlListMappingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthCallsIpAccessControlListMappingPage($this->version, $response, $this->solution); } /** * Constructs a AuthCallsIpAccessControlListMappingContext * * @param string $sid The Twilio-provided string that uniquely identifies the IpAccessControlListMapping resource to delete. */ public function getContext( string $sid ): AuthCallsIpAccessControlListMappingContext { return new AuthCallsIpAccessControlListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingList]'; } } Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingList.php 0000644 00000016044 15021223077 0031044 0 ustar 00 sdk/src/Twilio <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AuthCallsCredentialListMappingList extends ListResource { /** * Construct the AuthCallsCredentialListMappingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $domainSid The SID of the SIP domain that will contain the new resource. */ public function __construct( Version $version, string $accountSid, string $domainSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/Auth/Calls/CredentialListMappings.json'; } /** * Create the AuthCallsCredentialListMappingInstance * * @param string $credentialListSid The SID of the CredentialList resource to map to the SIP domain. * @return AuthCallsCredentialListMappingInstance Created AuthCallsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $credentialListSid): AuthCallsCredentialListMappingInstance { $data = Values::of([ 'CredentialListSid' => $credentialListSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AuthCallsCredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Reads AuthCallsCredentialListMappingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthCallsCredentialListMappingInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AuthCallsCredentialListMappingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AuthCallsCredentialListMappingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AuthCallsCredentialListMappingPage Page of AuthCallsCredentialListMappingInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AuthCallsCredentialListMappingPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AuthCallsCredentialListMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthCallsCredentialListMappingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AuthCallsCredentialListMappingPage Page of AuthCallsCredentialListMappingInstance */ public function getPage(string $targetUrl): AuthCallsCredentialListMappingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthCallsCredentialListMappingPage($this->version, $response, $this->solution); } /** * Constructs a AuthCallsCredentialListMappingContext * * @param string $sid The Twilio-provided string that uniquely identifies the CredentialListMapping resource to delete. */ public function getContext( string $sid ): AuthCallsCredentialListMappingContext { return new AuthCallsCredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthCallsCredentialListMappingList]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingContext.php 0000644 00000006213 15021223077 0032533 0 ustar 00 sdk/src/Twilio/Rest <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class AuthCallsIpAccessControlListMappingContext extends InstanceContext { /** * Initialize the AuthCallsIpAccessControlListMappingContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $domainSid The SID of the SIP domain that will contain the new resource. * @param string $sid The Twilio-provided string that uniquely identifies the IpAccessControlListMapping resource to delete. */ public function __construct( Version $version, $accountSid, $domainSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/Auth/Calls/IpAccessControlListMappings/' . \rawurlencode($sid) .'.json'; } /** * Delete the AuthCallsIpAccessControlListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the AuthCallsIpAccessControlListMappingInstance * * @return AuthCallsIpAccessControlListMappingInstance Fetched AuthCallsIpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthCallsIpAccessControlListMappingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AuthCallsIpAccessControlListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingContext ' . \implode(' ', $context) . ']'; } } Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingContext.php 0000644 00000006124 15021223077 0031553 0 ustar 00 sdk/src/Twilio <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class AuthCallsCredentialListMappingContext extends InstanceContext { /** * Initialize the AuthCallsCredentialListMappingContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $domainSid The SID of the SIP domain that will contain the new resource. * @param string $sid The Twilio-provided string that uniquely identifies the CredentialListMapping resource to delete. */ public function __construct( Version $version, $accountSid, $domainSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/Auth/Calls/CredentialListMappings/' . \rawurlencode($sid) .'.json'; } /** * Delete the AuthCallsCredentialListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the AuthCallsCredentialListMappingInstance * * @return AuthCallsCredentialListMappingInstance Fetched AuthCallsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthCallsCredentialListMappingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AuthCallsCredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthCallsCredentialListMappingContext ' . \implode(' ', $context) . ']'; } } Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingInstance.php0000644 00000011065 15021223077 0031673 0 ustar 00 sdk/src/Twilio <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string|null $sid */ class AuthCallsCredentialListMappingInstance extends InstanceResource { /** * Initialize the AuthCallsCredentialListMappingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $domainSid The SID of the SIP domain that will contain the new resource. * @param string $sid The Twilio-provided string that uniquely identifies the CredentialListMapping resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), ]; $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AuthCallsCredentialListMappingContext Context for this AuthCallsCredentialListMappingInstance */ protected function proxy(): AuthCallsCredentialListMappingContext { if (!$this->context) { $this->context = new AuthCallsCredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the AuthCallsCredentialListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AuthCallsCredentialListMappingInstance * * @return AuthCallsCredentialListMappingInstance Fetched AuthCallsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthCallsCredentialListMappingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthCallsCredentialListMappingInstance ' . \implode(' ', $context) . ']'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingInstance.php0000644 00000011166 15021223077 0032656 0 ustar 00 sdk/src/Twilio/Rest <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string|null $sid */ class AuthCallsIpAccessControlListMappingInstance extends InstanceResource { /** * Initialize the AuthCallsIpAccessControlListMappingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $domainSid The SID of the SIP domain that will contain the new resource. * @param string $sid The Twilio-provided string that uniquely identifies the IpAccessControlListMapping resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), ]; $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AuthCallsIpAccessControlListMappingContext Context for this AuthCallsIpAccessControlListMappingInstance */ protected function proxy(): AuthCallsIpAccessControlListMappingContext { if (!$this->context) { $this->context = new AuthCallsIpAccessControlListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the AuthCallsIpAccessControlListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AuthCallsIpAccessControlListMappingInstance * * @return AuthCallsIpAccessControlListMappingInstance Fetched AuthCallsIpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthCallsIpAccessControlListMappingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingInstance ' . \implode(' ', $context) . ']'; } } Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingPage.php 0000644 00000003444 15021223077 0031005 0 ustar 00 sdk/src/Twilio <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthCallsCredentialListMappingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AuthCallsCredentialListMappingInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsCredentialListMappingInstance */ public function buildInstance(array $payload): AuthCallsCredentialListMappingInstance { return new AuthCallsCredentialListMappingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthCallsCredentialListMappingPage]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingPage.php 0000644 00000003502 15021223077 0031761 0 ustar 00 sdk/src/Twilio/Rest <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthCallsIpAccessControlListMappingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AuthCallsIpAccessControlListMappingInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsIpAccessControlListMappingInstance */ public function buildInstance(array $payload): AuthCallsIpAccessControlListMappingInstance { return new AuthCallsIpAccessControlListMappingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsInstance.php 0000644 00000004246 15021223077 0023732 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Version; class AuthTypeCallsInstance extends InstanceResource { /** * Initialize the AuthTypeCallsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource to fetch. * @param string $domainSid The SID of the SIP domain that contains the resource to fetch. */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid) { parent::__construct($version); $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthTypeCallsInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsList.php 0000644 00000007261 15021223077 0024700 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations\AuthRegistrationsCredentialListMappingList; /** * @property AuthRegistrationsCredentialListMappingList $credentialListMappings * @method \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations\AuthRegistrationsCredentialListMappingContext credentialListMappings(string $sid) */ class AuthTypeRegistrationsList extends ListResource { protected $_credentialListMappings = null; /** * Construct the AuthTypeRegistrationsList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource to fetch. * @param string $domainSid The SID of the SIP domain that contains the resource to fetch. */ public function __construct( Version $version, string $accountSid, string $domainSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, ]; } /** * Access the credentialListMappings */ protected function getCredentialListMappings(): AuthRegistrationsCredentialListMappingList { if (!$this->_credentialListMappings) { $this->_credentialListMappings = new AuthRegistrationsCredentialListMappingList( $this->version, $this->solution['accountSid'], $this->solution['domainSid'] ); } return $this->_credentialListMappings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthTypeRegistrationsList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsPage.php 0000644 00000003322 15021223077 0024633 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthTypeRegistrationsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AuthTypeRegistrationsInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrationsInstance */ public function buildInstance(array $payload): AuthTypeRegistrationsInstance { return new AuthTypeRegistrationsInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthTypeRegistrationsPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingInstance.php 0000644 00000011163 15021223077 0024461 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $domainSid * @property string|null $friendlyName * @property string|null $sid * @property string|null $uri */ class IpAccessControlListMappingInstance extends InstanceResource { /** * Initialize the IpAccessControlListMappingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique id of the Account that is responsible for this resource. * @param string $domainSid A 34 character string that uniquely identifies the SIP domain. * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'domainSid' => Values::array_get($payload, 'domain_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return IpAccessControlListMappingContext Context for this IpAccessControlListMappingInstance */ protected function proxy(): IpAccessControlListMappingContext { if (!$this->context) { $this->context = new IpAccessControlListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the IpAccessControlListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the IpAccessControlListMappingInstance * * @return IpAccessControlListMappingInstance Fetched IpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAccessControlListMappingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAccessControlListMappingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesList.php 0000644 00000007477 15021223077 0020370 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCallsList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrationsList; /** * @property AuthTypeCallsList $calls * @property AuthTypeRegistrationsList $registrations */ class AuthTypesList extends ListResource { protected $_calls = null; protected $_registrations = null; /** * Construct the AuthTypesList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource to fetch. * @param string $domainSid The SID of the SIP domain that contains the resource to fetch. */ public function __construct( Version $version, string $accountSid, string $domainSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, ]; } /** * Access the calls */ protected function getCalls(): AuthTypeCallsList { if (!$this->_calls) { $this->_calls = new AuthTypeCallsList( $this->version, $this->solution['accountSid'], $this->solution['domainSid'] ); } return $this->_calls; } /** * Access the registrations */ protected function getRegistrations(): AuthTypeRegistrationsList { if (!$this->_registrations) { $this->_registrations = new AuthTypeRegistrationsList( $this->version, $this->solution['accountSid'], $this->solution['domainSid'] ); } return $this->_registrations; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthTypesList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingList.php 0000644 00000015556 15021223077 0022661 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CredentialListMappingList extends ListResource { /** * Construct the CredentialListMappingList * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. * @param string $domainSid A 34 character string that uniquely identifies the SIP Domain for which the CredentialList resource will be mapped. */ public function __construct( Version $version, string $accountSid, string $domainSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/CredentialListMappings.json'; } /** * Create the CredentialListMappingInstance * * @param string $credentialListSid A 34 character string that uniquely identifies the CredentialList resource to map to the SIP domain. * @return CredentialListMappingInstance Created CredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $credentialListSid): CredentialListMappingInstance { $data = Values::of([ 'CredentialListSid' => $credentialListSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Reads CredentialListMappingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialListMappingInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialListMappingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialListMappingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialListMappingPage Page of CredentialListMappingInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialListMappingPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialListMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialListMappingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialListMappingPage Page of CredentialListMappingInstance */ public function getPage(string $targetUrl): CredentialListMappingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialListMappingPage($this->version, $response, $this->solution); } /** * Constructs a CredentialListMappingContext * * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function getContext( string $sid ): CredentialListMappingContext { return new CredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.CredentialListMappingList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingContext.php 0000644 00000006001 15021223077 0023353 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class CredentialListMappingContext extends InstanceContext { /** * Initialize the CredentialListMappingContext * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. * @param string $domainSid A 34 character string that uniquely identifies the SIP Domain for which the CredentialList resource will be mapped. * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function __construct( Version $version, $accountSid, $domainSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/CredentialListMappings/' . \rawurlencode($sid) .'.json'; } /** * Delete the CredentialListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CredentialListMappingInstance * * @return CredentialListMappingInstance Fetched CredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialListMappingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialListMappingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesPage.php 0000644 00000003166 15021223077 0020320 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthTypesPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AuthTypesInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypesInstance */ public function buildInstance(array $payload): AuthTypesInstance { return new AuthTypesInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AuthTypesPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingPage.php 0000644 00000003334 15021223077 0023572 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class IpAccessControlListMappingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return IpAccessControlListMappingInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingInstance */ public function buildInstance(array $payload): IpAccessControlListMappingInstance { return new IpAccessControlListMappingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.IpAccessControlListMappingPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingList.php 0000644 00000015604 15021223077 0023634 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class IpAccessControlListMappingList extends ListResource { /** * Construct the IpAccessControlListMappingList * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible for this resource. * @param string $domainSid A 34 character string that uniquely identifies the SIP domain. */ public function __construct( Version $version, string $accountSid, string $domainSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'domainSid' => $domainSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/Domains/' . \rawurlencode($domainSid) .'/IpAccessControlListMappings.json'; } /** * Create the IpAccessControlListMappingInstance * * @param string $ipAccessControlListSid The unique id of the IP access control list to map to the SIP domain. * @return IpAccessControlListMappingInstance Created IpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $ipAccessControlListSid): IpAccessControlListMappingInstance { $data = Values::of([ 'IpAccessControlListSid' => $ipAccessControlListSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IpAccessControlListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Reads IpAccessControlListMappingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpAccessControlListMappingInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams IpAccessControlListMappingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of IpAccessControlListMappingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return IpAccessControlListMappingPage Page of IpAccessControlListMappingInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): IpAccessControlListMappingPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new IpAccessControlListMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpAccessControlListMappingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return IpAccessControlListMappingPage Page of IpAccessControlListMappingInstance */ public function getPage(string $targetUrl): IpAccessControlListMappingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpAccessControlListMappingPage($this->version, $response, $this->solution); } /** * Constructs a IpAccessControlListMappingContext * * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function getContext( string $sid ): IpAccessControlListMappingContext { return new IpAccessControlListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.IpAccessControlListMappingList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingPage.php 0000644 00000003276 15021223077 0022616 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialListMappingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CredentialListMappingInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingInstance */ public function buildInstance(array $payload): CredentialListMappingInstance { return new CredentialListMappingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.CredentialListMappingPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingInstance.php 0000644 00000011223 15021223077 0023475 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $domainSid * @property string|null $friendlyName * @property string|null $sid * @property string|null $uri */ class CredentialListMappingInstance extends InstanceResource { /** * Initialize the CredentialListMappingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. * @param string $domainSid A 34 character string that uniquely identifies the SIP Domain for which the CredentialList resource will be mapped. * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $domainSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'domainSid' => Values::array_get($payload, 'domain_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialListMappingContext Context for this CredentialListMappingInstance */ protected function proxy(): CredentialListMappingContext { if (!$this->context) { $this->context = new CredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialListMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialListMappingInstance * * @return CredentialListMappingInstance Fetched CredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialListMappingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialListMappingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressContext.php 0000644 00000007624 15021223077 0023503 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class IpAddressContext extends InstanceContext { /** * Initialize the IpAddressContext * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. * @param string $ipAccessControlListSid The IpAccessControlList Sid with which to associate the created IpAddress resource. * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function __construct( Version $version, $accountSid, $ipAccessControlListSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'ipAccessControlListSid' => $ipAccessControlListSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/IpAccessControlLists/' . \rawurlencode($ipAccessControlListSid) .'/IpAddresses/' . \rawurlencode($sid) .'.json'; } /** * Delete the IpAddressInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the IpAddressInstance * * @return IpAddressInstance Fetched IpAddressInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAddressInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new IpAddressInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'], $this->solution['sid'] ); } /** * Update the IpAddressInstance * * @param array|Options $options Optional Arguments * @return IpAddressInstance Updated IpAddressInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): IpAddressInstance { $options = new Values($options); $data = Values::of([ 'IpAddress' => $options['ipAddress'], 'FriendlyName' => $options['friendlyName'], 'CidrPrefixLength' => $options['cidrPrefixLength'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new IpAddressInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAddressContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressPage.php 0000644 00000003235 15021223077 0022725 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class IpAddressPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return IpAddressInstance \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressInstance */ public function buildInstance(array $payload): IpAddressInstance { return new IpAddressInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['ipAccessControlListSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.IpAddressPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressInstance.php 0000644 00000012300 15021223077 0023606 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string|null $ipAddress * @property int|null $cidrPrefixLength * @property string|null $ipAccessControlListSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $uri */ class IpAddressInstance extends InstanceResource { /** * Initialize the IpAddressInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. * @param string $ipAccessControlListSid The IpAccessControlList Sid with which to associate the created IpAddress resource. * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $ipAccessControlListSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'ipAddress' => Values::array_get($payload, 'ip_address'), 'cidrPrefixLength' => Values::array_get($payload, 'cidr_prefix_length'), 'ipAccessControlListSid' => Values::array_get($payload, 'ip_access_control_list_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'ipAccessControlListSid' => $ipAccessControlListSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return IpAddressContext Context for this IpAddressInstance */ protected function proxy(): IpAddressContext { if (!$this->context) { $this->context = new IpAddressContext( $this->version, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the IpAddressInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the IpAddressInstance * * @return IpAddressInstance Fetched IpAddressInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAddressInstance { return $this->proxy()->fetch(); } /** * Update the IpAddressInstance * * @param array|Options $options Optional Arguments * @return IpAddressInstance Updated IpAddressInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): IpAddressInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAddressInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressList.php 0000644 00000016140 15021223077 0022763 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class IpAddressList extends ListResource { /** * Construct the IpAddressList * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. * @param string $ipAccessControlListSid The IpAccessControlList Sid with which to associate the created IpAddress resource. */ public function __construct( Version $version, string $accountSid, string $ipAccessControlListSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'ipAccessControlListSid' => $ipAccessControlListSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SIP/IpAccessControlLists/' . \rawurlencode($ipAccessControlListSid) .'/IpAddresses.json'; } /** * Create the IpAddressInstance * * @param string $friendlyName A human readable descriptive text for this resource, up to 255 characters long. * @param string $ipAddress An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. * @param array|Options $options Optional Arguments * @return IpAddressInstance Created IpAddressInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $ipAddress, array $options = []): IpAddressInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'IpAddress' => $ipAddress, 'CidrPrefixLength' => $options['cidrPrefixLength'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IpAddressInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'] ); } /** * Reads IpAddressInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpAddressInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams IpAddressInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of IpAddressInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return IpAddressPage Page of IpAddressInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): IpAddressPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new IpAddressPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpAddressInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return IpAddressPage Page of IpAddressInstance */ public function getPage(string $targetUrl): IpAddressPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpAddressPage($this->version, $response, $this->solution); } /** * Constructs a IpAddressContext * * @param string $sid A 34 character string that uniquely identifies the resource to delete. */ public function getContext( string $sid ): IpAddressContext { return new IpAddressContext( $this->version, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.IpAddressList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressOptions.php 0000644 00000014063 15021223077 0023505 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Options; use Twilio\Values; abstract class IpAddressOptions { /** * @param int $cidrPrefixLength An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. * @return CreateIpAddressOptions Options builder */ public static function create( int $cidrPrefixLength = Values::INT_NONE ): CreateIpAddressOptions { return new CreateIpAddressOptions( $cidrPrefixLength ); } /** * @param string $ipAddress An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. * @param string $friendlyName A human readable descriptive text for this resource, up to 255 characters long. * @param int $cidrPrefixLength An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. * @return UpdateIpAddressOptions Options builder */ public static function update( string $ipAddress = Values::NONE, string $friendlyName = Values::NONE, int $cidrPrefixLength = Values::INT_NONE ): UpdateIpAddressOptions { return new UpdateIpAddressOptions( $ipAddress, $friendlyName, $cidrPrefixLength ); } } class CreateIpAddressOptions extends Options { /** * @param int $cidrPrefixLength An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. */ public function __construct( int $cidrPrefixLength = Values::INT_NONE ) { $this->options['cidrPrefixLength'] = $cidrPrefixLength; } /** * An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. * * @param int $cidrPrefixLength An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. * @return $this Fluent Builder */ public function setCidrPrefixLength(int $cidrPrefixLength): self { $this->options['cidrPrefixLength'] = $cidrPrefixLength; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateIpAddressOptions ' . $options . ']'; } } class UpdateIpAddressOptions extends Options { /** * @param string $ipAddress An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. * @param string $friendlyName A human readable descriptive text for this resource, up to 255 characters long. * @param int $cidrPrefixLength An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. */ public function __construct( string $ipAddress = Values::NONE, string $friendlyName = Values::NONE, int $cidrPrefixLength = Values::INT_NONE ) { $this->options['ipAddress'] = $ipAddress; $this->options['friendlyName'] = $friendlyName; $this->options['cidrPrefixLength'] = $cidrPrefixLength; } /** * An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. * * @param string $ipAddress An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. * @return $this Fluent Builder */ public function setIpAddress(string $ipAddress): self { $this->options['ipAddress'] = $ipAddress; return $this; } /** * A human readable descriptive text for this resource, up to 255 characters long. * * @param string $friendlyName A human readable descriptive text for this resource, up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. * * @param int $cidrPrefixLength An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. * @return $this Fluent Builder */ public function setCidrPrefixLength(int $cidrPrefixLength): self { $this->options['cidrPrefixLength'] = $cidrPrefixLength; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateIpAddressOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyOptions.php 0000644 00000004152 15021223077 0016405 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class NewKeyOptions { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return CreateNewKeyOptions Options builder */ public static function create( string $friendlyName = Values::NONE ): CreateNewKeyOptions { return new CreateNewKeyOptions( $friendlyName ); } } class CreateNewKeyOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateNewKeyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeInstance.php 0000644 00000011710 15021223077 0017204 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string|null $shortCode * @property string|null $sid * @property string|null $smsFallbackMethod * @property string|null $smsFallbackUrl * @property string|null $smsMethod * @property string|null $smsUrl * @property string|null $uri */ class ShortCodeInstance extends InstanceResource { /** * Initialize the ShortCodeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ShortCode resource(s) to fetch. * @param string $sid The Twilio-provided string that uniquely identifies the ShortCode resource to fetch */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'shortCode' => Values::array_get($payload, 'short_code'), 'sid' => Values::array_get($payload, 'sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ShortCodeContext Context for this ShortCodeInstance */ protected function proxy(): ShortCodeContext { if (!$this->context) { $this->context = new ShortCodeContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ShortCodeInstance { return $this->proxy()->fetch(); } /** * Update the ShortCodeInstance * * @param array|Options $options Optional Arguments * @return ShortCodeInstance Updated ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ShortCodeInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ShortCodeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryPage.php 0000644 00000003256 15021223077 0022037 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AvailablePhoneNumberCountryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AvailablePhoneNumberCountryInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryInstance */ public function buildInstance(array $payload): AvailablePhoneNumberCountryInstance { return new AvailablePhoneNumberCountryInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AvailablePhoneNumberCountryPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestInstance.php 0000644 00000005224 15021223077 0020760 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $callSid * @property string|null $friendlyName * @property string|null $phoneNumber * @property string|null $validationCode */ class ValidationRequestInstance extends InstanceResource { /** * Initialize the ValidationRequestInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for the new caller ID resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'callSid' => Values::array_get($payload, 'call_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'validationCode' => Values::array_get($payload, 'validation_code'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ValidationRequestInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppPage.php 0000644 00000003110 15021223077 0016447 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConnectAppPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ConnectAppInstance \Twilio\Rest\Api\V2010\Account\ConnectAppInstance */ public function buildInstance(array $payload): ConnectAppInstance { return new ConnectAppInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ConnectAppPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionContext.php 0000644 00000005745 15021223077 0021760 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class TranscriptionContext extends InstanceContext { /** * Initialize the TranscriptionContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resources to delete. * @param string $recordingSid The SID of the [Recording](https://www.twilio.com/docs/voice/api/recording) that created the transcription to delete. * @param string $sid The Twilio-provided string that uniquely identifies the Transcription resource to delete. */ public function __construct( Version $version, $accountSid, $recordingSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'recordingSid' => $recordingSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings/' . \rawurlencode($recordingSid) .'/Transcriptions/' . \rawurlencode($sid) .'.json'; } /** * Delete the TranscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the TranscriptionInstance * * @return TranscriptionInstance Fetched TranscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TranscriptionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new TranscriptionInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['recordingSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.TranscriptionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionPage.php 0000644 00000003217 15021223077 0021200 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TranscriptionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TranscriptionInstance \Twilio\Rest\Api\V2010\Account\Recording\TranscriptionInstance */ public function buildInstance(array $payload): TranscriptionInstance { return new TranscriptionInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['recordingSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TranscriptionPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionInstance.php 0000644 00000012314 15021223077 0022066 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $duration * @property string|null $price * @property string|null $priceUnit * @property string|null $recordingSid * @property string|null $sid * @property string $status * @property string|null $transcriptionText * @property string|null $type * @property string|null $uri */ class TranscriptionInstance extends InstanceResource { /** * Initialize the TranscriptionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resources to delete. * @param string $recordingSid The SID of the [Recording](https://www.twilio.com/docs/voice/api/recording) that created the transcription to delete. * @param string $sid The Twilio-provided string that uniquely identifies the Transcription resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $recordingSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'duration' => Values::array_get($payload, 'duration'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'recordingSid' => Values::array_get($payload, 'recording_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'transcriptionText' => Values::array_get($payload, 'transcription_text'), 'type' => Values::array_get($payload, 'type'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'recordingSid' => $recordingSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TranscriptionContext Context for this TranscriptionInstance */ protected function proxy(): TranscriptionContext { if (!$this->context) { $this->context = new TranscriptionContext( $this->version, $this->solution['accountSid'], $this->solution['recordingSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the TranscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TranscriptionInstance * * @return TranscriptionInstance Fetched TranscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TranscriptionInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.TranscriptionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadPage.php 0000644 00000003246 15021223077 0022120 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Recording\AddOnResult; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PayloadPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return PayloadInstance \Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadInstance */ public function buildInstance(array $payload): PayloadInstance { return new PayloadInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['addOnResultSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.PayloadPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadContext.php 0000644 00000006355 15021223077 0022674 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Recording\AddOnResult; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class PayloadContext extends InstanceContext { /** * Initialize the PayloadContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult Payload resources to delete. * @param string $referenceSid The SID of the recording to which the AddOnResult resource that contains the payloads to delete belongs. * @param string $addOnResultSid The SID of the AddOnResult to which the payloads to delete belongs. * @param string $sid The Twilio-provided string that uniquely identifies the Recording AddOnResult Payload resource to delete. */ public function __construct( Version $version, $accountSid, $referenceSid, $addOnResultSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'addOnResultSid' => $addOnResultSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings/' . \rawurlencode($referenceSid) .'/AddOnResults/' . \rawurlencode($addOnResultSid) .'/Payloads/' . \rawurlencode($sid) .'.json'; } /** * Delete the PayloadInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the PayloadInstance * * @return PayloadInstance Fetched PayloadInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PayloadInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new PayloadInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['addOnResultSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.PayloadContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadList.php 0000644 00000014163 15021223077 0022157 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Recording\AddOnResult; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class PayloadList extends ListResource { /** * Construct the PayloadList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult Payload resources to delete. * @param string $referenceSid The SID of the recording to which the AddOnResult resource that contains the payloads to delete belongs. * @param string $addOnResultSid The SID of the AddOnResult to which the payloads to delete belongs. */ public function __construct( Version $version, string $accountSid, string $referenceSid, string $addOnResultSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'addOnResultSid' => $addOnResultSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings/' . \rawurlencode($referenceSid) .'/AddOnResults/' . \rawurlencode($addOnResultSid) .'/Payloads.json'; } /** * Reads PayloadInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PayloadInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams PayloadInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of PayloadInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return PayloadPage Page of PayloadInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): PayloadPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new PayloadPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PayloadInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return PayloadPage Page of PayloadInstance */ public function getPage(string $targetUrl): PayloadPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PayloadPage($this->version, $response, $this->solution); } /** * Constructs a PayloadContext * * @param string $sid The Twilio-provided string that uniquely identifies the Recording AddOnResult Payload resource to delete. */ public function getContext( string $sid ): PayloadContext { return new PayloadContext( $this->version, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['addOnResultSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.PayloadList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadInstance.php 0000644 00000012417 15021223077 0023010 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Recording\AddOnResult; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $addOnResultSid * @property string|null $accountSid * @property string|null $label * @property string|null $addOnSid * @property string|null $addOnConfigurationSid * @property string|null $contentType * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $referenceSid * @property array|null $subresourceUris */ class PayloadInstance extends InstanceResource { /** * Initialize the PayloadInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult Payload resources to delete. * @param string $referenceSid The SID of the recording to which the AddOnResult resource that contains the payloads to delete belongs. * @param string $addOnResultSid The SID of the AddOnResult to which the payloads to delete belongs. * @param string $sid The Twilio-provided string that uniquely identifies the Recording AddOnResult Payload resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $referenceSid, string $addOnResultSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'addOnResultSid' => Values::array_get($payload, 'add_on_result_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'label' => Values::array_get($payload, 'label'), 'addOnSid' => Values::array_get($payload, 'add_on_sid'), 'addOnConfigurationSid' => Values::array_get($payload, 'add_on_configuration_sid'), 'contentType' => Values::array_get($payload, 'content_type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'referenceSid' => Values::array_get($payload, 'reference_sid'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ]; $this->solution = ['accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'addOnResultSid' => $addOnResultSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PayloadContext Context for this PayloadInstance */ protected function proxy(): PayloadContext { if (!$this->context) { $this->context = new PayloadContext( $this->version, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['addOnResultSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the PayloadInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the PayloadInstance * * @return PayloadInstance Fetched PayloadInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PayloadInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.PayloadInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultList.php 0000644 00000013511 15021223077 0020562 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AddOnResultList extends ListResource { /** * Construct the AddOnResultList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult resources to delete. * @param string $referenceSid The SID of the recording to which the result to delete belongs. */ public function __construct( Version $version, string $accountSid, string $referenceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'referenceSid' => $referenceSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings/' . \rawurlencode($referenceSid) .'/AddOnResults.json'; } /** * Reads AddOnResultInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AddOnResultInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AddOnResultInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AddOnResultInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AddOnResultPage Page of AddOnResultInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AddOnResultPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AddOnResultPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AddOnResultInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AddOnResultPage Page of AddOnResultInstance */ public function getPage(string $targetUrl): AddOnResultPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AddOnResultPage($this->version, $response, $this->solution); } /** * Constructs a AddOnResultContext * * @param string $sid The Twilio-provided string that uniquely identifies the Recording AddOnResult resource to delete. */ public function getContext( string $sid ): AddOnResultContext { return new AddOnResultContext( $this->version, $this->solution['accountSid'], $this->solution['referenceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AddOnResultList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultContext.php 0000644 00000011276 15021223077 0021301 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadList; /** * @property PayloadList $payloads * @method \Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadContext payloads(string $sid) */ class AddOnResultContext extends InstanceContext { protected $_payloads; /** * Initialize the AddOnResultContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult resources to delete. * @param string $referenceSid The SID of the recording to which the result to delete belongs. * @param string $sid The Twilio-provided string that uniquely identifies the Recording AddOnResult resource to delete. */ public function __construct( Version $version, $accountSid, $referenceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings/' . \rawurlencode($referenceSid) .'/AddOnResults/' . \rawurlencode($sid) .'.json'; } /** * Delete the AddOnResultInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the AddOnResultInstance * * @return AddOnResultInstance Fetched AddOnResultInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AddOnResultInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AddOnResultInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['sid'] ); } /** * Access the payloads */ protected function getPayloads(): PayloadList { if (!$this->_payloads) { $this->_payloads = new PayloadList( $this->version, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['sid'] ); } return $this->_payloads; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AddOnResultContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionList.php 0000644 00000013627 15021223077 0021245 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TranscriptionList extends ListResource { /** * Construct the TranscriptionList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resources to delete. * @param string $recordingSid The SID of the [Recording](https://www.twilio.com/docs/voice/api/recording) that created the transcription to delete. */ public function __construct( Version $version, string $accountSid, string $recordingSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'recordingSid' => $recordingSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings/' . \rawurlencode($recordingSid) .'/Transcriptions.json'; } /** * Reads TranscriptionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TranscriptionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams TranscriptionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TranscriptionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TranscriptionPage Page of TranscriptionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TranscriptionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TranscriptionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TranscriptionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TranscriptionPage Page of TranscriptionInstance */ public function getPage(string $targetUrl): TranscriptionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TranscriptionPage($this->version, $response, $this->solution); } /** * Constructs a TranscriptionContext * * @param string $sid The Twilio-provided string that uniquely identifies the Transcription resource to delete. */ public function getContext( string $sid ): TranscriptionContext { return new TranscriptionContext( $this->version, $this->solution['accountSid'], $this->solution['recordingSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TranscriptionList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultInstance.php 0000644 00000012267 15021223077 0021422 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadList; /** * @property string|null $sid * @property string|null $accountSid * @property string $status * @property string|null $addOnSid * @property string|null $addOnConfigurationSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property \DateTime|null $dateCompleted * @property string|null $referenceSid * @property array|null $subresourceUris */ class AddOnResultInstance extends InstanceResource { protected $_payloads; /** * Initialize the AddOnResultInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult resources to delete. * @param string $referenceSid The SID of the recording to which the result to delete belongs. * @param string $sid The Twilio-provided string that uniquely identifies the Recording AddOnResult resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $referenceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'addOnSid' => Values::array_get($payload, 'add_on_sid'), 'addOnConfigurationSid' => Values::array_get($payload, 'add_on_configuration_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), 'referenceSid' => Values::array_get($payload, 'reference_sid'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ]; $this->solution = ['accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AddOnResultContext Context for this AddOnResultInstance */ protected function proxy(): AddOnResultContext { if (!$this->context) { $this->context = new AddOnResultContext( $this->version, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the AddOnResultInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AddOnResultInstance * * @return AddOnResultInstance Fetched AddOnResultInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AddOnResultInstance { return $this->proxy()->fetch(); } /** * Access the payloads */ protected function getPayloads(): PayloadList { return $this->proxy()->payloads; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AddOnResultInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultPage.php 0000644 00000003203 15021223077 0020520 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AddOnResultPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AddOnResultInstance \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultInstance */ public function buildInstance(array $payload): AddOnResultInstance { return new AddOnResultInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['referenceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AddOnResultPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/CallContext.php 0000644 00000023111 15021223077 0016043 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Call\RecordingList; use Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageSubscriptionList; use Twilio\Rest\Api\V2010\Account\Call\EventList; use Twilio\Rest\Api\V2010\Account\Call\NotificationList; use Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageList; use Twilio\Rest\Api\V2010\Account\Call\SiprecList; use Twilio\Rest\Api\V2010\Account\Call\StreamList; use Twilio\Rest\Api\V2010\Account\Call\PaymentList; /** * @property RecordingList $recordings * @property UserDefinedMessageSubscriptionList $userDefinedMessageSubscriptions * @property EventList $events * @property NotificationList $notifications * @property UserDefinedMessageList $userDefinedMessages * @property SiprecList $siprec * @property StreamList $streams * @property PaymentList $payments * @method \Twilio\Rest\Api\V2010\Account\Call\SiprecContext siprec(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageSubscriptionContext userDefinedMessageSubscriptions(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Call\PaymentContext payments(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Call\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Call\NotificationContext notifications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Call\StreamContext streams(string $sid) */ class CallContext extends InstanceContext { protected $_recordings; protected $_userDefinedMessageSubscriptions; protected $_events; protected $_notifications; protected $_userDefinedMessages; protected $_siprec; protected $_streams; protected $_payments; /** * Initialize the CallContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $sid The Twilio-provided Call SID that uniquely identifies the Call resource to delete */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($sid) .'.json'; } /** * Delete the CallInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CallInstance * * @return CallInstance Fetched CallInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CallInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CallInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the CallInstance * * @param array|Options $options Optional Arguments * @return CallInstance Updated CallInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CallInstance { $options = new Values($options); $data = Values::of([ 'Url' => $options['url'], 'Method' => $options['method'], 'Status' => $options['status'], 'FallbackUrl' => $options['fallbackUrl'], 'FallbackMethod' => $options['fallbackMethod'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'Twiml' => $options['twiml'], 'TimeLimit' => $options['timeLimit'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CallInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the recordings */ protected function getRecordings(): RecordingList { if (!$this->_recordings) { $this->_recordings = new RecordingList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_recordings; } /** * Access the userDefinedMessageSubscriptions */ protected function getUserDefinedMessageSubscriptions(): UserDefinedMessageSubscriptionList { if (!$this->_userDefinedMessageSubscriptions) { $this->_userDefinedMessageSubscriptions = new UserDefinedMessageSubscriptionList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_userDefinedMessageSubscriptions; } /** * Access the events */ protected function getEvents(): EventList { if (!$this->_events) { $this->_events = new EventList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_events; } /** * Access the notifications */ protected function getNotifications(): NotificationList { if (!$this->_notifications) { $this->_notifications = new NotificationList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_notifications; } /** * Access the userDefinedMessages */ protected function getUserDefinedMessages(): UserDefinedMessageList { if (!$this->_userDefinedMessages) { $this->_userDefinedMessages = new UserDefinedMessageList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_userDefinedMessages; } /** * Access the siprec */ protected function getSiprec(): SiprecList { if (!$this->_siprec) { $this->_siprec = new SiprecList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_siprec; } /** * Access the streams */ protected function getStreams(): StreamList { if (!$this->_streams) { $this->_streams = new StreamList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_streams; } /** * Access the payments */ protected function getPayments(): PaymentList { if (!$this->_payments) { $this->_payments = new PaymentList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_payments; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CallContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppList.php 0000644 00000012757 15021223077 0016527 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ConnectAppList extends ListResource { /** * Construct the ConnectAppList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ConnectApp resource to fetch. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/ConnectApps.json'; } /** * Reads ConnectAppInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConnectAppInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ConnectAppInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ConnectAppInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConnectAppPage Page of ConnectAppInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ConnectAppPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ConnectAppPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConnectAppInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ConnectAppPage Page of ConnectAppInstance */ public function getPage(string $targetUrl): ConnectAppPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConnectAppPage($this->version, $response, $this->solution); } /** * Constructs a ConnectAppContext * * @param string $sid The Twilio-provided string that uniquely identifies the ConnectApp resource to fetch. */ public function getContext( string $sid ): ConnectAppContext { return new ConnectAppContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ConnectAppList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AddressList.php 0000644 00000017365 15021223077 0016062 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class AddressList extends ListResource { /** * Construct the AddressList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will be responsible for the new Address resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Addresses.json'; } /** * Create the AddressInstance * * @param string $customerName The name to associate with the new address. * @param string $street The number and street address of the new address. * @param string $city The city of the new address. * @param string $region The state or region of the new address. * @param string $postalCode The postal code of the new address. * @param string $isoCountry The ISO country code of the new address. * @param array|Options $options Optional Arguments * @return AddressInstance Created AddressInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $customerName, string $street, string $city, string $region, string $postalCode, string $isoCountry, array $options = []): AddressInstance { $options = new Values($options); $data = Values::of([ 'CustomerName' => $customerName, 'Street' => $street, 'City' => $city, 'Region' => $region, 'PostalCode' => $postalCode, 'IsoCountry' => $isoCountry, 'FriendlyName' => $options['friendlyName'], 'EmergencyEnabled' => Serialize::booleanToString($options['emergencyEnabled']), 'AutoCorrectAddress' => Serialize::booleanToString($options['autoCorrectAddress']), 'StreetSecondary' => $options['streetSecondary'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AddressInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads AddressInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AddressInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams AddressInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AddressInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AddressPage Page of AddressInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AddressPage { $options = new Values($options); $params = Values::of([ 'CustomerName' => $options['customerName'], 'FriendlyName' => $options['friendlyName'], 'IsoCountry' => $options['isoCountry'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AddressPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AddressInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AddressPage Page of AddressInstance */ public function getPage(string $targetUrl): AddressPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AddressPage($this->version, $response, $this->solution); } /** * Constructs a AddressContext * * @param string $sid The Twilio-provided string that uniquely identifies the Address resource to delete. */ public function getContext( string $sid ): AddressContext { return new AddressContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AddressList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AddressPage.php 0000644 00000003066 15021223077 0016014 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AddressPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AddressInstance \Twilio\Rest\Api\V2010\Account\AddressInstance */ public function buildInstance(array $payload): AddressInstance { return new AddressInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AddressPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestList.php 0000644 00000005523 15021223077 0020131 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ValidationRequestList extends ListResource { /** * Construct the ValidationRequestList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for the new caller ID resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/OutgoingCallerIds.json'; } /** * Create the ValidationRequestInstance * * @param string $phoneNumber The phone number to verify in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. * @param array|Options $options Optional Arguments * @return ValidationRequestInstance Created ValidationRequestInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumber, array $options = []): ValidationRequestInstance { $options = new Values($options); $data = Values::of([ 'PhoneNumber' => $phoneNumber, 'FriendlyName' => $options['friendlyName'], 'CallDelay' => $options['callDelay'], 'Extension' => $options['extension'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ValidationRequestInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ValidationRequestList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionList.php 0000644 00000013064 15021223077 0017324 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TranscriptionList extends ListResource { /** * Construct the TranscriptionList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Transcription resources to delete. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Transcriptions.json'; } /** * Reads TranscriptionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TranscriptionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams TranscriptionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TranscriptionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TranscriptionPage Page of TranscriptionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TranscriptionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TranscriptionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TranscriptionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TranscriptionPage Page of TranscriptionInstance */ public function getPage(string $targetUrl): TranscriptionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TranscriptionPage($this->version, $response, $this->solution); } /** * Constructs a TranscriptionContext * * @param string $sid The Twilio-provided string that uniquely identifies the Transcription resource to delete. */ public function getContext( string $sid ): TranscriptionContext { return new TranscriptionContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TranscriptionList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/QueueList.php 0000644 00000014434 15021223077 0015553 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class QueueList extends ListResource { /** * Construct the QueueList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Queues.json'; } /** * Create the QueueInstance * * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. * @param array|Options $options Optional Arguments * @return QueueInstance Created QueueInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): QueueInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'MaxSize' => $options['maxSize'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new QueueInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads QueueInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return QueueInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams QueueInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of QueueInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return QueuePage Page of QueueInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): QueuePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new QueuePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of QueueInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return QueuePage Page of QueueInstance */ public function getPage(string $targetUrl): QueuePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new QueuePage($this->version, $response, $this->solution); } /** * Constructs a QueueContext * * @param string $sid The Twilio-provided string that uniquely identifies the Queue resource to delete */ public function getContext( string $sid ): QueueContext { return new QueueContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.QueueList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberInstance.php 0000644 00000020445 15021223077 0021225 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Base\PhoneNumberCapabilities; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnList; /** * @property string|null $accountSid * @property string|null $addressSid * @property string $addressRequirements * @property string|null $apiVersion * @property bool|null $beta * @property PhoneNumberCapabilities|null $capabilities * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string|null $identitySid * @property string|null $phoneNumber * @property string|null $origin * @property string|null $sid * @property string|null $smsApplicationSid * @property string|null $smsFallbackMethod * @property string|null $smsFallbackUrl * @property string|null $smsMethod * @property string|null $smsUrl * @property string|null $statusCallback * @property string|null $statusCallbackMethod * @property string|null $trunkSid * @property string|null $uri * @property string $voiceReceiveMode * @property string|null $voiceApplicationSid * @property bool|null $voiceCallerIdLookup * @property string|null $voiceFallbackMethod * @property string|null $voiceFallbackUrl * @property string|null $voiceMethod * @property string|null $voiceUrl * @property string $emergencyStatus * @property string|null $emergencyAddressSid * @property string $emergencyAddressStatus * @property string|null $bundleSid * @property string|null $status */ class IncomingPhoneNumberInstance extends InstanceResource { protected $_assignedAddOns; /** * Initialize the IncomingPhoneNumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $sid The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'identitySid' => Values::array_get($payload, 'identity_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'origin' => Values::array_get($payload, 'origin'), 'sid' => Values::array_get($payload, 'sid'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'uri' => Values::array_get($payload, 'uri'), 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), 'bundleSid' => Values::array_get($payload, 'bundle_sid'), 'status' => Values::array_get($payload, 'status'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return IncomingPhoneNumberContext Context for this IncomingPhoneNumberInstance */ protected function proxy(): IncomingPhoneNumberContext { if (!$this->context) { $this->context = new IncomingPhoneNumberContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the IncomingPhoneNumberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the IncomingPhoneNumberInstance * * @return IncomingPhoneNumberInstance Fetched IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IncomingPhoneNumberInstance { return $this->proxy()->fetch(); } /** * Update the IncomingPhoneNumberInstance * * @param array|Options $options Optional Arguments * @return IncomingPhoneNumberInstance Updated IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): IncomingPhoneNumberInstance { return $this->proxy()->update($options); } /** * Access the assignedAddOns */ protected function getAssignedAddOns(): AssignedAddOnList { return $this->proxy()->assignedAddOns; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IncomingPhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberPage.php 0000644 00000003176 15021223077 0020337 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class IncomingPhoneNumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return IncomingPhoneNumberInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberInstance */ public function buildInstance(array $payload): IncomingPhoneNumberInstance { return new IncomingPhoneNumberInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.IncomingPhoneNumberPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/KeyInstance.php 0000644 00000010406 15021223077 0016043 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class KeyInstance extends InstanceResource { /** * Initialize the KeyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Key resources to delete. * @param string $sid The Twilio-provided string that uniquely identifies the Key resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return KeyContext Context for this KeyInstance */ protected function proxy(): KeyContext { if (!$this->context) { $this->context = new KeyContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the KeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the KeyInstance * * @return KeyInstance Fetched KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): KeyInstance { return $this->proxy()->fetch(); } /** * Update the KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Updated KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): KeyInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.KeyInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php 0000644 00000006240 15021223077 0017243 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class SigningKeyContext extends InstanceContext { /** * Initialize the SigningKeyContext * * @param Version $version Version that contains the resource * @param string $accountSid * @param string $sid */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SigningKeys/' . \rawurlencode($sid) .'.json'; } /** * Delete the SigningKeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SigningKeyInstance * * @return SigningKeyInstance Fetched SigningKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SigningKeyInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SigningKeyInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the SigningKeyInstance * * @param array|Options $options Optional Arguments * @return SigningKeyInstance Updated SigningKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SigningKeyInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SigningKeyInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.SigningKeyContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerPage.php 0000644 00000003102 15021223077 0017065 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TriggerPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TriggerInstance \Twilio\Rest\Api\V2010\Account\Usage\TriggerInstance */ public function buildInstance(array $payload): TriggerInstance { return new TriggerInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TriggerPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerOptions.php 0000644 00000026505 15021223077 0017660 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Options; use Twilio\Values; abstract class TriggerOptions { /** * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $recurring * @param string $triggerBy * @return CreateTriggerOptions Options builder */ public static function create( string $callbackMethod = Values::NONE, string $friendlyName = Values::NONE, string $recurring = Values::NONE, string $triggerBy = Values::NONE ): CreateTriggerOptions { return new CreateTriggerOptions( $callbackMethod, $friendlyName, $recurring, $triggerBy ); } /** * @param string $recurring The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. * @param string $triggerBy The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). * @param string $usageCategory The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). * @return ReadTriggerOptions Options builder */ public static function read( string $recurring = Values::NONE, string $triggerBy = Values::NONE, string $usageCategory = Values::NONE ): ReadTriggerOptions { return new ReadTriggerOptions( $recurring, $triggerBy, $usageCategory ); } /** * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * @param string $callbackUrl The URL we should call using `callback_method` when the trigger fires. * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return UpdateTriggerOptions Options builder */ public static function update( string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $friendlyName = Values::NONE ): UpdateTriggerOptions { return new UpdateTriggerOptions( $callbackMethod, $callbackUrl, $friendlyName ); } } class CreateTriggerOptions extends Options { /** * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $recurring * @param string $triggerBy */ public function __construct( string $callbackMethod = Values::NONE, string $friendlyName = Values::NONE, string $recurring = Values::NONE, string $triggerBy = Values::NONE ) { $this->options['callbackMethod'] = $callbackMethod; $this->options['friendlyName'] = $friendlyName; $this->options['recurring'] = $recurring; $this->options['triggerBy'] = $triggerBy; } /** * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * @param string $recurring * @return $this Fluent Builder */ public function setRecurring(string $recurring): self { $this->options['recurring'] = $recurring; return $this; } /** * @param string $triggerBy * @return $this Fluent Builder */ public function setTriggerBy(string $triggerBy): self { $this->options['triggerBy'] = $triggerBy; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateTriggerOptions ' . $options . ']'; } } class ReadTriggerOptions extends Options { /** * @param string $recurring The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. * @param string $triggerBy The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). * @param string $usageCategory The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). */ public function __construct( string $recurring = Values::NONE, string $triggerBy = Values::NONE, string $usageCategory = Values::NONE ) { $this->options['recurring'] = $recurring; $this->options['triggerBy'] = $triggerBy; $this->options['usageCategory'] = $usageCategory; } /** * The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. * * @param string $recurring The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. * @return $this Fluent Builder */ public function setRecurring(string $recurring): self { $this->options['recurring'] = $recurring; return $this; } /** * The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). * * @param string $triggerBy The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). * @return $this Fluent Builder */ public function setTriggerBy(string $triggerBy): self { $this->options['triggerBy'] = $triggerBy; return $this; } /** * The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). * * @param string $usageCategory The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). * @return $this Fluent Builder */ public function setUsageCategory(string $usageCategory): self { $this->options['usageCategory'] = $usageCategory; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadTriggerOptions ' . $options . ']'; } } class UpdateTriggerOptions extends Options { /** * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * @param string $callbackUrl The URL we should call using `callback_method` when the trigger fires. * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ public function __construct( string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['friendlyName'] = $friendlyName; } /** * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The URL we should call using `callback_method` when the trigger fires. * * @param string $callbackUrl The URL we should call using `callback_method` when the trigger fires. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateTriggerOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerInstance.php 0000644 00000013202 15021223077 0017757 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $callbackMethod * @property string|null $callbackUrl * @property string|null $currentValue * @property \DateTime|null $dateCreated * @property \DateTime|null $dateFired * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string $recurring * @property string|null $sid * @property string $triggerBy * @property string|null $triggerValue * @property string|null $uri * @property string $usageCategory * @property string|null $usageRecordUri */ class TriggerInstance extends InstanceResource { /** * Initialize the TriggerInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $sid The Twilio-provided string that uniquely identifies the UsageTrigger resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callbackMethod' => Values::array_get($payload, 'callback_method'), 'callbackUrl' => Values::array_get($payload, 'callback_url'), 'currentValue' => Values::array_get($payload, 'current_value'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateFired' => Deserialize::dateTime(Values::array_get($payload, 'date_fired')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'recurring' => Values::array_get($payload, 'recurring'), 'sid' => Values::array_get($payload, 'sid'), 'triggerBy' => Values::array_get($payload, 'trigger_by'), 'triggerValue' => Values::array_get($payload, 'trigger_value'), 'uri' => Values::array_get($payload, 'uri'), 'usageCategory' => Values::array_get($payload, 'usage_category'), 'usageRecordUri' => Values::array_get($payload, 'usage_record_uri'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TriggerContext Context for this TriggerInstance */ protected function proxy(): TriggerContext { if (!$this->context) { $this->context = new TriggerContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the TriggerInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TriggerInstance * * @return TriggerInstance Fetched TriggerInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TriggerInstance { return $this->proxy()->fetch(); } /** * Update the TriggerInstance * * @param array|Options $options Optional Arguments * @return TriggerInstance Updated TriggerInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TriggerInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.TriggerInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordOptions.php 0000644 00000015307 15021223077 0017471 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Options; use Twilio\Values; abstract class RecordOptions { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return ReadRecordOptions Options builder */ public static function read( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ): ReadRecordOptions { return new ReadRecordOptions( $category, $startDate, $endDate, $includeSubaccounts ); } } class ReadRecordOptions extends Options { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ public function __construct( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadRecordOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyInstance.php 0000644 00000007232 15021223077 0020642 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $asOf * @property string $category * @property string|null $count * @property string|null $countUnit * @property string|null $description * @property \DateTime|null $endDate * @property string|null $price * @property string|null $priceUnit * @property \DateTime|null $startDate * @property array|null $subresourceUris * @property string|null $uri * @property string|null $usage * @property string|null $usageUnit */ class DailyInstance extends InstanceResource { /** * Initialize the DailyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.DailyInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayPage.php 0000644 00000003104 15021223077 0017762 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TodayPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TodayInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\TodayInstance */ public function buildInstance(array $payload): TodayInstance { return new TodayInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TodayPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayInstance.php 0000644 00000007232 15021223077 0020660 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $asOf * @property string $category * @property string|null $count * @property string|null $countUnit * @property string|null $description * @property \DateTime|null $endDate * @property string|null $price * @property string|null $priceUnit * @property \DateTime|null $startDate * @property array|null $subresourceUris * @property string|null $uri * @property string|null $usage * @property string|null $usageUnit */ class TodayInstance extends InstanceResource { /** * Initialize the TodayInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TodayInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthOptions.php 0000644 00000015340 15021223077 0021377 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class LastMonthOptions { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return ReadLastMonthOptions Options builder */ public static function read( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ): ReadLastMonthOptions { return new ReadLastMonthOptions( $category, $startDate, $endDate, $includeSubaccounts ); } } class ReadLastMonthOptions extends Options { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ public function __construct( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadLastMonthOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimePage.php 0000644 00000003120 15021223077 0020227 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AllTimePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AllTimeInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\AllTimeInstance */ public function buildInstance(array $payload): AllTimeInstance { return new AllTimeInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AllTimePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyPage.php 0000644 00000003112 15021223077 0020146 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class YearlyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return YearlyInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\YearlyInstance */ public function buildInstance(array $payload): YearlyInstance { return new YearlyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.YearlyPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthList.php 0000644 00000013336 15021223077 0020666 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ThisMonthList extends ListResource { /** * Construct the ThisMonthList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/ThisMonth.json'; } /** * Reads ThisMonthInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ThisMonthInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ThisMonthInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ThisMonthInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ThisMonthPage Page of ThisMonthInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ThisMonthPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ThisMonthPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ThisMonthInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ThisMonthPage Page of ThisMonthInstance */ public function getPage(string $targetUrl): ThisMonthPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ThisMonthPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ThisMonthList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthPage.php 0000644 00000003134 15021223077 0020616 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class LastMonthPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return LastMonthInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\LastMonthInstance */ public function buildInstance(array $payload): LastMonthInstance { return new LastMonthInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.LastMonthPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthList.php 0000644 00000013336 15021223077 0020662 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class LastMonthList extends ListResource { /** * Construct the LastMonthList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/LastMonth.json'; } /** * Reads LastMonthInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return LastMonthInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams LastMonthInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of LastMonthInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return LastMonthPage Page of LastMonthInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): LastMonthPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new LastMonthPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of LastMonthInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return LastMonthPage Page of LastMonthInstance */ public function getPage(string $targetUrl): LastMonthPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new LastMonthPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.LastMonthList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeOptions.php 0000644 00000015324 15021223077 0021017 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class AllTimeOptions { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return ReadAllTimeOptions Options builder */ public static function read( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ): ReadAllTimeOptions { return new ReadAllTimeOptions( $category, $startDate, $endDate, $includeSubaccounts ); } } class ReadAllTimeOptions extends Options { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ public function __construct( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadAllTimeOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyList.php 0000644 00000013274 15021223077 0020404 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class MonthlyList extends ListResource { /** * Construct the MonthlyList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/Monthly.json'; } /** * Reads MonthlyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MonthlyInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MonthlyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MonthlyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MonthlyPage Page of MonthlyInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MonthlyPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MonthlyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MonthlyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MonthlyPage Page of MonthlyInstance */ public function getPage(string $targetUrl): MonthlyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MonthlyPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MonthlyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeInstance.php 0000644 00000007240 15021223077 0021126 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $asOf * @property string $category * @property string|null $count * @property string|null $countUnit * @property string|null $description * @property \DateTime|null $endDate * @property string|null $price * @property string|null $priceUnit * @property \DateTime|null $startDate * @property array|null $subresourceUris * @property string|null $uri * @property string|null $usage * @property string|null $usageUnit */ class AllTimeInstance extends InstanceResource { /** * Initialize the AllTimeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AllTimeInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthInstance.php 0000644 00000007246 15021223077 0021516 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $asOf * @property string $category * @property string|null $count * @property string|null $countUnit * @property string|null $description * @property \DateTime|null $endDate * @property string|null $price * @property string|null $priceUnit * @property \DateTime|null $startDate * @property array|null $subresourceUris * @property string|null $uri * @property string|null $usage * @property string|null $usageUnit */ class LastMonthInstance extends InstanceResource { /** * Initialize the LastMonthInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.LastMonthInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeList.php 0000644 00000013274 15021223077 0020301 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class AllTimeList extends ListResource { /** * Construct the AllTimeList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/AllTime.json'; } /** * Reads AllTimeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AllTimeInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams AllTimeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AllTimeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AllTimePage Page of AllTimeInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AllTimePage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AllTimePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AllTimeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AllTimePage Page of AllTimeInstance */ public function getPage(string $targetUrl): AllTimePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AllTimePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AllTimeList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayList.php 0000644 00000013336 15021223077 0020722 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class YesterdayList extends ListResource { /** * Construct the YesterdayList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/Yesterday.json'; } /** * Reads YesterdayInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return YesterdayInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams YesterdayInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of YesterdayInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return YesterdayPage Page of YesterdayInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): YesterdayPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new YesterdayPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of YesterdayInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return YesterdayPage Page of YesterdayInstance */ public function getPage(string $targetUrl): YesterdayPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new YesterdayPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.YesterdayList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthInstance.php 0000644 00000007246 15021223077 0021522 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $asOf * @property string $category * @property string|null $count * @property string|null $countUnit * @property string|null $description * @property \DateTime|null $endDate * @property string|null $price * @property string|null $priceUnit * @property \DateTime|null $startDate * @property array|null $subresourceUris * @property string|null $uri * @property string|null $usage * @property string|null $usageUnit */ class ThisMonthInstance extends InstanceResource { /** * Initialize the ThisMonthInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ThisMonthInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthPage.php 0000644 00000003134 15021223077 0020622 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ThisMonthPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ThisMonthInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\ThisMonthInstance */ public function buildInstance(array $payload): ThisMonthInstance { return new ThisMonthInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ThisMonthPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyOptions.php 0000644 00000015310 15021223077 0020525 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class DailyOptions { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return ReadDailyOptions Options builder */ public static function read( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ): ReadDailyOptions { return new ReadDailyOptions( $category, $startDate, $endDate, $includeSubaccounts ); } } class ReadDailyOptions extends Options { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ public function __construct( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadDailyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayOptions.php 0000644 00000015310 15021223077 0020543 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class TodayOptions { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return ReadTodayOptions Options builder */ public static function read( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ): ReadTodayOptions { return new ReadTodayOptions( $category, $startDate, $endDate, $includeSubaccounts ); } } class ReadTodayOptions extends Options { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ public function __construct( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadTodayOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyOptions.php 0000644 00000015324 15021223077 0021122 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class MonthlyOptions { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return ReadMonthlyOptions Options builder */ public static function read( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ): ReadMonthlyOptions { return new ReadMonthlyOptions( $category, $startDate, $endDate, $includeSubaccounts ); } } class ReadMonthlyOptions extends Options { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ public function __construct( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadMonthlyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayList.php 0000644 00000013232 15021223077 0020024 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class TodayList extends ListResource { /** * Construct the TodayList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/Today.json'; } /** * Reads TodayInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TodayInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TodayInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TodayInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TodayPage Page of TodayInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TodayPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TodayPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TodayInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TodayPage Page of TodayInstance */ public function getPage(string $targetUrl): TodayPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TodayPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TodayList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthOptions.php 0000644 00000015340 15021223077 0021403 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class ThisMonthOptions { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return ReadThisMonthOptions Options builder */ public static function read( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ): ReadThisMonthOptions { return new ReadThisMonthOptions( $category, $startDate, $endDate, $includeSubaccounts ); } } class ReadThisMonthOptions extends Options { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ public function __construct( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadThisMonthOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyList.php 0000644 00000013232 15021223077 0020006 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class DailyList extends ListResource { /** * Construct the DailyList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/Daily.json'; } /** * Reads DailyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DailyInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams DailyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DailyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DailyPage Page of DailyInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DailyPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DailyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DailyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DailyPage Page of DailyInstance */ public function getPage(string $targetUrl): DailyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DailyPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.DailyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyPage.php 0000644 00000003104 15021223077 0017744 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DailyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DailyInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\DailyInstance */ public function buildInstance(array $payload): DailyInstance { return new DailyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.DailyPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayOptions.php 0000644 00000015340 15021223077 0021437 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class YesterdayOptions { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return ReadYesterdayOptions Options builder */ public static function read( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ): ReadYesterdayOptions { return new ReadYesterdayOptions( $category, $startDate, $endDate, $includeSubaccounts ); } } class ReadYesterdayOptions extends Options { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ public function __construct( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadYesterdayOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayInstance.php 0000644 00000007246 15021223077 0021556 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $asOf * @property string $category * @property string|null $count * @property string|null $countUnit * @property string|null $description * @property \DateTime|null $endDate * @property string|null $price * @property string|null $priceUnit * @property \DateTime|null $startDate * @property array|null $subresourceUris * @property string|null $uri * @property string|null $usage * @property string|null $usageUnit */ class YesterdayInstance extends InstanceResource { /** * Initialize the YesterdayInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.YesterdayInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayPage.php 0000644 00000003134 15021223077 0020656 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class YesterdayPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return YesterdayInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\YesterdayInstance */ public function buildInstance(array $payload): YesterdayInstance { return new YesterdayInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.YesterdayPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyOptions.php 0000644 00000015316 15021223077 0020736 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class YearlyOptions { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return ReadYearlyOptions Options builder */ public static function read( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ): ReadYearlyOptions { return new ReadYearlyOptions( $category, $startDate, $endDate, $includeSubaccounts ); } } class ReadYearlyOptions extends Options { /** * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. */ public function __construct( string $category = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null, bool $includeSubaccounts = Values::BOOL_NONE ) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * @return $this Fluent Builder */ public function setCategory(string $category): self { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * @return $this Fluent Builder */ public function setIncludeSubaccounts(bool $includeSubaccounts): self { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadYearlyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyInstance.php 0000644 00000007240 15021223077 0021231 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $asOf * @property string $category * @property string|null $count * @property string|null $countUnit * @property string|null $description * @property \DateTime|null $endDate * @property string|null $price * @property string|null $priceUnit * @property \DateTime|null $startDate * @property array|null $subresourceUris * @property string|null $uri * @property string|null $usage * @property string|null $usageUnit */ class MonthlyInstance extends InstanceResource { /** * Initialize the MonthlyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MonthlyInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyInstance.php 0000644 00000007235 15021223077 0021050 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $asOf * @property string $category * @property string|null $count * @property string|null $countUnit * @property string|null $description * @property \DateTime|null $endDate * @property string|null $price * @property string|null $priceUnit * @property \DateTime|null $startDate * @property array|null $subresourceUris * @property string|null $uri * @property string|null $usage * @property string|null $usageUnit */ class YearlyInstance extends InstanceResource { /** * Initialize the YearlyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.YearlyInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyList.php 0000644 00000013253 15021223077 0020214 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class YearlyList extends ListResource { /** * Construct the YearlyList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records/Yearly.json'; } /** * Reads YearlyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return YearlyInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams YearlyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of YearlyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return YearlyPage Page of YearlyInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): YearlyPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new YearlyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of YearlyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return YearlyPage Page of YearlyInstance */ public function getPage(string $targetUrl): YearlyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new YearlyPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.YearlyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyPage.php 0000644 00000003120 15021223077 0020332 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MonthlyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MonthlyInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\MonthlyInstance */ public function buildInstance(array $payload): MonthlyInstance { return new MonthlyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MonthlyPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordPage.php 0000644 00000003074 15021223077 0016710 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RecordInstance \Twilio\Rest\Api\V2010\Account\Usage\RecordInstance */ public function buildInstance(array $payload): RecordInstance { return new RecordInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.RecordPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerContext.php 0000644 00000006715 15021223077 0017652 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class TriggerContext extends InstanceContext { /** * Initialize the TriggerContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $sid The Twilio-provided string that uniquely identifies the UsageTrigger resource to delete. */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Triggers/' . \rawurlencode($sid) .'.json'; } /** * Delete the TriggerInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the TriggerInstance * * @return TriggerInstance Fetched TriggerInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TriggerInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new TriggerInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the TriggerInstance * * @param array|Options $options Optional Arguments * @return TriggerInstance Updated TriggerInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TriggerInstance { $options = new Values($options); $data = Values::of([ 'CallbackMethod' => $options['callbackMethod'], 'CallbackUrl' => $options['callbackUrl'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new TriggerInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.TriggerContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordList.php 0000644 00000024473 15021223077 0016755 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Api\V2010\Account\Usage\Record\LastMonthList; use Twilio\Rest\Api\V2010\Account\Usage\Record\TodayList; use Twilio\Rest\Api\V2010\Account\Usage\Record\YearlyList; use Twilio\Rest\Api\V2010\Account\Usage\Record\ThisMonthList; use Twilio\Rest\Api\V2010\Account\Usage\Record\DailyList; use Twilio\Rest\Api\V2010\Account\Usage\Record\AllTimeList; use Twilio\Rest\Api\V2010\Account\Usage\Record\YesterdayList; use Twilio\Rest\Api\V2010\Account\Usage\Record\MonthlyList; /** * @property LastMonthList $lastMonth * @property TodayList $today * @property YearlyList $yearly * @property ThisMonthList $thisMonth * @property DailyList $daily * @property AllTimeList $allTime * @property YesterdayList $yesterday * @property MonthlyList $monthly */ class RecordList extends ListResource { protected $_lastMonth = null; protected $_today = null; protected $_yearly = null; protected $_thisMonth = null; protected $_daily = null; protected $_allTime = null; protected $_yesterday = null; protected $_monthly = null; /** * Construct the RecordList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Records.json'; } /** * Reads RecordInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RecordInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RecordInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RecordInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RecordPage Page of RecordInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RecordPage { $options = new Values($options); $params = Values::of([ 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RecordPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RecordInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RecordPage Page of RecordInstance */ public function getPage(string $targetUrl): RecordPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RecordPage($this->version, $response, $this->solution); } /** * Access the lastMonth */ protected function getLastMonth(): LastMonthList { if (!$this->_lastMonth) { $this->_lastMonth = new LastMonthList( $this->version, $this->solution['accountSid'] ); } return $this->_lastMonth; } /** * Access the today */ protected function getToday(): TodayList { if (!$this->_today) { $this->_today = new TodayList( $this->version, $this->solution['accountSid'] ); } return $this->_today; } /** * Access the yearly */ protected function getYearly(): YearlyList { if (!$this->_yearly) { $this->_yearly = new YearlyList( $this->version, $this->solution['accountSid'] ); } return $this->_yearly; } /** * Access the thisMonth */ protected function getThisMonth(): ThisMonthList { if (!$this->_thisMonth) { $this->_thisMonth = new ThisMonthList( $this->version, $this->solution['accountSid'] ); } return $this->_thisMonth; } /** * Access the daily */ protected function getDaily(): DailyList { if (!$this->_daily) { $this->_daily = new DailyList( $this->version, $this->solution['accountSid'] ); } return $this->_daily; } /** * Access the allTime */ protected function getAllTime(): AllTimeList { if (!$this->_allTime) { $this->_allTime = new AllTimeList( $this->version, $this->solution['accountSid'] ); } return $this->_allTime; } /** * Access the yesterday */ protected function getYesterday(): YesterdayList { if (!$this->_yesterday) { $this->_yesterday = new YesterdayList( $this->version, $this->solution['accountSid'] ); } return $this->_yesterday; } /** * Access the monthly */ protected function getMonthly(): MonthlyList { if (!$this->_monthly) { $this->_monthly = new MonthlyList( $this->version, $this->solution['accountSid'] ); } return $this->_monthly; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.RecordList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerList.php 0000644 00000016656 15021223077 0017146 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TriggerList extends ListResource { /** * Construct the TriggerList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Usage/Triggers.json'; } /** * Create the TriggerInstance * * @param string $callbackUrl The URL we should call using `callback_method` when the trigger fires. * @param string $triggerValue The usage value at which the trigger should fire. For convenience, you can use an offset value such as `+30` to specify a trigger_value that is 30 units more than the current usage value. Be sure to urlencode a `+` as `%2B`. * @param string $usageCategory * @param array|Options $options Optional Arguments * @return TriggerInstance Created TriggerInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $callbackUrl, string $triggerValue, string $usageCategory, array $options = []): TriggerInstance { $options = new Values($options); $data = Values::of([ 'CallbackUrl' => $callbackUrl, 'TriggerValue' => $triggerValue, 'UsageCategory' => $usageCategory, 'CallbackMethod' => $options['callbackMethod'], 'FriendlyName' => $options['friendlyName'], 'Recurring' => $options['recurring'], 'TriggerBy' => $options['triggerBy'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TriggerInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads TriggerInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TriggerInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TriggerInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TriggerInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TriggerPage Page of TriggerInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TriggerPage { $options = new Values($options); $params = Values::of([ 'Recurring' => $options['recurring'], 'TriggerBy' => $options['triggerBy'], 'UsageCategory' => $options['usageCategory'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TriggerPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TriggerInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TriggerPage Page of TriggerInstance */ public function getPage(string $targetUrl): TriggerPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TriggerPage($this->version, $response, $this->solution); } /** * Constructs a TriggerContext * * @param string $sid The Twilio-provided string that uniquely identifies the UsageTrigger resource to delete. */ public function getContext( string $sid ): TriggerContext { return new TriggerContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TriggerList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordInstance.php 0000644 00000007226 15021223077 0017603 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $asOf * @property string $category * @property string|null $count * @property string|null $countUnit * @property string|null $description * @property \DateTime|null $endDate * @property string|null $price * @property string|null $priceUnit * @property \DateTime|null $startDate * @property array|null $subresourceUris * @property string|null $uri * @property string|null $usage * @property string|null $usageUnit */ class RecordInstance extends InstanceResource { /** * Initialize the RecordInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the UsageRecord resources to read. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.RecordInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SipList.php 0000644 00000010445 15021223077 0015220 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Sip\DomainList; use Twilio\Rest\Api\V2010\Account\Sip\CredentialListList; use Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlListList; /** * @property DomainList $domains * @property CredentialListList $credentialLists * @property IpAccessControlListList $ipAccessControlLists * @method \Twilio\Rest\Api\V2010\Account\Sip\DomainContext domains(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Sip\CredentialListContext credentialLists(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlListContext ipAccessControlLists(string $sid) */ class SipList extends ListResource { protected $_domains = null; protected $_credentialLists = null; protected $_ipAccessControlLists = null; /** * Construct the SipList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the SipDomain resources to read. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; } /** * Access the domains */ protected function getDomains(): DomainList { if (!$this->_domains) { $this->_domains = new DomainList( $this->version, $this->solution['accountSid'] ); } return $this->_domains; } /** * Access the credentialLists */ protected function getCredentialLists(): CredentialListList { if (!$this->_credentialLists) { $this->_credentialLists = new CredentialListList( $this->version, $this->solution['accountSid'] ); } return $this->_credentialLists; } /** * Access the ipAccessControlLists */ protected function getIpAccessControlLists(): IpAccessControlListList { if (!$this->_ipAccessControlLists) { $this->_ipAccessControlLists = new IpAccessControlListList( $this->version, $this->solution['accountSid'] ); } return $this->_ipAccessControlLists; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.SipList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineList.php 0000644 00000016452 15021223077 0025234 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class MachineToMachineList extends ListResource { /** * Construct the MachineToMachineList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. */ public function __construct( Version $version, string $accountSid, string $countryCode ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) .'/MachineToMachine.json'; } /** * Reads MachineToMachineInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MachineToMachineInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MachineToMachineInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MachineToMachineInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MachineToMachinePage Page of MachineToMachineInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MachineToMachinePage { $options = new Values($options); $params = Values::of([ 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MachineToMachinePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MachineToMachineInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MachineToMachinePage Page of MachineToMachineInstance */ public function getPage(string $targetUrl): MachineToMachinePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MachineToMachinePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MachineToMachineList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachinePage.php 0000644 00000003304 15021223077 0025165 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MachineToMachinePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MachineToMachineInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineInstance */ public function buildInstance(array $payload): MachineToMachineInstance { return new MachineToMachineInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MachineToMachinePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipInstance.php 0000644 00000007431 15021223077 0023643 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Base\PhoneNumberCapabilities; /** * @property string|null $friendlyName * @property string|null $phoneNumber * @property string|null $lata * @property string|null $locality * @property string|null $rateCenter * @property string|null $latitude * @property string|null $longitude * @property string|null $region * @property string|null $postalCode * @property string|null $isoCountry * @property string|null $addressRequirements * @property bool|null $beta * @property PhoneNumberCapabilities|null $capabilities */ class VoipInstance extends InstanceResource { /** * Initialize the VoipInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.VoipInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobilePage.php 0000644 00000003210 15021223077 0023234 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MobilePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MobileInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileInstance */ public function buildInstance(array $payload): MobileInstance { return new MobileInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MobilePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostOptions.php 0000644 00000052721 15021223077 0024656 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class SharedCostOptions { /** * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return ReadSharedCostOptions Options builder */ public static function read( int $areaCode = Values::INT_NONE, string $contains = Values::NONE, bool $smsEnabled = Values::BOOL_NONE, bool $mmsEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $excludeAllAddressRequired = Values::BOOL_NONE, bool $excludeLocalAddressRequired = Values::BOOL_NONE, bool $excludeForeignAddressRequired = Values::BOOL_NONE, bool $beta = Values::BOOL_NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::INT_NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::BOOL_NONE ): ReadSharedCostOptions { return new ReadSharedCostOptions( $areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled ); } } class ReadSharedCostOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ public function __construct( int $areaCode = Values::INT_NONE, string $contains = Values::NONE, bool $smsEnabled = Values::BOOL_NONE, bool $mmsEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $excludeAllAddressRequired = Values::BOOL_NONE, bool $excludeLocalAddressRequired = Values::BOOL_NONE, bool $excludeForeignAddressRequired = Values::BOOL_NONE, bool $beta = Values::BOOL_NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::INT_NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::BOOL_NONE ) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setAreaCode(int $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @return $this Fluent Builder */ public function setContains(string $contains): self { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmsEnabled(bool $smsEnabled): self { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMmsEnabled(bool $mmsEnabled): self { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearNumber(string $nearNumber): self { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearLatLong(string $nearLatLong): self { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setDistance(int $distance): self { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInPostalCode(string $inPostalCode): self { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRegion(string $inRegion): self { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRateCenter(string $inRateCenter): self { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInLata(string $inLata): self { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @return $this Fluent Builder */ public function setInLocality(string $inLocality): self { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setFaxEnabled(bool $faxEnabled): self { $this->options['faxEnabled'] = $faxEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadSharedCostOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeInstance.php 0000644 00000007445 15021223077 0024447 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Base\PhoneNumberCapabilities; /** * @property string|null $friendlyName * @property string|null $phoneNumber * @property string|null $lata * @property string|null $locality * @property string|null $rateCenter * @property string|null $latitude * @property string|null $longitude * @property string|null $region * @property string|null $postalCode * @property string|null $isoCountry * @property string|null $addressRequirements * @property bool|null $beta * @property PhoneNumberCapabilities|null $capabilities */ class TollFreeInstance extends InstanceResource { /** * Initialize the TollFreeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TollFreeInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeList.php 0000644 00000016242 15021223077 0023611 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class TollFreeList extends ListResource { /** * Construct the TollFreeList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. */ public function __construct( Version $version, string $accountSid, string $countryCode ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) .'/TollFree.json'; } /** * Reads TollFreeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TollFreeInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TollFreeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TollFreeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TollFreePage Page of TollFreeInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TollFreePage { $options = new Values($options); $params = Values::of([ 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TollFreePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TollFreeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TollFreePage Page of TollFreeInstance */ public function getPage(string $targetUrl): TollFreePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TollFreePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TollFreeList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostInstance.php 0000644 00000007453 15021223077 0024771 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Base\PhoneNumberCapabilities; /** * @property string|null $friendlyName * @property string|null $phoneNumber * @property string|null $lata * @property string|null $locality * @property string|null $rateCenter * @property string|null $latitude * @property string|null $longitude * @property string|null $region * @property string|null $postalCode * @property string|null $isoCountry * @property string|null $addressRequirements * @property bool|null $beta * @property PhoneNumberCapabilities|null $capabilities */ class SharedCostInstance extends InstanceResource { /** * Initialize the SharedCostInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.SharedCostInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostList.php 0000644 00000016304 15021223077 0024133 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class SharedCostList extends ListResource { /** * Construct the SharedCostList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. */ public function __construct( Version $version, string $accountSid, string $countryCode ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) .'/SharedCost.json'; } /** * Reads SharedCostInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SharedCostInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SharedCostInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SharedCostInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SharedCostPage Page of SharedCostInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SharedCostPage { $options = new Values($options); $params = Values::of([ 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SharedCostPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SharedCostInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SharedCostPage Page of SharedCostInstance */ public function getPage(string $targetUrl): SharedCostPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SharedCostPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.SharedCostList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileOptions.php 0000644 00000052671 15021223077 0024032 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class MobileOptions { /** * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return ReadMobileOptions Options builder */ public static function read( int $areaCode = Values::INT_NONE, string $contains = Values::NONE, bool $smsEnabled = Values::BOOL_NONE, bool $mmsEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $excludeAllAddressRequired = Values::BOOL_NONE, bool $excludeLocalAddressRequired = Values::BOOL_NONE, bool $excludeForeignAddressRequired = Values::BOOL_NONE, bool $beta = Values::BOOL_NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::INT_NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::BOOL_NONE ): ReadMobileOptions { return new ReadMobileOptions( $areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled ); } } class ReadMobileOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ public function __construct( int $areaCode = Values::INT_NONE, string $contains = Values::NONE, bool $smsEnabled = Values::BOOL_NONE, bool $mmsEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $excludeAllAddressRequired = Values::BOOL_NONE, bool $excludeLocalAddressRequired = Values::BOOL_NONE, bool $excludeForeignAddressRequired = Values::BOOL_NONE, bool $beta = Values::BOOL_NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::INT_NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::BOOL_NONE ) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setAreaCode(int $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @return $this Fluent Builder */ public function setContains(string $contains): self { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmsEnabled(bool $smsEnabled): self { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMmsEnabled(bool $mmsEnabled): self { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearNumber(string $nearNumber): self { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearLatLong(string $nearLatLong): self { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setDistance(int $distance): self { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInPostalCode(string $inPostalCode): self { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRegion(string $inRegion): self { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRateCenter(string $inRateCenter): self { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInLata(string $inLata): self { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @return $this Fluent Builder */ public function setInLocality(string $inLocality): self { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setFaxEnabled(bool $faxEnabled): self { $this->options['faxEnabled'] = $faxEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadMobileOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineOptions.php 0000644 00000052765 15021223077 0025763 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class MachineToMachineOptions { /** * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return ReadMachineToMachineOptions Options builder */ public static function read( int $areaCode = Values::INT_NONE, string $contains = Values::NONE, bool $smsEnabled = Values::BOOL_NONE, bool $mmsEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $excludeAllAddressRequired = Values::BOOL_NONE, bool $excludeLocalAddressRequired = Values::BOOL_NONE, bool $excludeForeignAddressRequired = Values::BOOL_NONE, bool $beta = Values::BOOL_NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::INT_NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::BOOL_NONE ): ReadMachineToMachineOptions { return new ReadMachineToMachineOptions( $areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled ); } } class ReadMachineToMachineOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ public function __construct( int $areaCode = Values::INT_NONE, string $contains = Values::NONE, bool $smsEnabled = Values::BOOL_NONE, bool $mmsEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $excludeAllAddressRequired = Values::BOOL_NONE, bool $excludeLocalAddressRequired = Values::BOOL_NONE, bool $excludeForeignAddressRequired = Values::BOOL_NONE, bool $beta = Values::BOOL_NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::INT_NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::BOOL_NONE ) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setAreaCode(int $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @return $this Fluent Builder */ public function setContains(string $contains): self { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmsEnabled(bool $smsEnabled): self { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMmsEnabled(bool $mmsEnabled): self { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearNumber(string $nearNumber): self { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearLatLong(string $nearLatLong): self { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setDistance(int $distance): self { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInPostalCode(string $inPostalCode): self { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRegion(string $inRegion): self { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRateCenter(string $inRateCenter): self { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInLata(string $inLata): self { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @return $this Fluent Builder */ public function setInLocality(string $inLocality): self { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setFaxEnabled(bool $faxEnabled): self { $this->options['faxEnabled'] = $faxEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadMachineToMachineOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileInstance.php 0000644 00000007437 15021223077 0024143 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Base\PhoneNumberCapabilities; /** * @property string|null $friendlyName * @property string|null $phoneNumber * @property string|null $lata * @property string|null $locality * @property string|null $rateCenter * @property string|null $latitude * @property string|null $longitude * @property string|null $region * @property string|null $postalCode * @property string|null $isoCountry * @property string|null $addressRequirements * @property bool|null $beta * @property PhoneNumberCapabilities|null $capabilities */ class MobileInstance extends InstanceResource { /** * Initialize the MobileInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MobileInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalInstance.php 0000644 00000007434 15021223077 0023763 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Base\PhoneNumberCapabilities; /** * @property string|null $friendlyName * @property string|null $phoneNumber * @property string|null $lata * @property string|null $locality * @property string|null $rateCenter * @property string|null $latitude * @property string|null $longitude * @property string|null $region * @property string|null $postalCode * @property string|null $isoCountry * @property string|null $addressRequirements * @property bool|null $beta * @property PhoneNumberCapabilities|null $capabilities */ class LocalInstance extends InstanceResource { /** * Initialize the LocalInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.LocalInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipPage.php 0000644 00000003174 15021223077 0022753 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class VoipPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return VoipInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipInstance */ public function buildInstance(array $payload): VoipInstance { return new VoipInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.VoipPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalList.php 0000644 00000016157 15021223077 0023134 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class LocalList extends ListResource { /** * Construct the LocalList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. */ public function __construct( Version $version, string $accountSid, string $countryCode ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) .'/Local.json'; } /** * Reads LocalInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return LocalInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams LocalInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of LocalInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return LocalPage Page of LocalInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): LocalPage { $options = new Values($options); $params = Values::of([ 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new LocalPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of LocalInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return LocalPage Page of LocalInstance */ public function getPage(string $targetUrl): LocalPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new LocalPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.LocalList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostPage.php 0000644 00000003240 15021223077 0024067 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SharedCostPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SharedCostInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostInstance */ public function buildInstance(array $payload): SharedCostInstance { return new SharedCostInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.SharedCostPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalInstance.php 0000644 00000007445 15021223077 0024500 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Base\PhoneNumberCapabilities; /** * @property string|null $friendlyName * @property string|null $phoneNumber * @property string|null $lata * @property string|null $locality * @property string|null $rateCenter * @property string|null $latitude * @property string|null $longitude * @property string|null $region * @property string|null $postalCode * @property string|null $isoCountry * @property string|null $addressRequirements * @property bool|null $beta * @property PhoneNumberCapabilities|null $capabilities */ class NationalInstance extends InstanceResource { /** * Initialize the NationalInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NationalInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeOptions.php 0000644 00000052705 15021223077 0024335 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class TollFreeOptions { /** * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return ReadTollFreeOptions Options builder */ public static function read( int $areaCode = Values::INT_NONE, string $contains = Values::NONE, bool $smsEnabled = Values::BOOL_NONE, bool $mmsEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $excludeAllAddressRequired = Values::BOOL_NONE, bool $excludeLocalAddressRequired = Values::BOOL_NONE, bool $excludeForeignAddressRequired = Values::BOOL_NONE, bool $beta = Values::BOOL_NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::INT_NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::BOOL_NONE ): ReadTollFreeOptions { return new ReadTollFreeOptions( $areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled ); } } class ReadTollFreeOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ public function __construct( int $areaCode = Values::INT_NONE, string $contains = Values::NONE, bool $smsEnabled = Values::BOOL_NONE, bool $mmsEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $excludeAllAddressRequired = Values::BOOL_NONE, bool $excludeLocalAddressRequired = Values::BOOL_NONE, bool $excludeForeignAddressRequired = Values::BOOL_NONE, bool $beta = Values::BOOL_NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::INT_NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::BOOL_NONE ) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setAreaCode(int $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @return $this Fluent Builder */ public function setContains(string $contains): self { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmsEnabled(bool $smsEnabled): self { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMmsEnabled(bool $mmsEnabled): self { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearNumber(string $nearNumber): self { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearLatLong(string $nearLatLong): self { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setDistance(int $distance): self { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInPostalCode(string $inPostalCode): self { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRegion(string $inRegion): self { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRateCenter(string $inRateCenter): self { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInLata(string $inLata): self { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @return $this Fluent Builder */ public function setInLocality(string $inLocality): self { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setFaxEnabled(bool $faxEnabled): self { $this->options['faxEnabled'] = $faxEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadTollFreeOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipList.php 0000644 00000016136 15021223077 0023014 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class VoipList extends ListResource { /** * Construct the VoipList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. */ public function __construct( Version $version, string $accountSid, string $countryCode ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) .'/Voip.json'; } /** * Reads VoipInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return VoipInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams VoipInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of VoipInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return VoipPage Page of VoipInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): VoipPage { $options = new Values($options); $params = Values::of([ 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new VoipPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of VoipInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return VoipPage Page of VoipInstance */ public function getPage(string $targetUrl): VoipPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new VoipPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.VoipList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineInstance.php 0000644 00000007475 15021223077 0026072 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Base\PhoneNumberCapabilities; /** * @property string|null $friendlyName * @property string|null $phoneNumber * @property string|null $lata * @property string|null $locality * @property string|null $rateCenter * @property string|null $latitude * @property string|null $longitude * @property string|null $region * @property string|null $postalCode * @property string|null $isoCountry * @property string|null $addressRequirements * @property bool|null $beta * @property PhoneNumberCapabilities|null $capabilities */ class MachineToMachineInstance extends InstanceResource { /** * Initialize the MachineToMachineInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. */ public function __construct(Version $version, array $payload, string $accountSid, string $countryCode) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MachineToMachineInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalPage.php 0000644 00000003202 15021223077 0023060 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class LocalPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return LocalInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalInstance */ public function buildInstance(array $payload): LocalInstance { return new LocalInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.LocalPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipOptions.php 0000644 00000052655 15021223077 0023542 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class VoipOptions { /** * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return ReadVoipOptions Options builder */ public static function read( int $areaCode = Values::INT_NONE, string $contains = Values::NONE, bool $smsEnabled = Values::BOOL_NONE, bool $mmsEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $excludeAllAddressRequired = Values::BOOL_NONE, bool $excludeLocalAddressRequired = Values::BOOL_NONE, bool $excludeForeignAddressRequired = Values::BOOL_NONE, bool $beta = Values::BOOL_NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::INT_NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::BOOL_NONE ): ReadVoipOptions { return new ReadVoipOptions( $areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled ); } } class ReadVoipOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ public function __construct( int $areaCode = Values::INT_NONE, string $contains = Values::NONE, bool $smsEnabled = Values::BOOL_NONE, bool $mmsEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $excludeAllAddressRequired = Values::BOOL_NONE, bool $excludeLocalAddressRequired = Values::BOOL_NONE, bool $excludeForeignAddressRequired = Values::BOOL_NONE, bool $beta = Values::BOOL_NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::INT_NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::BOOL_NONE ) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setAreaCode(int $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @return $this Fluent Builder */ public function setContains(string $contains): self { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmsEnabled(bool $smsEnabled): self { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMmsEnabled(bool $mmsEnabled): self { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearNumber(string $nearNumber): self { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearLatLong(string $nearLatLong): self { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setDistance(int $distance): self { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInPostalCode(string $inPostalCode): self { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRegion(string $inRegion): self { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRateCenter(string $inRateCenter): self { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInLata(string $inLata): self { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @return $this Fluent Builder */ public function setInLocality(string $inLocality): self { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setFaxEnabled(bool $faxEnabled): self { $this->options['faxEnabled'] = $faxEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadVoipOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreePage.php 0000644 00000003224 15021223077 0023546 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TollFreePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TollFreeInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeInstance */ public function buildInstance(array $payload): TollFreeInstance { return new TollFreeInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TollFreePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalOptions.php 0000644 00000053307 15021223077 0023652 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class LocalOptions { /** * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-number-pattern) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-character-pattern). If specified, this value must have at least two characters. * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return ReadLocalOptions Options builder */ public static function read( int $areaCode = Values::INT_NONE, string $contains = Values::NONE, bool $smsEnabled = Values::BOOL_NONE, bool $mmsEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $excludeAllAddressRequired = Values::BOOL_NONE, bool $excludeLocalAddressRequired = Values::BOOL_NONE, bool $excludeForeignAddressRequired = Values::BOOL_NONE, bool $beta = Values::BOOL_NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::INT_NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::BOOL_NONE ): ReadLocalOptions { return new ReadLocalOptions( $areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled ); } } class ReadLocalOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-number-pattern) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-character-pattern). If specified, this value must have at least two characters. * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ public function __construct( int $areaCode = Values::INT_NONE, string $contains = Values::NONE, bool $smsEnabled = Values::BOOL_NONE, bool $mmsEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $excludeAllAddressRequired = Values::BOOL_NONE, bool $excludeLocalAddressRequired = Values::BOOL_NONE, bool $excludeForeignAddressRequired = Values::BOOL_NONE, bool $beta = Values::BOOL_NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::INT_NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::BOOL_NONE ) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setAreaCode(int $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-number-pattern) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-character-pattern). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-number-pattern) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-character-pattern). If specified, this value must have at least two characters. * @return $this Fluent Builder */ public function setContains(string $contains): self { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmsEnabled(bool $smsEnabled): self { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMmsEnabled(bool $mmsEnabled): self { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearNumber(string $nearNumber): self { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearLatLong(string $nearLatLong): self { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setDistance(int $distance): self { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInPostalCode(string $inPostalCode): self { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRegion(string $inRegion): self { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRateCenter(string $inRateCenter): self { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInLata(string $inLata): self { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @return $this Fluent Builder */ public function setInLocality(string $inLocality): self { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setFaxEnabled(bool $faxEnabled): self { $this->options['faxEnabled'] = $faxEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadLocalOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalOptions.php 0000644 00000052705 15021223077 0024366 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class NationalOptions { /** * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return ReadNationalOptions Options builder */ public static function read( int $areaCode = Values::INT_NONE, string $contains = Values::NONE, bool $smsEnabled = Values::BOOL_NONE, bool $mmsEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $excludeAllAddressRequired = Values::BOOL_NONE, bool $excludeLocalAddressRequired = Values::BOOL_NONE, bool $excludeForeignAddressRequired = Values::BOOL_NONE, bool $beta = Values::BOOL_NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::INT_NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::BOOL_NONE ): ReadNationalOptions { return new ReadNationalOptions( $areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled ); } } class ReadNationalOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. */ public function __construct( int $areaCode = Values::INT_NONE, string $contains = Values::NONE, bool $smsEnabled = Values::BOOL_NONE, bool $mmsEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $excludeAllAddressRequired = Values::BOOL_NONE, bool $excludeLocalAddressRequired = Values::BOOL_NONE, bool $excludeForeignAddressRequired = Values::BOOL_NONE, bool $beta = Values::BOOL_NONE, string $nearNumber = Values::NONE, string $nearLatLong = Values::NONE, int $distance = Values::INT_NONE, string $inPostalCode = Values::NONE, string $inRegion = Values::NONE, string $inRateCenter = Values::NONE, string $inLata = Values::NONE, string $inLocality = Values::NONE, bool $faxEnabled = Values::BOOL_NONE ) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setAreaCode(int $areaCode): self { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * @return $this Fluent Builder */ public function setContains(string $contains): self { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmsEnabled(bool $smsEnabled): self { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setMmsEnabled(bool $mmsEnabled): self { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearNumber(string $nearNumber): self { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setNearLatLong(string $nearLatLong): self { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setDistance(int $distance): self { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInPostalCode(string $inPostalCode): self { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRegion(string $inRegion): self { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInRateCenter(string $inRateCenter): self { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * @return $this Fluent Builder */ public function setInLata(string $inLata): self { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * @return $this Fluent Builder */ public function setInLocality(string $inLocality): self { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setFaxEnabled(bool $faxEnabled): self { $this->options['faxEnabled'] = $faxEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadNationalOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalPage.php 0000644 00000003224 15021223077 0023577 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NationalPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return NationalInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalInstance */ public function buildInstance(array $payload): NationalInstance { return new NationalInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NationalPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalList.php 0000644 00000016242 15021223077 0023642 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class NationalList extends ListResource { /** * Construct the NationalList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. */ public function __construct( Version $version, string $accountSid, string $countryCode ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) .'/National.json'; } /** * Reads NationalInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return NationalInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams NationalInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of NationalInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return NationalPage Page of NationalInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): NationalPage { $options = new Values($options); $params = Values::of([ 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new NationalPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of NationalInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return NationalPage Page of NationalInstance */ public function getPage(string $targetUrl): NationalPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new NationalPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NationalList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileList.php 0000644 00000016200 15021223077 0023276 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class MobileList extends ListResource { /** * Construct the MobileList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the AvailablePhoneNumber resources. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country from which to read phone numbers. */ public function __construct( Version $version, string $accountSid, string $countryCode ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) .'/Mobile.json'; } /** * Reads MobileInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MobileInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MobileInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MobileInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MobilePage Page of MobileInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MobilePage { $options = new Values($options); $params = Values::of([ 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MobilePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MobileInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MobilePage Page of MobileInstance */ public function getPage(string $targetUrl): MobilePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MobilePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MobileList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppOptions.php 0000644 00000020062 15021223077 0017233 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class ConnectAppOptions { /** * @param string $authorizeRedirectUrl The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App. * @param string $companyName The company name to set for the Connect App. * @param string $deauthorizeCallbackMethod The HTTP method to use when calling `deauthorize_callback_url`. * @param string $deauthorizeCallbackUrl The URL to call using the `deauthorize_callback_method` to de-authorize the Connect App. * @param string $description A description of the Connect App. * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $homepageUrl A public URL where users can obtain more information about this Connect App. * @param string $permissions A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. * @return UpdateConnectAppOptions Options builder */ public static function update( string $authorizeRedirectUrl = Values::NONE, string $companyName = Values::NONE, string $deauthorizeCallbackMethod = Values::NONE, string $deauthorizeCallbackUrl = Values::NONE, string $description = Values::NONE, string $friendlyName = Values::NONE, string $homepageUrl = Values::NONE, array $permissions = Values::ARRAY_NONE ): UpdateConnectAppOptions { return new UpdateConnectAppOptions( $authorizeRedirectUrl, $companyName, $deauthorizeCallbackMethod, $deauthorizeCallbackUrl, $description, $friendlyName, $homepageUrl, $permissions ); } } class UpdateConnectAppOptions extends Options { /** * @param string $authorizeRedirectUrl The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App. * @param string $companyName The company name to set for the Connect App. * @param string $deauthorizeCallbackMethod The HTTP method to use when calling `deauthorize_callback_url`. * @param string $deauthorizeCallbackUrl The URL to call using the `deauthorize_callback_method` to de-authorize the Connect App. * @param string $description A description of the Connect App. * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $homepageUrl A public URL where users can obtain more information about this Connect App. * @param string $permissions A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. */ public function __construct( string $authorizeRedirectUrl = Values::NONE, string $companyName = Values::NONE, string $deauthorizeCallbackMethod = Values::NONE, string $deauthorizeCallbackUrl = Values::NONE, string $description = Values::NONE, string $friendlyName = Values::NONE, string $homepageUrl = Values::NONE, array $permissions = Values::ARRAY_NONE ) { $this->options['authorizeRedirectUrl'] = $authorizeRedirectUrl; $this->options['companyName'] = $companyName; $this->options['deauthorizeCallbackMethod'] = $deauthorizeCallbackMethod; $this->options['deauthorizeCallbackUrl'] = $deauthorizeCallbackUrl; $this->options['description'] = $description; $this->options['friendlyName'] = $friendlyName; $this->options['homepageUrl'] = $homepageUrl; $this->options['permissions'] = $permissions; } /** * The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App. * * @param string $authorizeRedirectUrl The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App. * @return $this Fluent Builder */ public function setAuthorizeRedirectUrl(string $authorizeRedirectUrl): self { $this->options['authorizeRedirectUrl'] = $authorizeRedirectUrl; return $this; } /** * The company name to set for the Connect App. * * @param string $companyName The company name to set for the Connect App. * @return $this Fluent Builder */ public function setCompanyName(string $companyName): self { $this->options['companyName'] = $companyName; return $this; } /** * The HTTP method to use when calling `deauthorize_callback_url`. * * @param string $deauthorizeCallbackMethod The HTTP method to use when calling `deauthorize_callback_url`. * @return $this Fluent Builder */ public function setDeauthorizeCallbackMethod(string $deauthorizeCallbackMethod): self { $this->options['deauthorizeCallbackMethod'] = $deauthorizeCallbackMethod; return $this; } /** * The URL to call using the `deauthorize_callback_method` to de-authorize the Connect App. * * @param string $deauthorizeCallbackUrl The URL to call using the `deauthorize_callback_method` to de-authorize the Connect App. * @return $this Fluent Builder */ public function setDeauthorizeCallbackUrl(string $deauthorizeCallbackUrl): self { $this->options['deauthorizeCallbackUrl'] = $deauthorizeCallbackUrl; return $this; } /** * A description of the Connect App. * * @param string $description A description of the Connect App. * @return $this Fluent Builder */ public function setDescription(string $description): self { $this->options['description'] = $description; return $this; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A public URL where users can obtain more information about this Connect App. * * @param string $homepageUrl A public URL where users can obtain more information about this Connect App. * @return $this Fluent Builder */ public function setHomepageUrl(string $homepageUrl): self { $this->options['homepageUrl'] = $homepageUrl; return $this; } /** * A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. * * @param string $permissions A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. * @return $this Fluent Builder */ public function setPermissions(array $permissions): self { $this->options['permissions'] = $permissions; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateConnectAppOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdInstance.php 0000644 00000011444 15021223077 0020511 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string|null $accountSid * @property string|null $phoneNumber * @property string|null $uri */ class OutgoingCallerIdInstance extends InstanceResource { /** * Initialize the OutgoingCallerIdInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the OutgoingCallerId resources to delete. * @param string $sid The Twilio-provided string that uniquely identifies the OutgoingCallerId resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return OutgoingCallerIdContext Context for this OutgoingCallerIdInstance */ protected function proxy(): OutgoingCallerIdContext { if (!$this->context) { $this->context = new OutgoingCallerIdContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the OutgoingCallerIdInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the OutgoingCallerIdInstance * * @return OutgoingCallerIdInstance Fetched OutgoingCallerIdInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): OutgoingCallerIdInstance { return $this->proxy()->fetch(); } /** * Update the OutgoingCallerIdInstance * * @param array|Options $options Optional Arguments * @return OutgoingCallerIdInstance Updated OutgoingCallerIdInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): OutgoingCallerIdInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.OutgoingCallerIdInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationPage.php 0000644 00000003116 15021223077 0016666 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ApplicationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ApplicationInstance \Twilio\Rest\Api\V2010\Account\ApplicationInstance */ public function buildInstance(array $payload): ApplicationInstance { return new ApplicationInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ApplicationPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/QueueInstance.php 0000644 00000012005 15021223077 0016374 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Api\V2010\Account\Queue\MemberList; /** * @property \DateTime|null $dateUpdated * @property int|null $currentSize * @property string|null $friendlyName * @property string|null $uri * @property string|null $accountSid * @property int|null $averageWaitTime * @property string|null $sid * @property \DateTime|null $dateCreated * @property int|null $maxSize */ class QueueInstance extends InstanceResource { protected $_members; /** * Initialize the QueueInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $sid The Twilio-provided string that uniquely identifies the Queue resource to delete */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'currentSize' => Values::array_get($payload, 'current_size'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uri' => Values::array_get($payload, 'uri'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'averageWaitTime' => Values::array_get($payload, 'average_wait_time'), 'sid' => Values::array_get($payload, 'sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'maxSize' => Values::array_get($payload, 'max_size'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return QueueContext Context for this QueueInstance */ protected function proxy(): QueueContext { if (!$this->context) { $this->context = new QueueContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the QueueInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the QueueInstance * * @return QueueInstance Fetched QueueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): QueueInstance { return $this->proxy()->fetch(); } /** * Update the QueueInstance * * @param array|Options $options Optional Arguments * @return QueueInstance Updated QueueInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): QueueInstance { return $this->proxy()->update($options); } /** * Access the members */ protected function getMembers(): MemberList { return $this->proxy()->members; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.QueueInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyPage.php 0000644 00000003132 15021223077 0017142 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NewSigningKeyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return NewSigningKeyInstance \Twilio\Rest\Api\V2010\Account\NewSigningKeyInstance */ public function buildInstance(array $payload): NewSigningKeyInstance { return new NewSigningKeyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NewSigningKeyPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NotificationOptions.php 0000644 00000015553 15021223077 0017640 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class NotificationOptions { /** * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return ReadNotificationOptions Options builder */ public static function read( int $log = Values::INT_NONE, string $messageDateBefore = null, string $messageDate = null, string $messageDateAfter = null ): ReadNotificationOptions { return new ReadNotificationOptions( $log, $messageDateBefore, $messageDate, $messageDateAfter ); } } class ReadNotificationOptions extends Options { /** * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ public function __construct( int $log = Values::INT_NONE, string $messageDateBefore = null, string $messageDate = null, string $messageDateAfter = null ) { $this->options['log'] = $log; $this->options['messageDateBefore'] = $messageDateBefore; $this->options['messageDate'] = $messageDate; $this->options['messageDateAfter'] = $messageDateAfter; } /** * Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * @return $this Fluent Builder */ public function setLog(int $log): self { $this->options['log'] = $log; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return $this Fluent Builder */ public function setMessageDateBefore(string $messageDateBefore): self { $this->options['messageDateBefore'] = $messageDateBefore; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return $this Fluent Builder */ public function setMessageDate(string $messageDate): self { $this->options['messageDate'] = $messageDate; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return $this Fluent Builder */ public function setMessageDateAfter(string $messageDateAfter): self { $this->options['messageDateAfter'] = $messageDateAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadNotificationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/MessagePage.php 0000644 00000003066 15021223077 0016013 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MessageInstance \Twilio\Rest\Api\V2010\Account\MessageInstance */ public function buildInstance(array $payload): MessageInstance { return new MessageInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MessagePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyOptions.php 0000644 00000004224 15021223077 0017724 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class NewSigningKeyOptions { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return CreateNewSigningKeyOptions Options builder */ public static function create( string $friendlyName = Values::NONE ): CreateNewSigningKeyOptions { return new CreateNewSigningKeyOptions( $friendlyName ); } } class CreateNewSigningKeyOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateNewSigningKeyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceInstance.php 0000644 00000012760 15021223077 0017367 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Api\V2010\Account\Conference\ParticipantList; use Twilio\Rest\Api\V2010\Account\Conference\RecordingList; /** * @property string|null $accountSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $apiVersion * @property string|null $friendlyName * @property string|null $region * @property string|null $sid * @property string $status * @property string|null $uri * @property array|null $subresourceUris * @property string $reasonConferenceEnded * @property string|null $callSidEndingConference */ class ConferenceInstance extends InstanceResource { protected $_participants; protected $_recordings; /** * Initialize the ConferenceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Conference resource(s) to fetch. * @param string $sid The Twilio-provided string that uniquely identifies the Conference resource to fetch */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'apiVersion' => Values::array_get($payload, 'api_version'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'region' => Values::array_get($payload, 'region'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'uri' => Values::array_get($payload, 'uri'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'reasonConferenceEnded' => Values::array_get($payload, 'reason_conference_ended'), 'callSidEndingConference' => Values::array_get($payload, 'call_sid_ending_conference'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ConferenceContext Context for this ConferenceInstance */ protected function proxy(): ConferenceContext { if (!$this->context) { $this->context = new ConferenceContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the ConferenceInstance * * @return ConferenceInstance Fetched ConferenceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConferenceInstance { return $this->proxy()->fetch(); } /** * Update the ConferenceInstance * * @param array|Options $options Optional Arguments * @return ConferenceInstance Updated ConferenceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConferenceInstance { return $this->proxy()->update($options); } /** * Access the participants */ protected function getParticipants(): ParticipantList { return $this->proxy()->participants; } /** * Access the recordings */ protected function getRecordings(): RecordingList { return $this->proxy()->recordings; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ConferenceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/KeyPage.php 0000644 00000003036 15021223077 0015154 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class KeyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return KeyInstance \Twilio\Rest\Api\V2010\Account\KeyInstance */ public function buildInstance(array $payload): KeyInstance { return new KeyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.KeyPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/CallOptions.php 0000644 00000225005 15021223077 0016060 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class CallOptions { /** * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters. * @param string $applicationSid The SID of the Application resource that will handle the call, if the call will be handled by an application. * @param string $method The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * @param string[] $statusCallbackEvent The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. * @param string $statusCallbackMethod The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $sendDigits A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. * @param int $timeout The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. * @param bool $record Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. * @param string $recordingChannels The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. * @param string $recordingStatusCallback The URL that we call when the recording is available to be accessed. * @param string $recordingStatusCallbackMethod The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * @param string $sipAuthUsername The username used to authenticate the caller making a SIP call. * @param string $sipAuthPassword The password required to authenticate the user account specified in `sip_auth_username`. * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. * @param string[] $recordingStatusCallbackEvent The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. * @param string $trim Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. * @param string $callerId The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. * @param string $asyncAmd Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`. * @param string $asyncAmdStatusCallback The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. * @param string $asyncAmdStatusCallbackMethod The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. * @return CreateCallOptions Options builder */ public static function create( string $url = Values::NONE, string $twiml = Values::NONE, string $applicationSid = Values::NONE, string $method = Values::NONE, string $fallbackUrl = Values::NONE, string $fallbackMethod = Values::NONE, string $statusCallback = Values::NONE, array $statusCallbackEvent = Values::ARRAY_NONE, string $statusCallbackMethod = Values::NONE, string $sendDigits = Values::NONE, int $timeout = Values::INT_NONE, bool $record = Values::BOOL_NONE, string $recordingChannels = Values::NONE, string $recordingStatusCallback = Values::NONE, string $recordingStatusCallbackMethod = Values::NONE, string $sipAuthUsername = Values::NONE, string $sipAuthPassword = Values::NONE, string $machineDetection = Values::NONE, int $machineDetectionTimeout = Values::INT_NONE, array $recordingStatusCallbackEvent = Values::ARRAY_NONE, string $trim = Values::NONE, string $callerId = Values::NONE, int $machineDetectionSpeechThreshold = Values::INT_NONE, int $machineDetectionSpeechEndThreshold = Values::INT_NONE, int $machineDetectionSilenceTimeout = Values::INT_NONE, string $asyncAmd = Values::NONE, string $asyncAmdStatusCallback = Values::NONE, string $asyncAmdStatusCallbackMethod = Values::NONE, string $byoc = Values::NONE, string $callReason = Values::NONE, string $callToken = Values::NONE, string $recordingTrack = Values::NONE, int $timeLimit = Values::INT_NONE ): CreateCallOptions { return new CreateCallOptions( $url, $twiml, $applicationSid, $method, $fallbackUrl, $fallbackMethod, $statusCallback, $statusCallbackEvent, $statusCallbackMethod, $sendDigits, $timeout, $record, $recordingChannels, $recordingStatusCallback, $recordingStatusCallbackMethod, $sipAuthUsername, $sipAuthPassword, $machineDetection, $machineDetectionTimeout, $recordingStatusCallbackEvent, $trim, $callerId, $machineDetectionSpeechThreshold, $machineDetectionSpeechEndThreshold, $machineDetectionSilenceTimeout, $asyncAmd, $asyncAmdStatusCallback, $asyncAmdStatusCallbackMethod, $byoc, $callReason, $callToken, $recordingTrack, $timeLimit ); } /** * @param string $to Only show calls made to this phone number, SIP address, Client identifier or SIM SID. * @param string $from Only include calls from this phone number, SIP address, Client identifier or SIM SID. * @param string $parentCallSid Only include calls spawned by calls with this SID. * @param string $status The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. * @param string $startTimeBefore Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * @param string $startTime Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * @param string $startTimeAfter Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * @param string $endTimeBefore Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * @param string $endTime Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * @param string $endTimeAfter Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * @return ReadCallOptions Options builder */ public static function read( string $to = Values::NONE, string $from = Values::NONE, string $parentCallSid = Values::NONE, string $status = Values::NONE, string $startTimeBefore = null, string $startTime = null, string $startTimeAfter = null, string $endTimeBefore = null, string $endTime = null, string $endTimeAfter = null ): ReadCallOptions { return new ReadCallOptions( $to, $from, $parentCallSid, $status, $startTimeBefore, $startTime, $startTimeAfter, $endTimeBefore, $endTime, $endTimeAfter ); } /** * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * @param string $method The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $status * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * @param string $statusCallbackMethod The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. * @return UpdateCallOptions Options builder */ public static function update( string $url = Values::NONE, string $method = Values::NONE, string $status = Values::NONE, string $fallbackUrl = Values::NONE, string $fallbackMethod = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $twiml = Values::NONE, int $timeLimit = Values::INT_NONE ): UpdateCallOptions { return new UpdateCallOptions( $url, $method, $status, $fallbackUrl, $fallbackMethod, $statusCallback, $statusCallbackMethod, $twiml, $timeLimit ); } } class CreateCallOptions extends Options { /** * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters. * @param string $applicationSid The SID of the Application resource that will handle the call, if the call will be handled by an application. * @param string $method The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * @param string[] $statusCallbackEvent The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. * @param string $statusCallbackMethod The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $sendDigits A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. * @param int $timeout The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. * @param bool $record Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. * @param string $recordingChannels The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. * @param string $recordingStatusCallback The URL that we call when the recording is available to be accessed. * @param string $recordingStatusCallbackMethod The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * @param string $sipAuthUsername The username used to authenticate the caller making a SIP call. * @param string $sipAuthPassword The password required to authenticate the user account specified in `sip_auth_username`. * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. * @param string[] $recordingStatusCallbackEvent The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. * @param string $trim Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. * @param string $callerId The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. * @param string $asyncAmd Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`. * @param string $asyncAmdStatusCallback The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. * @param string $asyncAmdStatusCallbackMethod The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. */ public function __construct( string $url = Values::NONE, string $twiml = Values::NONE, string $applicationSid = Values::NONE, string $method = Values::NONE, string $fallbackUrl = Values::NONE, string $fallbackMethod = Values::NONE, string $statusCallback = Values::NONE, array $statusCallbackEvent = Values::ARRAY_NONE, string $statusCallbackMethod = Values::NONE, string $sendDigits = Values::NONE, int $timeout = Values::INT_NONE, bool $record = Values::BOOL_NONE, string $recordingChannels = Values::NONE, string $recordingStatusCallback = Values::NONE, string $recordingStatusCallbackMethod = Values::NONE, string $sipAuthUsername = Values::NONE, string $sipAuthPassword = Values::NONE, string $machineDetection = Values::NONE, int $machineDetectionTimeout = Values::INT_NONE, array $recordingStatusCallbackEvent = Values::ARRAY_NONE, string $trim = Values::NONE, string $callerId = Values::NONE, int $machineDetectionSpeechThreshold = Values::INT_NONE, int $machineDetectionSpeechEndThreshold = Values::INT_NONE, int $machineDetectionSilenceTimeout = Values::INT_NONE, string $asyncAmd = Values::NONE, string $asyncAmdStatusCallback = Values::NONE, string $asyncAmdStatusCallbackMethod = Values::NONE, string $byoc = Values::NONE, string $callReason = Values::NONE, string $callToken = Values::NONE, string $recordingTrack = Values::NONE, int $timeLimit = Values::INT_NONE ) { $this->options['url'] = $url; $this->options['twiml'] = $twiml; $this->options['applicationSid'] = $applicationSid; $this->options['method'] = $method; $this->options['fallbackUrl'] = $fallbackUrl; $this->options['fallbackMethod'] = $fallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackEvent'] = $statusCallbackEvent; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['sendDigits'] = $sendDigits; $this->options['timeout'] = $timeout; $this->options['record'] = $record; $this->options['recordingChannels'] = $recordingChannels; $this->options['recordingStatusCallback'] = $recordingStatusCallback; $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; $this->options['sipAuthUsername'] = $sipAuthUsername; $this->options['sipAuthPassword'] = $sipAuthPassword; $this->options['machineDetection'] = $machineDetection; $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; $this->options['trim'] = $trim; $this->options['callerId'] = $callerId; $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; $this->options['asyncAmd'] = $asyncAmd; $this->options['asyncAmdStatusCallback'] = $asyncAmdStatusCallback; $this->options['asyncAmdStatusCallbackMethod'] = $asyncAmdStatusCallbackMethod; $this->options['byoc'] = $byoc; $this->options['callReason'] = $callReason; $this->options['callToken'] = $callToken; $this->options['recordingTrack'] = $recordingTrack; $this->options['timeLimit'] = $timeLimit; } /** * The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * @return $this Fluent Builder */ public function setUrl(string $url): self { $this->options['url'] = $url; return $this; } /** * TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters. * * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters. * @return $this Fluent Builder */ public function setTwiml(string $twiml): self { $this->options['twiml'] = $twiml; return $this; } /** * The SID of the Application resource that will handle the call, if the call will be handled by an application. * * @param string $applicationSid The SID of the Application resource that will handle the call, if the call will be handled by an application. * @return $this Fluent Builder */ public function setApplicationSid(string $applicationSid): self { $this->options['applicationSid'] = $applicationSid; return $this; } /** * The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $method The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setMethod(string $method): self { $this->options['method'] = $method; return $this; } /** * The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setFallbackUrl(string $fallbackUrl): self { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setFallbackMethod(string $fallbackMethod): self { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. * * @param string[] $statusCallbackEvent The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. * @return $this Fluent Builder */ public function setStatusCallbackEvent(array $statusCallbackEvent): self { $this->options['statusCallbackEvent'] = $statusCallbackEvent; return $this; } /** * The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $statusCallbackMethod The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. * * @param string $sendDigits A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. * @return $this Fluent Builder */ public function setSendDigits(string $sendDigits): self { $this->options['sendDigits'] = $sendDigits; return $this; } /** * The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. * * @param int $timeout The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. * @return $this Fluent Builder */ public function setTimeout(int $timeout): self { $this->options['timeout'] = $timeout; return $this; } /** * Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. * * @param bool $record Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. * @return $this Fluent Builder */ public function setRecord(bool $record): self { $this->options['record'] = $record; return $this; } /** * The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. * * @param string $recordingChannels The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. * @return $this Fluent Builder */ public function setRecordingChannels(string $recordingChannels): self { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The URL that we call when the recording is available to be accessed. * * @param string $recordingStatusCallback The URL that we call when the recording is available to be accessed. * @return $this Fluent Builder */ public function setRecordingStatusCallback(string $recordingStatusCallback): self { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * * @param string $recordingStatusCallbackMethod The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * The username used to authenticate the caller making a SIP call. * * @param string $sipAuthUsername The username used to authenticate the caller making a SIP call. * @return $this Fluent Builder */ public function setSipAuthUsername(string $sipAuthUsername): self { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The password required to authenticate the user account specified in `sip_auth_username`. * * @param string $sipAuthPassword The password required to authenticate the user account specified in `sip_auth_username`. * @return $this Fluent Builder */ public function setSipAuthPassword(string $sipAuthPassword): self { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * @return $this Fluent Builder */ public function setMachineDetection(string $machineDetection): self { $this->options['machineDetection'] = $machineDetection; return $this; } /** * The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. * * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. * @return $this Fluent Builder */ public function setMachineDetectionTimeout(int $machineDetectionTimeout): self { $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; return $this; } /** * The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. * * @param string[] $recordingStatusCallbackEvent The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. * @return $this Fluent Builder */ public function setRecordingStatusCallbackEvent(array $recordingStatusCallbackEvent): self { $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; return $this; } /** * Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. * * @param string $trim Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. * @return $this Fluent Builder */ public function setTrim(string $trim): self { $this->options['trim'] = $trim; return $this; } /** * The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. * * @param string $callerId The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. * @return $this Fluent Builder */ public function setCallerId(string $callerId): self { $this->options['callerId'] = $callerId; return $this; } /** * The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. * * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. * @return $this Fluent Builder */ public function setMachineDetectionSpeechThreshold(int $machineDetectionSpeechThreshold): self { $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; return $this; } /** * The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. * * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. * @return $this Fluent Builder */ public function setMachineDetectionSpeechEndThreshold(int $machineDetectionSpeechEndThreshold): self { $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; return $this; } /** * The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. * * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. * @return $this Fluent Builder */ public function setMachineDetectionSilenceTimeout(int $machineDetectionSilenceTimeout): self { $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; return $this; } /** * Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`. * * @param string $asyncAmd Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setAsyncAmd(string $asyncAmd): self { $this->options['asyncAmd'] = $asyncAmd; return $this; } /** * The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. * * @param string $asyncAmdStatusCallback The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. * @return $this Fluent Builder */ public function setAsyncAmdStatusCallback(string $asyncAmdStatusCallback): self { $this->options['asyncAmdStatusCallback'] = $asyncAmdStatusCallback; return $this; } /** * The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * * @param string $asyncAmdStatusCallbackMethod The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setAsyncAmdStatusCallbackMethod(string $asyncAmdStatusCallbackMethod): self { $this->options['asyncAmdStatusCallbackMethod'] = $asyncAmdStatusCallbackMethod; return $this; } /** * The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) * * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) * @return $this Fluent Builder */ public function setByoc(string $byoc): self { $this->options['byoc'] = $byoc; return $this; } /** * The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) * * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) * @return $this Fluent Builder */ public function setCallReason(string $callReason): self { $this->options['callReason'] = $callReason; return $this; } /** * A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. * * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. * @return $this Fluent Builder */ public function setCallToken(string $callToken): self { $this->options['callToken'] = $callToken; return $this; } /** * The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. * * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. * @return $this Fluent Builder */ public function setRecordingTrack(string $recordingTrack): self { $this->options['recordingTrack'] = $recordingTrack; return $this; } /** * The maximum duration of the call in seconds. Constraints depend on account and configuration. * * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. * @return $this Fluent Builder */ public function setTimeLimit(int $timeLimit): self { $this->options['timeLimit'] = $timeLimit; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateCallOptions ' . $options . ']'; } } class ReadCallOptions extends Options { /** * @param string $to Only show calls made to this phone number, SIP address, Client identifier or SIM SID. * @param string $from Only include calls from this phone number, SIP address, Client identifier or SIM SID. * @param string $parentCallSid Only include calls spawned by calls with this SID. * @param string $status The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. * @param string $startTimeBefore Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * @param string $startTime Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * @param string $startTimeAfter Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * @param string $endTimeBefore Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * @param string $endTime Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * @param string $endTimeAfter Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. */ public function __construct( string $to = Values::NONE, string $from = Values::NONE, string $parentCallSid = Values::NONE, string $status = Values::NONE, string $startTimeBefore = null, string $startTime = null, string $startTimeAfter = null, string $endTimeBefore = null, string $endTime = null, string $endTimeAfter = null ) { $this->options['to'] = $to; $this->options['from'] = $from; $this->options['parentCallSid'] = $parentCallSid; $this->options['status'] = $status; $this->options['startTimeBefore'] = $startTimeBefore; $this->options['startTime'] = $startTime; $this->options['startTimeAfter'] = $startTimeAfter; $this->options['endTimeBefore'] = $endTimeBefore; $this->options['endTime'] = $endTime; $this->options['endTimeAfter'] = $endTimeAfter; } /** * Only show calls made to this phone number, SIP address, Client identifier or SIM SID. * * @param string $to Only show calls made to this phone number, SIP address, Client identifier or SIM SID. * @return $this Fluent Builder */ public function setTo(string $to): self { $this->options['to'] = $to; return $this; } /** * Only include calls from this phone number, SIP address, Client identifier or SIM SID. * * @param string $from Only include calls from this phone number, SIP address, Client identifier or SIM SID. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * Only include calls spawned by calls with this SID. * * @param string $parentCallSid Only include calls spawned by calls with this SID. * @return $this Fluent Builder */ public function setParentCallSid(string $parentCallSid): self { $this->options['parentCallSid'] = $parentCallSid; return $this; } /** * The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. * * @param string $status The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * * @param string $startTimeBefore Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * @return $this Fluent Builder */ public function setStartTimeBefore(string $startTimeBefore): self { $this->options['startTimeBefore'] = $startTimeBefore; return $this; } /** * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * * @param string $startTime Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * @return $this Fluent Builder */ public function setStartTime(string $startTime): self { $this->options['startTime'] = $startTime; return $this; } /** * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * * @param string $startTimeAfter Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * @return $this Fluent Builder */ public function setStartTimeAfter(string $startTimeAfter): self { $this->options['startTimeAfter'] = $startTimeAfter; return $this; } /** * Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * * @param string $endTimeBefore Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * @return $this Fluent Builder */ public function setEndTimeBefore(string $endTimeBefore): self { $this->options['endTimeBefore'] = $endTimeBefore; return $this; } /** * Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * * @param string $endTime Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * @return $this Fluent Builder */ public function setEndTime(string $endTime): self { $this->options['endTime'] = $endTime; return $this; } /** * Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * * @param string $endTimeAfter Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * @return $this Fluent Builder */ public function setEndTimeAfter(string $endTimeAfter): self { $this->options['endTimeAfter'] = $endTimeAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadCallOptions ' . $options . ']'; } } class UpdateCallOptions extends Options { /** * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * @param string $method The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $status * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * @param string $statusCallbackMethod The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. */ public function __construct( string $url = Values::NONE, string $method = Values::NONE, string $status = Values::NONE, string $fallbackUrl = Values::NONE, string $fallbackMethod = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $twiml = Values::NONE, int $timeLimit = Values::INT_NONE ) { $this->options['url'] = $url; $this->options['method'] = $method; $this->options['status'] = $status; $this->options['fallbackUrl'] = $fallbackUrl; $this->options['fallbackMethod'] = $fallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['twiml'] = $twiml; $this->options['timeLimit'] = $timeLimit; } /** * The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * @return $this Fluent Builder */ public function setUrl(string $url): self { $this->options['url'] = $url; return $this; } /** * The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $method The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setMethod(string $method): self { $this->options['method'] = $method; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setFallbackUrl(string $fallbackUrl): self { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setFallbackMethod(string $fallbackMethod): self { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $statusCallbackMethod The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive * * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive * @return $this Fluent Builder */ public function setTwiml(string $twiml): self { $this->options['twiml'] = $twiml; return $this; } /** * The maximum duration of the call in seconds. Constraints depend on account and configuration. * * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. * @return $this Fluent Builder */ public function setTimeLimit(int $timeLimit): self { $this->options['timeLimit'] = $timeLimit; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateCallOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/QueuePage.php 0000644 00000003052 15021223077 0015506 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class QueuePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return QueueInstance \Twilio\Rest\Api\V2010\Account\QueueInstance */ public function buildInstance(array $payload): QueueInstance { return new QueueInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.QueuePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyList.php 0000644 00000004263 15021223077 0015670 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class NewKeyList extends ListResource { /** * Construct the NewKeyList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will be responsible for the new Key resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Keys.json'; } /** * Create the NewKeyInstance * * @param array|Options $options Optional Arguments * @return NewKeyInstance Created NewKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): NewKeyInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new NewKeyInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NewKeyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyPage.php 0000644 00000003110 15021223077 0016464 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SigningKeyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SigningKeyInstance \Twilio\Rest\Api\V2010\Account\SigningKeyInstance */ public function buildInstance(array $payload): SigningKeyInstance { return new SigningKeyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.SigningKeyPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/UsagePage.php 0000644 00000003052 15021223077 0015466 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UsagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UsageInstance \Twilio\Rest\Api\V2010\Account\UsageInstance */ public function buildInstance(array $payload): UsageInstance { return new UsageInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.UsagePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeContext.php 0000644 00000006635 15021223077 0017076 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class ShortCodeContext extends InstanceContext { /** * Initialize the ShortCodeContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ShortCode resource(s) to fetch. * @param string $sid The Twilio-provided string that uniquely identifies the ShortCode resource to fetch */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/SMS/ShortCodes/' . \rawurlencode($sid) .'.json'; } /** * Fetch the ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ShortCodeInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ShortCodeInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the ShortCodeInstance * * @param array|Options $options Optional Arguments * @return ShortCodeInstance Updated ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ShortCodeInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'ApiVersion' => $options['apiVersion'], 'SmsUrl' => $options['smsUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ShortCodeInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ShortCodeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppContext.php 0000644 00000007627 15021223077 0017240 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class ConnectAppContext extends InstanceContext { /** * Initialize the ConnectAppContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ConnectApp resource to fetch. * @param string $sid The Twilio-provided string that uniquely identifies the ConnectApp resource to fetch. */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/ConnectApps/' . \rawurlencode($sid) .'.json'; } /** * Delete the ConnectAppInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ConnectAppInstance * * @return ConnectAppInstance Fetched ConnectAppInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConnectAppInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConnectAppInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the ConnectAppInstance * * @param array|Options $options Optional Arguments * @return ConnectAppInstance Updated ConnectAppInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConnectAppInstance { $options = new Values($options); $data = Values::of([ 'AuthorizeRedirectUrl' => $options['authorizeRedirectUrl'], 'CompanyName' => $options['companyName'], 'DeauthorizeCallbackMethod' => $options['deauthorizeCallbackMethod'], 'DeauthorizeCallbackUrl' => $options['deauthorizeCallbackUrl'], 'Description' => $options['description'], 'FriendlyName' => $options['friendlyName'], 'HomepageUrl' => $options['homepageUrl'], 'Permissions' => $options['permissions'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ConnectAppInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ConnectAppContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberInstance.php 0000644 00000011000 15021223077 0017575 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $callSid * @property \DateTime|null $dateEnqueued * @property int|null $position * @property string|null $uri * @property int|null $waitTime * @property string|null $queueSid */ class MemberInstance extends InstanceResource { /** * Initialize the MemberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Member resource(s) to fetch. * @param string $queueSid The SID of the Queue in which to find the members to fetch. * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resource(s) to fetch. */ public function __construct(Version $version, array $payload, string $accountSid, string $queueSid, string $callSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'callSid' => Values::array_get($payload, 'call_sid'), 'dateEnqueued' => Deserialize::dateTime(Values::array_get($payload, 'date_enqueued')), 'position' => Values::array_get($payload, 'position'), 'uri' => Values::array_get($payload, 'uri'), 'waitTime' => Values::array_get($payload, 'wait_time'), 'queueSid' => Values::array_get($payload, 'queue_sid'), ]; $this->solution = ['accountSid' => $accountSid, 'queueSid' => $queueSid, 'callSid' => $callSid ?: $this->properties['callSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MemberContext Context for this MemberInstance */ protected function proxy(): MemberContext { if (!$this->context) { $this->context = new MemberContext( $this->version, $this->solution['accountSid'], $this->solution['queueSid'], $this->solution['callSid'] ); } return $this->context; } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { return $this->proxy()->fetch(); } /** * Update the MemberInstance * * @param string $url The absolute URL of the Queue resource. * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $url, array $options = []): MemberInstance { return $this->proxy()->update($url, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.MemberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberContext.php 0000644 00000006705 15021223077 0017475 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class MemberContext extends InstanceContext { /** * Initialize the MemberContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Member resource(s) to fetch. * @param string $queueSid The SID of the Queue in which to find the members to fetch. * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resource(s) to fetch. */ public function __construct( Version $version, $accountSid, $queueSid, $callSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'queueSid' => $queueSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Queues/' . \rawurlencode($queueSid) .'/Members/' . \rawurlencode($callSid) .'.json'; } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new MemberInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['queueSid'], $this->solution['callSid'] ); } /** * Update the MemberInstance * * @param string $url The absolute URL of the Queue resource. * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $url, array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'Url' => $url, 'Method' => $options['method'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new MemberInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['queueSid'], $this->solution['callSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.MemberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberOptions.php 0000644 00000004540 15021223077 0017477 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $method How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters. * @return UpdateMemberOptions Options builder */ public static function update( string $method = Values::NONE ): UpdateMemberOptions { return new UpdateMemberOptions( $method ); } } class UpdateMemberOptions extends Options { /** * @param string $method How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters. */ public function __construct( string $method = Values::NONE ) { $this->options['method'] = $method; } /** * How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters. * * @param string $method How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters. * @return $this Fluent Builder */ public function setMethod(string $method): self { $this->options['method'] = $method; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateMemberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberPage.php 0000644 00000003131 15021223077 0016713 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MemberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MemberInstance \Twilio\Rest\Api\V2010\Account\Queue\MemberInstance */ public function buildInstance(array $payload): MemberInstance { return new MemberInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['queueSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MemberPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberList.php 0000644 00000013276 15021223077 0016765 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MemberList extends ListResource { /** * Construct the MemberList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Member resource(s) to fetch. * @param string $queueSid The SID of the Queue in which to find the members to fetch. */ public function __construct( Version $version, string $accountSid, string $queueSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'queueSid' => $queueSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Queues/' . \rawurlencode($queueSid) .'/Members.json'; } /** * Reads MemberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MemberInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MemberPage Page of MemberInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MemberPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MemberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MemberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MemberPage Page of MemberInstance */ public function getPage(string $targetUrl): MemberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MemberPage($this->version, $response, $this->solution); } /** * Constructs a MemberContext * * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resource(s) to fetch. */ public function getContext( string $callSid ): MemberContext { return new MemberContext( $this->version, $this->solution['accountSid'], $this->solution['queueSid'], $callSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MemberList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TokenOptions.php 0000644 00000004032 15021223077 0016260 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class TokenOptions { /** * @param int $ttl The duration in seconds for which the generated credentials are valid. The default value is 86400 (24 hours). * @return CreateTokenOptions Options builder */ public static function create( int $ttl = Values::INT_NONE ): CreateTokenOptions { return new CreateTokenOptions( $ttl ); } } class CreateTokenOptions extends Options { /** * @param int $ttl The duration in seconds for which the generated credentials are valid. The default value is 86400 (24 hours). */ public function __construct( int $ttl = Values::INT_NONE ) { $this->options['ttl'] = $ttl; } /** * The duration in seconds for which the generated credentials are valid. The default value is 86400 (24 hours). * * @param int $ttl The duration in seconds for which the generated credentials are valid. The default value is 86400 (24 hours). * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateTokenOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/CallInstance.php 0000644 00000021051 15021223077 0016164 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Api\V2010\Account\Call\RecordingList; use Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageSubscriptionList; use Twilio\Rest\Api\V2010\Account\Call\EventList; use Twilio\Rest\Api\V2010\Account\Call\NotificationList; use Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageList; use Twilio\Rest\Api\V2010\Account\Call\SiprecList; use Twilio\Rest\Api\V2010\Account\Call\StreamList; use Twilio\Rest\Api\V2010\Account\Call\PaymentList; /** * @property string|null $sid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $parentCallSid * @property string|null $accountSid * @property string|null $to * @property string|null $toFormatted * @property string|null $from * @property string|null $fromFormatted * @property string|null $phoneNumberSid * @property string $status * @property \DateTime|null $startTime * @property \DateTime|null $endTime * @property string|null $duration * @property string|null $price * @property string|null $priceUnit * @property string|null $direction * @property string|null $answeredBy * @property string|null $apiVersion * @property string|null $forwardedFrom * @property string|null $groupSid * @property string|null $callerName * @property string|null $queueTime * @property string|null $trunkSid * @property string|null $uri * @property array|null $subresourceUris */ class CallInstance extends InstanceResource { protected $_recordings; protected $_userDefinedMessageSubscriptions; protected $_events; protected $_notifications; protected $_userDefinedMessages; protected $_siprec; protected $_streams; protected $_payments; /** * Initialize the CallInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $sid The Twilio-provided Call SID that uniquely identifies the Call resource to delete */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'parentCallSid' => Values::array_get($payload, 'parent_call_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'to' => Values::array_get($payload, 'to'), 'toFormatted' => Values::array_get($payload, 'to_formatted'), 'from' => Values::array_get($payload, 'from'), 'fromFormatted' => Values::array_get($payload, 'from_formatted'), 'phoneNumberSid' => Values::array_get($payload, 'phone_number_sid'), 'status' => Values::array_get($payload, 'status'), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'duration' => Values::array_get($payload, 'duration'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'direction' => Values::array_get($payload, 'direction'), 'answeredBy' => Values::array_get($payload, 'answered_by'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'forwardedFrom' => Values::array_get($payload, 'forwarded_from'), 'groupSid' => Values::array_get($payload, 'group_sid'), 'callerName' => Values::array_get($payload, 'caller_name'), 'queueTime' => Values::array_get($payload, 'queue_time'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'uri' => Values::array_get($payload, 'uri'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CallContext Context for this CallInstance */ protected function proxy(): CallContext { if (!$this->context) { $this->context = new CallContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the CallInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CallInstance * * @return CallInstance Fetched CallInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CallInstance { return $this->proxy()->fetch(); } /** * Update the CallInstance * * @param array|Options $options Optional Arguments * @return CallInstance Updated CallInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CallInstance { return $this->proxy()->update($options); } /** * Access the recordings */ protected function getRecordings(): RecordingList { return $this->proxy()->recordings; } /** * Access the userDefinedMessageSubscriptions */ protected function getUserDefinedMessageSubscriptions(): UserDefinedMessageSubscriptionList { return $this->proxy()->userDefinedMessageSubscriptions; } /** * Access the events */ protected function getEvents(): EventList { return $this->proxy()->events; } /** * Access the notifications */ protected function getNotifications(): NotificationList { return $this->proxy()->notifications; } /** * Access the userDefinedMessages */ protected function getUserDefinedMessages(): UserDefinedMessageList { return $this->proxy()->userDefinedMessages; } /** * Access the siprec */ protected function getSiprec(): SiprecList { return $this->proxy()->siprec; } /** * Access the streams */ protected function getStreams(): StreamList { return $this->proxy()->streams; } /** * Access the payments */ protected function getPayments(): PaymentList { return $this->proxy()->payments; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CallInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NotificationList.php 0000644 00000014226 15021223077 0017114 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class NotificationList extends ListResource { /** * Construct the NotificationList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Notification resource to fetch. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Notifications.json'; } /** * Reads NotificationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return NotificationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams NotificationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of NotificationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return NotificationPage Page of NotificationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): NotificationPage { $options = new Values($options); $params = Values::of([ 'Log' => $options['log'], 'MessageDate<' => Serialize::iso8601Date($options['messageDateBefore']), 'MessageDate' => Serialize::iso8601Date($options['messageDate']), 'MessageDate>' => Serialize::iso8601Date($options['messageDateAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new NotificationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of NotificationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return NotificationPage Page of NotificationInstance */ public function getPage(string $targetUrl): NotificationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new NotificationPage($this->version, $response, $this->solution); } /** * Constructs a NotificationContext * * @param string $sid The Twilio-provided string that uniquely identifies the Notification resource to fetch. */ public function getContext( string $sid ): NotificationContext { return new NotificationContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NotificationList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/KeyContext.php 0000644 00000006365 15021223077 0015734 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class KeyContext extends InstanceContext { /** * Initialize the KeyContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Key resources to delete. * @param string $sid The Twilio-provided string that uniquely identifies the Key resource to delete. */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Keys/' . \rawurlencode($sid) .'.json'; } /** * Delete the KeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the KeyInstance * * @return KeyInstance Fetched KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): KeyInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new KeyInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Updated KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): KeyInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new KeyInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.KeyContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestOptions.php 0000644 00000014316 15021223077 0020651 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class ValidationRequestOptions { /** * @param string $friendlyName A descriptive string that you create to describe the new caller ID resource. It can be up to 64 characters long. The default value is a formatted version of the phone number. * @param int $callDelay The number of seconds to delay before initiating the verification call. Can be an integer between `0` and `60`, inclusive. The default is `0`. * @param string $extension The digits to dial after connecting the verification call. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information about the verification process to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`, and the default is `POST`. * @return CreateValidationRequestOptions Options builder */ public static function create( string $friendlyName = Values::NONE, int $callDelay = Values::INT_NONE, string $extension = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE ): CreateValidationRequestOptions { return new CreateValidationRequestOptions( $friendlyName, $callDelay, $extension, $statusCallback, $statusCallbackMethod ); } } class CreateValidationRequestOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the new caller ID resource. It can be up to 64 characters long. The default value is a formatted version of the phone number. * @param int $callDelay The number of seconds to delay before initiating the verification call. Can be an integer between `0` and `60`, inclusive. The default is `0`. * @param string $extension The digits to dial after connecting the verification call. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information about the verification process to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`, and the default is `POST`. */ public function __construct( string $friendlyName = Values::NONE, int $callDelay = Values::INT_NONE, string $extension = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['callDelay'] = $callDelay; $this->options['extension'] = $extension; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; } /** * A descriptive string that you create to describe the new caller ID resource. It can be up to 64 characters long. The default value is a formatted version of the phone number. * * @param string $friendlyName A descriptive string that you create to describe the new caller ID resource. It can be up to 64 characters long. The default value is a formatted version of the phone number. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The number of seconds to delay before initiating the verification call. Can be an integer between `0` and `60`, inclusive. The default is `0`. * * @param int $callDelay The number of seconds to delay before initiating the verification call. Can be an integer between `0` and `60`, inclusive. The default is `0`. * @return $this Fluent Builder */ public function setCallDelay(int $callDelay): self { $this->options['callDelay'] = $callDelay; return $this; } /** * The digits to dial after connecting the verification call. * * @param string $extension The digits to dial after connecting the verification call. * @return $this Fluent Builder */ public function setExtension(string $extension): self { $this->options['extension'] = $extension; return $this; } /** * The URL we should call using the `status_callback_method` to send status information about the verification process to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information about the verification process to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`, and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`, and the default is `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateValidationRequestOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/MessageOptions.php 0000644 00000131600 15021223077 0016566 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $from The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. * @param string $body The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). * @param string[] $mediaUrl The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. * @param string $contentSid For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). * @param string $statusCallback The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). * @param string $applicationSid The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. Note that the `status_callback` parameter of a request takes priority over the `application_sid` parameter; if both are included `application_sid` is ignored. * @param string $maxPrice [DEPRECATED] This parameter will no longer have any effect as of 2024-06-03. * @param bool $provideFeedback Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. * @param int $attempt Total number of attempts made (including this request) to send the message regardless of the provider used * @param int $validityPeriod The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `14400`. Default value is `14400`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) * @param bool $forceDelivery Reserved * @param string $contentRetention * @param string $addressRetention * @param bool $smartEncoded Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. * @param string[] $persistentAction Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). * @param bool $shortenUrls For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. * @param string $scheduleType * @param \DateTime $sendAt The time that Twilio will send the message. Must be in ISO 8601 format. * @param bool $sendAsMms If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. * @param string $contentVariables For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. * @param string $riskCheck * @return CreateMessageOptions Options builder */ public static function create( string $from = Values::NONE, string $messagingServiceSid = Values::NONE, string $body = Values::NONE, array $mediaUrl = Values::ARRAY_NONE, string $contentSid = Values::NONE, string $statusCallback = Values::NONE, string $applicationSid = Values::NONE, string $maxPrice = Values::NONE, bool $provideFeedback = Values::BOOL_NONE, int $attempt = Values::INT_NONE, int $validityPeriod = Values::INT_NONE, bool $forceDelivery = Values::BOOL_NONE, string $contentRetention = Values::NONE, string $addressRetention = Values::NONE, bool $smartEncoded = Values::BOOL_NONE, array $persistentAction = Values::ARRAY_NONE, bool $shortenUrls = Values::BOOL_NONE, string $scheduleType = Values::NONE, \DateTime $sendAt = null, bool $sendAsMms = Values::BOOL_NONE, string $contentVariables = Values::NONE, string $riskCheck = Values::NONE ): CreateMessageOptions { return new CreateMessageOptions( $from, $messagingServiceSid, $body, $mediaUrl, $contentSid, $statusCallback, $applicationSid, $maxPrice, $provideFeedback, $attempt, $validityPeriod, $forceDelivery, $contentRetention, $addressRetention, $smartEncoded, $persistentAction, $shortenUrls, $scheduleType, $sendAt, $sendAsMms, $contentVariables, $riskCheck ); } /** * @param string $to Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` * @param string $from Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` * @param string $dateSentBefore Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @param string $dateSent Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @param string $dateSentAfter Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @return ReadMessageOptions Options builder */ public static function read( string $to = Values::NONE, string $from = Values::NONE, string $dateSentBefore = null, string $dateSent = null, string $dateSentAfter = null ): ReadMessageOptions { return new ReadMessageOptions( $to, $from, $dateSentBefore, $dateSent, $dateSentAfter ); } /** * @param string $body The new `body` of the Message resource. To redact the text content of a Message, this parameter's value must be an empty string * @param string $status * @return UpdateMessageOptions Options builder */ public static function update( string $body = Values::NONE, string $status = Values::NONE ): UpdateMessageOptions { return new UpdateMessageOptions( $body, $status ); } } class CreateMessageOptions extends Options { /** * @param string $from The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. * @param string $body The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). * @param string[] $mediaUrl The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. * @param string $contentSid For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). * @param string $statusCallback The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). * @param string $applicationSid The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. Note that the `status_callback` parameter of a request takes priority over the `application_sid` parameter; if both are included `application_sid` is ignored. * @param string $maxPrice [DEPRECATED] This parameter will no longer have any effect as of 2024-06-03. * @param bool $provideFeedback Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. * @param int $attempt Total number of attempts made (including this request) to send the message regardless of the provider used * @param int $validityPeriod The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `14400`. Default value is `14400`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) * @param bool $forceDelivery Reserved * @param string $contentRetention * @param string $addressRetention * @param bool $smartEncoded Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. * @param string[] $persistentAction Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). * @param bool $shortenUrls For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. * @param string $scheduleType * @param \DateTime $sendAt The time that Twilio will send the message. Must be in ISO 8601 format. * @param bool $sendAsMms If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. * @param string $contentVariables For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. * @param string $riskCheck */ public function __construct( string $from = Values::NONE, string $messagingServiceSid = Values::NONE, string $body = Values::NONE, array $mediaUrl = Values::ARRAY_NONE, string $contentSid = Values::NONE, string $statusCallback = Values::NONE, string $applicationSid = Values::NONE, string $maxPrice = Values::NONE, bool $provideFeedback = Values::BOOL_NONE, int $attempt = Values::INT_NONE, int $validityPeriod = Values::INT_NONE, bool $forceDelivery = Values::BOOL_NONE, string $contentRetention = Values::NONE, string $addressRetention = Values::NONE, bool $smartEncoded = Values::BOOL_NONE, array $persistentAction = Values::ARRAY_NONE, bool $shortenUrls = Values::BOOL_NONE, string $scheduleType = Values::NONE, \DateTime $sendAt = null, bool $sendAsMms = Values::BOOL_NONE, string $contentVariables = Values::NONE, string $riskCheck = Values::NONE ) { $this->options['from'] = $from; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['body'] = $body; $this->options['mediaUrl'] = $mediaUrl; $this->options['contentSid'] = $contentSid; $this->options['statusCallback'] = $statusCallback; $this->options['applicationSid'] = $applicationSid; $this->options['maxPrice'] = $maxPrice; $this->options['provideFeedback'] = $provideFeedback; $this->options['attempt'] = $attempt; $this->options['validityPeriod'] = $validityPeriod; $this->options['forceDelivery'] = $forceDelivery; $this->options['contentRetention'] = $contentRetention; $this->options['addressRetention'] = $addressRetention; $this->options['smartEncoded'] = $smartEncoded; $this->options['persistentAction'] = $persistentAction; $this->options['shortenUrls'] = $shortenUrls; $this->options['scheduleType'] = $scheduleType; $this->options['sendAt'] = $sendAt; $this->options['sendAsMms'] = $sendAsMms; $this->options['contentVariables'] = $contentVariables; $this->options['riskCheck'] = $riskCheck; } /** * The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. * * @param string $from The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. * * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). * * @param string $body The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. * * @param string[] $mediaUrl The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. * @return $this Fluent Builder */ public function setMediaUrl(array $mediaUrl): self { $this->options['mediaUrl'] = $mediaUrl; return $this; } /** * For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). * * @param string $contentSid For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). * @return $this Fluent Builder */ public function setContentSid(string $contentSid): self { $this->options['contentSid'] = $contentSid; return $this; } /** * The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). * * @param string $statusCallback The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. Note that the `status_callback` parameter of a request takes priority over the `application_sid` parameter; if both are included `application_sid` is ignored. * * @param string $applicationSid The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. Note that the `status_callback` parameter of a request takes priority over the `application_sid` parameter; if both are included `application_sid` is ignored. * @return $this Fluent Builder */ public function setApplicationSid(string $applicationSid): self { $this->options['applicationSid'] = $applicationSid; return $this; } /** * [DEPRECATED] This parameter will no longer have any effect as of 2024-06-03. * * @param string $maxPrice [DEPRECATED] This parameter will no longer have any effect as of 2024-06-03. * @return $this Fluent Builder */ public function setMaxPrice(string $maxPrice): self { $this->options['maxPrice'] = $maxPrice; return $this; } /** * Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. * * @param bool $provideFeedback Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. * @return $this Fluent Builder */ public function setProvideFeedback(bool $provideFeedback): self { $this->options['provideFeedback'] = $provideFeedback; return $this; } /** * Total number of attempts made (including this request) to send the message regardless of the provider used * * @param int $attempt Total number of attempts made (including this request) to send the message regardless of the provider used * @return $this Fluent Builder */ public function setAttempt(int $attempt): self { $this->options['attempt'] = $attempt; return $this; } /** * The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `14400`. Default value is `14400`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) * * @param int $validityPeriod The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `14400`. Default value is `14400`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) * @return $this Fluent Builder */ public function setValidityPeriod(int $validityPeriod): self { $this->options['validityPeriod'] = $validityPeriod; return $this; } /** * Reserved * * @param bool $forceDelivery Reserved * @return $this Fluent Builder */ public function setForceDelivery(bool $forceDelivery): self { $this->options['forceDelivery'] = $forceDelivery; return $this; } /** * @param string $contentRetention * @return $this Fluent Builder */ public function setContentRetention(string $contentRetention): self { $this->options['contentRetention'] = $contentRetention; return $this; } /** * @param string $addressRetention * @return $this Fluent Builder */ public function setAddressRetention(string $addressRetention): self { $this->options['addressRetention'] = $addressRetention; return $this; } /** * Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. * * @param bool $smartEncoded Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setSmartEncoded(bool $smartEncoded): self { $this->options['smartEncoded'] = $smartEncoded; return $this; } /** * Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). * * @param string[] $persistentAction Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). * @return $this Fluent Builder */ public function setPersistentAction(array $persistentAction): self { $this->options['persistentAction'] = $persistentAction; return $this; } /** * For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. * * @param bool $shortenUrls For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. * @return $this Fluent Builder */ public function setShortenUrls(bool $shortenUrls): self { $this->options['shortenUrls'] = $shortenUrls; return $this; } /** * @param string $scheduleType * @return $this Fluent Builder */ public function setScheduleType(string $scheduleType): self { $this->options['scheduleType'] = $scheduleType; return $this; } /** * The time that Twilio will send the message. Must be in ISO 8601 format. * * @param \DateTime $sendAt The time that Twilio will send the message. Must be in ISO 8601 format. * @return $this Fluent Builder */ public function setSendAt(\DateTime $sendAt): self { $this->options['sendAt'] = $sendAt; return $this; } /** * If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. * * @param bool $sendAsMms If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. * @return $this Fluent Builder */ public function setSendAsMms(bool $sendAsMms): self { $this->options['sendAsMms'] = $sendAsMms; return $this; } /** * For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. * * @param string $contentVariables For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. * @return $this Fluent Builder */ public function setContentVariables(string $contentVariables): self { $this->options['contentVariables'] = $contentVariables; return $this; } /** * @param string $riskCheck * @return $this Fluent Builder */ public function setRiskCheck(string $riskCheck): self { $this->options['riskCheck'] = $riskCheck; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateMessageOptions ' . $options . ']'; } } class ReadMessageOptions extends Options { /** * @param string $to Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` * @param string $from Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` * @param string $dateSentBefore Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @param string $dateSent Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @param string $dateSentAfter Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). */ public function __construct( string $to = Values::NONE, string $from = Values::NONE, string $dateSentBefore = null, string $dateSent = null, string $dateSentAfter = null ) { $this->options['to'] = $to; $this->options['from'] = $from; $this->options['dateSentBefore'] = $dateSentBefore; $this->options['dateSent'] = $dateSent; $this->options['dateSentAfter'] = $dateSentAfter; } /** * Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` * * @param string $to Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` * @return $this Fluent Builder */ public function setTo(string $to): self { $this->options['to'] = $to; return $this; } /** * Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` * * @param string $from Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * * @param string $dateSentBefore Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @return $this Fluent Builder */ public function setDateSentBefore(string $dateSentBefore): self { $this->options['dateSentBefore'] = $dateSentBefore; return $this; } /** * Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * * @param string $dateSent Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @return $this Fluent Builder */ public function setDateSent(string $dateSent): self { $this->options['dateSent'] = $dateSent; return $this; } /** * Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * * @param string $dateSentAfter Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). * @return $this Fluent Builder */ public function setDateSentAfter(string $dateSentAfter): self { $this->options['dateSentAfter'] = $dateSentAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadMessageOptions ' . $options . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $body The new `body` of the Message resource. To redact the text content of a Message, this parameter's value must be an empty string * @param string $status */ public function __construct( string $body = Values::NONE, string $status = Values::NONE ) { $this->options['body'] = $body; $this->options['status'] = $status; } /** * The new `body` of the Message resource. To redact the text content of a Message, this parameter's value must be an empty string * * @param string $body The new `body` of the Message resource. To redact the text content of a Message, this parameter's value must be an empty string * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateMessageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberList.php 0000644 00000026157 15021223077 0020402 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\TollFreeList; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\LocalList; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\MobileList; /** * @property TollFreeList $tollFree * @property LocalList $local * @property MobileList $mobile */ class IncomingPhoneNumberList extends ListResource { protected $_tollFree = null; protected $_local = null; protected $_mobile = null; /** * Construct the IncomingPhoneNumberList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers.json'; } /** * Create the IncomingPhoneNumberInstance * * @param array|Options $options Optional Arguments * @return IncomingPhoneNumberInstance Created IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): IncomingPhoneNumberInstance { $options = new Values($options); $data = Values::of([ 'ApiVersion' => $options['apiVersion'], 'FriendlyName' => $options['friendlyName'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceApplicationSid' => $options['voiceApplicationSid'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'EmergencyStatus' => $options['emergencyStatus'], 'EmergencyAddressSid' => $options['emergencyAddressSid'], 'TrunkSid' => $options['trunkSid'], 'IdentitySid' => $options['identitySid'], 'AddressSid' => $options['addressSid'], 'VoiceReceiveMode' => $options['voiceReceiveMode'], 'BundleSid' => $options['bundleSid'], 'PhoneNumber' => $options['phoneNumber'], 'AreaCode' => $options['areaCode'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IncomingPhoneNumberInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads IncomingPhoneNumberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IncomingPhoneNumberInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams IncomingPhoneNumberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of IncomingPhoneNumberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return IncomingPhoneNumberPage Page of IncomingPhoneNumberInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): IncomingPhoneNumberPage { $options = new Values($options); $params = Values::of([ 'Beta' => Serialize::booleanToString($options['beta']), 'FriendlyName' => $options['friendlyName'], 'PhoneNumber' => $options['phoneNumber'], 'Origin' => $options['origin'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new IncomingPhoneNumberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IncomingPhoneNumberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return IncomingPhoneNumberPage Page of IncomingPhoneNumberInstance */ public function getPage(string $targetUrl): IncomingPhoneNumberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IncomingPhoneNumberPage($this->version, $response, $this->solution); } /** * Constructs a IncomingPhoneNumberContext * * @param string $sid The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to delete. */ public function getContext( string $sid ): IncomingPhoneNumberContext { return new IncomingPhoneNumberContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Access the tollFree */ protected function getTollFree(): TollFreeList { if (!$this->_tollFree) { $this->_tollFree = new TollFreeList( $this->version, $this->solution['accountSid'] ); } return $this->_tollFree; } /** * Access the local */ protected function getLocal(): LocalList { if (!$this->_local) { $this->_local = new LocalList( $this->version, $this->solution['accountSid'] ); } return $this->_local; } /** * Access the mobile */ protected function getMobile(): MobileList { if (!$this->_mobile) { $this->_mobile = new MobileList( $this->version, $this->solution['accountSid'] ); } return $this->_mobile; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.IncomingPhoneNumberList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceOptions.php 0000644 00000036415 15021223077 0017261 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class ConferenceOptions { /** * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * @param string $dateUpdatedBefore The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * @param string $dateUpdated The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * @param string $dateUpdatedAfter The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * @param string $friendlyName The string that identifies the Conference resources to read. * @param string $status The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. * @return ReadConferenceOptions Options builder */ public static function read( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null, string $dateUpdatedBefore = null, string $dateUpdated = null, string $dateUpdatedAfter = null, string $friendlyName = Values::NONE, string $status = Values::NONE ): ReadConferenceOptions { return new ReadConferenceOptions( $dateCreatedBefore, $dateCreated, $dateCreatedAfter, $dateUpdatedBefore, $dateUpdated, $dateUpdatedAfter, $friendlyName, $status ); } /** * @param string $status * @param string $announceUrl The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. * @param string $announceMethod The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` * @return UpdateConferenceOptions Options builder */ public static function update( string $status = Values::NONE, string $announceUrl = Values::NONE, string $announceMethod = Values::NONE ): UpdateConferenceOptions { return new UpdateConferenceOptions( $status, $announceUrl, $announceMethod ); } } class ReadConferenceOptions extends Options { /** * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * @param string $dateUpdatedBefore The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * @param string $dateUpdated The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * @param string $dateUpdatedAfter The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * @param string $friendlyName The string that identifies the Conference resources to read. * @param string $status The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. */ public function __construct( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null, string $dateUpdatedBefore = null, string $dateUpdated = null, string $dateUpdatedAfter = null, string $friendlyName = Values::NONE, string $status = Values::NONE ) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateUpdatedBefore'] = $dateUpdatedBefore; $this->options['dateUpdated'] = $dateUpdated; $this->options['dateUpdatedAfter'] = $dateUpdatedAfter; $this->options['friendlyName'] = $friendlyName; $this->options['status'] = $status; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * @return $this Fluent Builder */ public function setDateCreatedBefore(string $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * @return $this Fluent Builder */ public function setDateCreated(string $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * @return $this Fluent Builder */ public function setDateCreatedAfter(string $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * * @param string $dateUpdatedBefore The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * @return $this Fluent Builder */ public function setDateUpdatedBefore(string $dateUpdatedBefore): self { $this->options['dateUpdatedBefore'] = $dateUpdatedBefore; return $this; } /** * The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * * @param string $dateUpdated The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * @return $this Fluent Builder */ public function setDateUpdated(string $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * * @param string $dateUpdatedAfter The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * @return $this Fluent Builder */ public function setDateUpdatedAfter(string $dateUpdatedAfter): self { $this->options['dateUpdatedAfter'] = $dateUpdatedAfter; return $this; } /** * The string that identifies the Conference resources to read. * * @param string $friendlyName The string that identifies the Conference resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. * * @param string $status The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadConferenceOptions ' . $options . ']'; } } class UpdateConferenceOptions extends Options { /** * @param string $status * @param string $announceUrl The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. * @param string $announceMethod The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` */ public function __construct( string $status = Values::NONE, string $announceUrl = Values::NONE, string $announceMethod = Values::NONE ) { $this->options['status'] = $status; $this->options['announceUrl'] = $announceUrl; $this->options['announceMethod'] = $announceMethod; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. * * @param string $announceUrl The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains `<Play>`, `<Say>`, `<Pause>`, or `<Redirect>` verbs. * @return $this Fluent Builder */ public function setAnnounceUrl(string $announceUrl): self { $this->options['announceUrl'] = $announceUrl; return $this; } /** * The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` * * @param string $announceMethod The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` * @return $this Fluent Builder */ public function setAnnounceMethod(string $announceMethod): self { $this->options['announceMethod'] = $announceMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateConferenceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/BalancePage.php 0000644 00000003066 15021223077 0015754 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BalancePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return BalanceInstance \Twilio\Rest\Api\V2010\Account\BalanceInstance */ public function buildInstance(array $payload): BalanceInstance { return new BalanceInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.BalancePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NotificationPage.php 0000644 00000003124 15021223077 0017050 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NotificationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return NotificationInstance \Twilio\Rest\Api\V2010\Account\NotificationInstance */ public function buildInstance(array $payload): NotificationInstance { return new NotificationInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NotificationPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodePage.php 0000644 00000003102 15021223077 0016310 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ShortCodePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ShortCodeInstance \Twilio\Rest\Api\V2010\Account\ShortCodeInstance */ public function buildInstance(array $payload): ShortCodeInstance { return new ShortCodeInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ShortCodePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamInstance.php 0000644 00000010304 15021223077 0017416 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $callSid * @property string|null $name * @property string $status * @property \DateTime|null $dateUpdated * @property string|null $uri */ class StreamInstance extends InstanceResource { /** * Initialize the StreamInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Stream resource. * @param string $callSid The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Stream resource is associated with. * @param string $sid The SID of the Stream resource, or the `name` used when creating the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'callSid' => Values::array_get($payload, 'call_sid'), 'name' => Values::array_get($payload, 'name'), 'status' => Values::array_get($payload, 'status'), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return StreamContext Context for this StreamInstance */ protected function proxy(): StreamContext { if (!$this->context) { $this->context = new StreamContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the StreamInstance * * @param string $status * @return StreamInstance Updated StreamInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): StreamInstance { return $this->proxy()->update($status); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.StreamInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingOptions.php 0000644 00000044053 15021223077 0017776 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class RecordingOptions { /** * @param string[] $recordingStatusCallbackEvent The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space. * @param string $recordingStatusCallback The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback). * @param string $recordingStatusCallbackMethod The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`. * @param string $trim Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not. * @param string $recordingChannels The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels. * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. * @return CreateRecordingOptions Options builder */ public static function create( array $recordingStatusCallbackEvent = Values::ARRAY_NONE, string $recordingStatusCallback = Values::NONE, string $recordingStatusCallbackMethod = Values::NONE, string $trim = Values::NONE, string $recordingChannels = Values::NONE, string $recordingTrack = Values::NONE ): CreateRecordingOptions { return new CreateRecordingOptions( $recordingStatusCallbackEvent, $recordingStatusCallback, $recordingStatusCallbackMethod, $trim, $recordingChannels, $recordingTrack ); } /** * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return ReadRecordingOptions Options builder */ public static function read( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null ): ReadRecordingOptions { return new ReadRecordingOptions( $dateCreatedBefore, $dateCreated, $dateCreatedAfter ); } /** * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. * @return UpdateRecordingOptions Options builder */ public static function update( string $pauseBehavior = Values::NONE ): UpdateRecordingOptions { return new UpdateRecordingOptions( $pauseBehavior ); } } class CreateRecordingOptions extends Options { /** * @param string[] $recordingStatusCallbackEvent The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space. * @param string $recordingStatusCallback The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback). * @param string $recordingStatusCallbackMethod The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`. * @param string $trim Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not. * @param string $recordingChannels The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels. * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. */ public function __construct( array $recordingStatusCallbackEvent = Values::ARRAY_NONE, string $recordingStatusCallback = Values::NONE, string $recordingStatusCallbackMethod = Values::NONE, string $trim = Values::NONE, string $recordingChannels = Values::NONE, string $recordingTrack = Values::NONE ) { $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; $this->options['recordingStatusCallback'] = $recordingStatusCallback; $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; $this->options['trim'] = $trim; $this->options['recordingChannels'] = $recordingChannels; $this->options['recordingTrack'] = $recordingTrack; } /** * The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space. * * @param string[] $recordingStatusCallbackEvent The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space. * @return $this Fluent Builder */ public function setRecordingStatusCallbackEvent(array $recordingStatusCallbackEvent): self { $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; return $this; } /** * The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback). * * @param string $recordingStatusCallback The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback). * @return $this Fluent Builder */ public function setRecordingStatusCallback(string $recordingStatusCallback): self { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $recordingStatusCallbackMethod The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`. * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not. * * @param string $trim Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not. * @return $this Fluent Builder */ public function setTrim(string $trim): self { $this->options['trim'] = $trim; return $this; } /** * The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels. * * @param string $recordingChannels The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels. * @return $this Fluent Builder */ public function setRecordingChannels(string $recordingChannels): self { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. * * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. * @return $this Fluent Builder */ public function setRecordingTrack(string $recordingTrack): self { $this->options['recordingTrack'] = $recordingTrack; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateRecordingOptions ' . $options . ']'; } } class ReadRecordingOptions extends Options { /** * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. */ public function __construct( string $dateCreatedBefore = null, string $dateCreated = null, string $dateCreatedAfter = null ) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return $this Fluent Builder */ public function setDateCreatedBefore(string $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return $this Fluent Builder */ public function setDateCreated(string $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * @return $this Fluent Builder */ public function setDateCreatedAfter(string $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadRecordingOptions ' . $options . ']'; } } class UpdateRecordingOptions extends Options { /** * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. */ public function __construct( string $pauseBehavior = Values::NONE ) { $this->options['pauseBehavior'] = $pauseBehavior; } /** * Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. * * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. * @return $this Fluent Builder */ public function setPauseBehavior(string $pauseBehavior): self { $this->options['pauseBehavior'] = $pauseBehavior; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateRecordingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecContext.php 0000644 00000005330 15021223077 0017273 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class SiprecContext extends InstanceContext { /** * Initialize the SiprecContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Siprec resource. * @param string $callSid The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Siprec resource is associated with. * @param string $sid The SID of the Siprec resource, or the `name` used when creating the resource */ public function __construct( Version $version, $accountSid, $callSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Siprec/' . \rawurlencode($sid) .'.json'; } /** * Update the SiprecInstance * * @param string $status * @return SiprecInstance Updated SiprecInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): SiprecInstance { $data = Values::of([ 'Status' => $status, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SiprecInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.SiprecContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentPage.php 0000644 00000003134 15021223077 0016713 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PaymentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return PaymentInstance \Twilio\Rest\Api\V2010\Account\Call\PaymentInstance */ public function buildInstance(array $payload): PaymentInstance { return new PaymentInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.PaymentPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessagePage.php 0000644 00000003236 15021223077 0021003 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserDefinedMessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserDefinedMessageInstance \Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageInstance */ public function buildInstance(array $payload): UserDefinedMessageInstance { return new UserDefinedMessageInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.UserDefinedMessagePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingPage.php 0000644 00000003150 15021223077 0017210 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RecordingInstance \Twilio\Rest\Api\V2010\Account\Call\RecordingInstance */ public function buildInstance(array $payload): RecordingInstance { return new RecordingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.RecordingPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamList.php 0000644 00000045303 15021223077 0016574 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class StreamList extends ListResource { /** * Construct the StreamList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Stream resource. * @param string $callSid The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Stream resource is associated with. */ public function __construct( Version $version, string $accountSid, string $callSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Streams.json'; } /** * Create the StreamInstance * * @param string $url Relative or absolute url where WebSocket connection will be established. * @param array|Options $options Optional Arguments * @return StreamInstance Created StreamInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $url, array $options = []): StreamInstance { $options = new Values($options); $data = Values::of([ 'Url' => $url, 'Name' => $options['name'], 'Track' => $options['track'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'Parameter1.Name' => $options['parameter1Name'], 'Parameter1.Value' => $options['parameter1Value'], 'Parameter2.Name' => $options['parameter2Name'], 'Parameter2.Value' => $options['parameter2Value'], 'Parameter3.Name' => $options['parameter3Name'], 'Parameter3.Value' => $options['parameter3Value'], 'Parameter4.Name' => $options['parameter4Name'], 'Parameter4.Value' => $options['parameter4Value'], 'Parameter5.Name' => $options['parameter5Name'], 'Parameter5.Value' => $options['parameter5Value'], 'Parameter6.Name' => $options['parameter6Name'], 'Parameter6.Value' => $options['parameter6Value'], 'Parameter7.Name' => $options['parameter7Name'], 'Parameter7.Value' => $options['parameter7Value'], 'Parameter8.Name' => $options['parameter8Name'], 'Parameter8.Value' => $options['parameter8Value'], 'Parameter9.Name' => $options['parameter9Name'], 'Parameter9.Value' => $options['parameter9Value'], 'Parameter10.Name' => $options['parameter10Name'], 'Parameter10.Value' => $options['parameter10Value'], 'Parameter11.Name' => $options['parameter11Name'], 'Parameter11.Value' => $options['parameter11Value'], 'Parameter12.Name' => $options['parameter12Name'], 'Parameter12.Value' => $options['parameter12Value'], 'Parameter13.Name' => $options['parameter13Name'], 'Parameter13.Value' => $options['parameter13Value'], 'Parameter14.Name' => $options['parameter14Name'], 'Parameter14.Value' => $options['parameter14Value'], 'Parameter15.Name' => $options['parameter15Name'], 'Parameter15.Value' => $options['parameter15Value'], 'Parameter16.Name' => $options['parameter16Name'], 'Parameter16.Value' => $options['parameter16Value'], 'Parameter17.Name' => $options['parameter17Name'], 'Parameter17.Value' => $options['parameter17Value'], 'Parameter18.Name' => $options['parameter18Name'], 'Parameter18.Value' => $options['parameter18Value'], 'Parameter19.Name' => $options['parameter19Name'], 'Parameter19.Value' => $options['parameter19Value'], 'Parameter20.Name' => $options['parameter20Name'], 'Parameter20.Value' => $options['parameter20Value'], 'Parameter21.Name' => $options['parameter21Name'], 'Parameter21.Value' => $options['parameter21Value'], 'Parameter22.Name' => $options['parameter22Name'], 'Parameter22.Value' => $options['parameter22Value'], 'Parameter23.Name' => $options['parameter23Name'], 'Parameter23.Value' => $options['parameter23Value'], 'Parameter24.Name' => $options['parameter24Name'], 'Parameter24.Value' => $options['parameter24Value'], 'Parameter25.Name' => $options['parameter25Name'], 'Parameter25.Value' => $options['parameter25Value'], 'Parameter26.Name' => $options['parameter26Name'], 'Parameter26.Value' => $options['parameter26Value'], 'Parameter27.Name' => $options['parameter27Name'], 'Parameter27.Value' => $options['parameter27Value'], 'Parameter28.Name' => $options['parameter28Name'], 'Parameter28.Value' => $options['parameter28Value'], 'Parameter29.Name' => $options['parameter29Name'], 'Parameter29.Value' => $options['parameter29Value'], 'Parameter30.Name' => $options['parameter30Name'], 'Parameter30.Value' => $options['parameter30Value'], 'Parameter31.Name' => $options['parameter31Name'], 'Parameter31.Value' => $options['parameter31Value'], 'Parameter32.Name' => $options['parameter32Name'], 'Parameter32.Value' => $options['parameter32Value'], 'Parameter33.Name' => $options['parameter33Name'], 'Parameter33.Value' => $options['parameter33Value'], 'Parameter34.Name' => $options['parameter34Name'], 'Parameter34.Value' => $options['parameter34Value'], 'Parameter35.Name' => $options['parameter35Name'], 'Parameter35.Value' => $options['parameter35Value'], 'Parameter36.Name' => $options['parameter36Name'], 'Parameter36.Value' => $options['parameter36Value'], 'Parameter37.Name' => $options['parameter37Name'], 'Parameter37.Value' => $options['parameter37Value'], 'Parameter38.Name' => $options['parameter38Name'], 'Parameter38.Value' => $options['parameter38Value'], 'Parameter39.Name' => $options['parameter39Name'], 'Parameter39.Value' => $options['parameter39Value'], 'Parameter40.Name' => $options['parameter40Name'], 'Parameter40.Value' => $options['parameter40Value'], 'Parameter41.Name' => $options['parameter41Name'], 'Parameter41.Value' => $options['parameter41Value'], 'Parameter42.Name' => $options['parameter42Name'], 'Parameter42.Value' => $options['parameter42Value'], 'Parameter43.Name' => $options['parameter43Name'], 'Parameter43.Value' => $options['parameter43Value'], 'Parameter44.Name' => $options['parameter44Name'], 'Parameter44.Value' => $options['parameter44Value'], 'Parameter45.Name' => $options['parameter45Name'], 'Parameter45.Value' => $options['parameter45Value'], 'Parameter46.Name' => $options['parameter46Name'], 'Parameter46.Value' => $options['parameter46Value'], 'Parameter47.Name' => $options['parameter47Name'], 'Parameter47.Value' => $options['parameter47Value'], 'Parameter48.Name' => $options['parameter48Name'], 'Parameter48.Value' => $options['parameter48Value'], 'Parameter49.Name' => $options['parameter49Name'], 'Parameter49.Value' => $options['parameter49Value'], 'Parameter50.Name' => $options['parameter50Name'], 'Parameter50.Value' => $options['parameter50Value'], 'Parameter51.Name' => $options['parameter51Name'], 'Parameter51.Value' => $options['parameter51Value'], 'Parameter52.Name' => $options['parameter52Name'], 'Parameter52.Value' => $options['parameter52Value'], 'Parameter53.Name' => $options['parameter53Name'], 'Parameter53.Value' => $options['parameter53Value'], 'Parameter54.Name' => $options['parameter54Name'], 'Parameter54.Value' => $options['parameter54Value'], 'Parameter55.Name' => $options['parameter55Name'], 'Parameter55.Value' => $options['parameter55Value'], 'Parameter56.Name' => $options['parameter56Name'], 'Parameter56.Value' => $options['parameter56Value'], 'Parameter57.Name' => $options['parameter57Name'], 'Parameter57.Value' => $options['parameter57Value'], 'Parameter58.Name' => $options['parameter58Name'], 'Parameter58.Value' => $options['parameter58Value'], 'Parameter59.Name' => $options['parameter59Name'], 'Parameter59.Value' => $options['parameter59Value'], 'Parameter60.Name' => $options['parameter60Name'], 'Parameter60.Value' => $options['parameter60Value'], 'Parameter61.Name' => $options['parameter61Name'], 'Parameter61.Value' => $options['parameter61Value'], 'Parameter62.Name' => $options['parameter62Name'], 'Parameter62.Value' => $options['parameter62Value'], 'Parameter63.Name' => $options['parameter63Name'], 'Parameter63.Value' => $options['parameter63Value'], 'Parameter64.Name' => $options['parameter64Name'], 'Parameter64.Value' => $options['parameter64Value'], 'Parameter65.Name' => $options['parameter65Name'], 'Parameter65.Value' => $options['parameter65Value'], 'Parameter66.Name' => $options['parameter66Name'], 'Parameter66.Value' => $options['parameter66Value'], 'Parameter67.Name' => $options['parameter67Name'], 'Parameter67.Value' => $options['parameter67Value'], 'Parameter68.Name' => $options['parameter68Name'], 'Parameter68.Value' => $options['parameter68Value'], 'Parameter69.Name' => $options['parameter69Name'], 'Parameter69.Value' => $options['parameter69Value'], 'Parameter70.Name' => $options['parameter70Name'], 'Parameter70.Value' => $options['parameter70Value'], 'Parameter71.Name' => $options['parameter71Name'], 'Parameter71.Value' => $options['parameter71Value'], 'Parameter72.Name' => $options['parameter72Name'], 'Parameter72.Value' => $options['parameter72Value'], 'Parameter73.Name' => $options['parameter73Name'], 'Parameter73.Value' => $options['parameter73Value'], 'Parameter74.Name' => $options['parameter74Name'], 'Parameter74.Value' => $options['parameter74Value'], 'Parameter75.Name' => $options['parameter75Name'], 'Parameter75.Value' => $options['parameter75Value'], 'Parameter76.Name' => $options['parameter76Name'], 'Parameter76.Value' => $options['parameter76Value'], 'Parameter77.Name' => $options['parameter77Name'], 'Parameter77.Value' => $options['parameter77Value'], 'Parameter78.Name' => $options['parameter78Name'], 'Parameter78.Value' => $options['parameter78Value'], 'Parameter79.Name' => $options['parameter79Name'], 'Parameter79.Value' => $options['parameter79Value'], 'Parameter80.Name' => $options['parameter80Name'], 'Parameter80.Value' => $options['parameter80Value'], 'Parameter81.Name' => $options['parameter81Name'], 'Parameter81.Value' => $options['parameter81Value'], 'Parameter82.Name' => $options['parameter82Name'], 'Parameter82.Value' => $options['parameter82Value'], 'Parameter83.Name' => $options['parameter83Name'], 'Parameter83.Value' => $options['parameter83Value'], 'Parameter84.Name' => $options['parameter84Name'], 'Parameter84.Value' => $options['parameter84Value'], 'Parameter85.Name' => $options['parameter85Name'], 'Parameter85.Value' => $options['parameter85Value'], 'Parameter86.Name' => $options['parameter86Name'], 'Parameter86.Value' => $options['parameter86Value'], 'Parameter87.Name' => $options['parameter87Name'], 'Parameter87.Value' => $options['parameter87Value'], 'Parameter88.Name' => $options['parameter88Name'], 'Parameter88.Value' => $options['parameter88Value'], 'Parameter89.Name' => $options['parameter89Name'], 'Parameter89.Value' => $options['parameter89Value'], 'Parameter90.Name' => $options['parameter90Name'], 'Parameter90.Value' => $options['parameter90Value'], 'Parameter91.Name' => $options['parameter91Name'], 'Parameter91.Value' => $options['parameter91Value'], 'Parameter92.Name' => $options['parameter92Name'], 'Parameter92.Value' => $options['parameter92Value'], 'Parameter93.Name' => $options['parameter93Name'], 'Parameter93.Value' => $options['parameter93Value'], 'Parameter94.Name' => $options['parameter94Name'], 'Parameter94.Value' => $options['parameter94Value'], 'Parameter95.Name' => $options['parameter95Name'], 'Parameter95.Value' => $options['parameter95Value'], 'Parameter96.Name' => $options['parameter96Name'], 'Parameter96.Value' => $options['parameter96Value'], 'Parameter97.Name' => $options['parameter97Name'], 'Parameter97.Value' => $options['parameter97Value'], 'Parameter98.Name' => $options['parameter98Name'], 'Parameter98.Value' => $options['parameter98Value'], 'Parameter99.Name' => $options['parameter99Name'], 'Parameter99.Value' => $options['parameter99Value'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new StreamInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Constructs a StreamContext * * @param string $sid The SID of the Stream resource, or the `name` used when creating the resource */ public function getContext( string $sid ): StreamContext { return new StreamContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.StreamList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentContext.php 0000644 00000007231 15021223077 0017465 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class PaymentContext extends InstanceContext { /** * Initialize the PaymentContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $callSid The SID of the call that will create the resource. Call leg associated with this sid is expected to provide payment information thru DTMF. * @param string $sid The SID of Payments session that needs to be updated. */ public function __construct( Version $version, $accountSid, $callSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Payments/' . \rawurlencode($sid) .'.json'; } /** * Update the PaymentInstance * * @param string $idempotencyKey A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated. * @param string $statusCallback Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [Update](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-update) and [Complete/Cancel](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-cancelcomplete) POST requests. * @param array|Options $options Optional Arguments * @return PaymentInstance Updated PaymentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $idempotencyKey, string $statusCallback, array $options = []): PaymentInstance { $options = new Values($options); $data = Values::of([ 'IdempotencyKey' => $idempotencyKey, 'StatusCallback' => $statusCallback, 'Capture' => $options['capture'], 'Status' => $options['status'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new PaymentInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.PaymentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionList.php 0000644 00000007122 15021223077 0023445 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class UserDefinedMessageSubscriptionList extends ListResource { /** * Construct the UserDefinedMessageSubscriptionList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that subscribed to the User Defined Messages. * @param string $callSid The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User Defined Messages subscription is associated with. This refers to the Call SID that is producing the user defined messages. */ public function __construct( Version $version, string $accountSid, string $callSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/UserDefinedMessageSubscriptions.json'; } /** * Create the UserDefinedMessageSubscriptionInstance * * @param string $callback The URL we should call using the `method` to send user defined events to your application. URLs must contain a valid hostname (underscores are not permitted). * @param array|Options $options Optional Arguments * @return UserDefinedMessageSubscriptionInstance Created UserDefinedMessageSubscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $callback, array $options = []): UserDefinedMessageSubscriptionInstance { $options = new Values($options); $data = Values::of([ 'Callback' => $callback, 'IdempotencyKey' => $options['idempotencyKey'], 'Method' => $options['method'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new UserDefinedMessageSubscriptionInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Constructs a UserDefinedMessageSubscriptionContext * * @param string $sid The SID that uniquely identifies this User Defined Message Subscription. */ public function getContext( string $sid ): UserDefinedMessageSubscriptionContext { return new UserDefinedMessageSubscriptionContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.UserDefinedMessageSubscriptionList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentInstance.php 0000644 00000011566 15021223077 0017613 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $callSid * @property string|null $sid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $uri */ class PaymentInstance extends InstanceResource { /** * Initialize the PaymentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $callSid The SID of the call that will create the resource. Call leg associated with this sid is expected to provide payment information thru DTMF. * @param string $sid The SID of Payments session that needs to be updated. */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'callSid' => Values::array_get($payload, 'call_sid'), 'sid' => Values::array_get($payload, 'sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PaymentContext Context for this PaymentInstance */ protected function proxy(): PaymentContext { if (!$this->context) { $this->context = new PaymentContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the PaymentInstance * * @param string $idempotencyKey A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated. * @param string $statusCallback Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [Update](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-update) and [Complete/Cancel](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-cancelcomplete) POST requests. * @param array|Options $options Optional Arguments * @return PaymentInstance Updated PaymentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $idempotencyKey, string $statusCallback, array $options = []): PaymentInstance { return $this->proxy()->update($idempotencyKey, $statusCallback, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.PaymentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationInstance.php 0000644 00000012622 15021223077 0020616 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $callSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $errorCode * @property string|null $log * @property \DateTime|null $messageDate * @property string|null $messageText * @property string|null $moreInfo * @property string|null $requestMethod * @property string|null $requestUrl * @property string|null $requestVariables * @property string|null $responseBody * @property string|null $responseHeaders * @property string|null $sid * @property string|null $uri */ class NotificationInstance extends InstanceResource { /** * Initialize the NotificationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call Notification resource to fetch. * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the Call Notification resource to fetch. * @param string $sid The Twilio-provided string that uniquely identifies the Call Notification resource to fetch. */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callSid' => Values::array_get($payload, 'call_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'errorCode' => Values::array_get($payload, 'error_code'), 'log' => Values::array_get($payload, 'log'), 'messageDate' => Deserialize::dateTime(Values::array_get($payload, 'message_date')), 'messageText' => Values::array_get($payload, 'message_text'), 'moreInfo' => Values::array_get($payload, 'more_info'), 'requestMethod' => Values::array_get($payload, 'request_method'), 'requestUrl' => Values::array_get($payload, 'request_url'), 'requestVariables' => Values::array_get($payload, 'request_variables'), 'responseBody' => Values::array_get($payload, 'response_body'), 'responseHeaders' => Values::array_get($payload, 'response_headers'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return NotificationContext Context for this NotificationInstance */ protected function proxy(): NotificationContext { if (!$this->context) { $this->context = new NotificationContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the NotificationInstance * * @return NotificationInstance Fetched NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NotificationInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.NotificationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentList.php 0000644 00000011072 15021223077 0016752 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class PaymentList extends ListResource { /** * Construct the PaymentList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $callSid The SID of the call that will create the resource. Call leg associated with this sid is expected to provide payment information thru DTMF. */ public function __construct( Version $version, string $accountSid, string $callSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Payments.json'; } /** * Create the PaymentInstance * * @param string $idempotencyKey A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated. * @param string $statusCallback Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [expected StatusCallback values](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback) * @param array|Options $options Optional Arguments * @return PaymentInstance Created PaymentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $idempotencyKey, string $statusCallback, array $options = []): PaymentInstance { $options = new Values($options); $data = Values::of([ 'IdempotencyKey' => $idempotencyKey, 'StatusCallback' => $statusCallback, 'BankAccountType' => $options['bankAccountType'], 'ChargeAmount' => $options['chargeAmount'], 'Currency' => $options['currency'], 'Description' => $options['description'], 'Input' => $options['input'], 'MinPostalCodeLength' => $options['minPostalCodeLength'], 'Parameter' => Serialize::jsonObject($options['parameter']), 'PaymentConnector' => $options['paymentConnector'], 'PaymentMethod' => $options['paymentMethod'], 'PostalCode' => Serialize::booleanToString($options['postalCode']), 'SecurityCode' => Serialize::booleanToString($options['securityCode']), 'Timeout' => $options['timeout'], 'TokenType' => $options['tokenType'], 'ValidCardTypes' => $options['validCardTypes'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new PaymentInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Constructs a PaymentContext * * @param string $sid The SID of Payments session that needs to be updated. */ public function getContext( string $sid ): PaymentContext { return new PaymentContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.PaymentList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecList.php 0000644 00000045136 15021223077 0016572 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class SiprecList extends ListResource { /** * Construct the SiprecList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Siprec resource. * @param string $callSid The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Siprec resource is associated with. */ public function __construct( Version $version, string $accountSid, string $callSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Siprec.json'; } /** * Create the SiprecInstance * * @param array|Options $options Optional Arguments * @return SiprecInstance Created SiprecInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): SiprecInstance { $options = new Values($options); $data = Values::of([ 'Name' => $options['name'], 'ConnectorName' => $options['connectorName'], 'Track' => $options['track'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'Parameter1.Name' => $options['parameter1Name'], 'Parameter1.Value' => $options['parameter1Value'], 'Parameter2.Name' => $options['parameter2Name'], 'Parameter2.Value' => $options['parameter2Value'], 'Parameter3.Name' => $options['parameter3Name'], 'Parameter3.Value' => $options['parameter3Value'], 'Parameter4.Name' => $options['parameter4Name'], 'Parameter4.Value' => $options['parameter4Value'], 'Parameter5.Name' => $options['parameter5Name'], 'Parameter5.Value' => $options['parameter5Value'], 'Parameter6.Name' => $options['parameter6Name'], 'Parameter6.Value' => $options['parameter6Value'], 'Parameter7.Name' => $options['parameter7Name'], 'Parameter7.Value' => $options['parameter7Value'], 'Parameter8.Name' => $options['parameter8Name'], 'Parameter8.Value' => $options['parameter8Value'], 'Parameter9.Name' => $options['parameter9Name'], 'Parameter9.Value' => $options['parameter9Value'], 'Parameter10.Name' => $options['parameter10Name'], 'Parameter10.Value' => $options['parameter10Value'], 'Parameter11.Name' => $options['parameter11Name'], 'Parameter11.Value' => $options['parameter11Value'], 'Parameter12.Name' => $options['parameter12Name'], 'Parameter12.Value' => $options['parameter12Value'], 'Parameter13.Name' => $options['parameter13Name'], 'Parameter13.Value' => $options['parameter13Value'], 'Parameter14.Name' => $options['parameter14Name'], 'Parameter14.Value' => $options['parameter14Value'], 'Parameter15.Name' => $options['parameter15Name'], 'Parameter15.Value' => $options['parameter15Value'], 'Parameter16.Name' => $options['parameter16Name'], 'Parameter16.Value' => $options['parameter16Value'], 'Parameter17.Name' => $options['parameter17Name'], 'Parameter17.Value' => $options['parameter17Value'], 'Parameter18.Name' => $options['parameter18Name'], 'Parameter18.Value' => $options['parameter18Value'], 'Parameter19.Name' => $options['parameter19Name'], 'Parameter19.Value' => $options['parameter19Value'], 'Parameter20.Name' => $options['parameter20Name'], 'Parameter20.Value' => $options['parameter20Value'], 'Parameter21.Name' => $options['parameter21Name'], 'Parameter21.Value' => $options['parameter21Value'], 'Parameter22.Name' => $options['parameter22Name'], 'Parameter22.Value' => $options['parameter22Value'], 'Parameter23.Name' => $options['parameter23Name'], 'Parameter23.Value' => $options['parameter23Value'], 'Parameter24.Name' => $options['parameter24Name'], 'Parameter24.Value' => $options['parameter24Value'], 'Parameter25.Name' => $options['parameter25Name'], 'Parameter25.Value' => $options['parameter25Value'], 'Parameter26.Name' => $options['parameter26Name'], 'Parameter26.Value' => $options['parameter26Value'], 'Parameter27.Name' => $options['parameter27Name'], 'Parameter27.Value' => $options['parameter27Value'], 'Parameter28.Name' => $options['parameter28Name'], 'Parameter28.Value' => $options['parameter28Value'], 'Parameter29.Name' => $options['parameter29Name'], 'Parameter29.Value' => $options['parameter29Value'], 'Parameter30.Name' => $options['parameter30Name'], 'Parameter30.Value' => $options['parameter30Value'], 'Parameter31.Name' => $options['parameter31Name'], 'Parameter31.Value' => $options['parameter31Value'], 'Parameter32.Name' => $options['parameter32Name'], 'Parameter32.Value' => $options['parameter32Value'], 'Parameter33.Name' => $options['parameter33Name'], 'Parameter33.Value' => $options['parameter33Value'], 'Parameter34.Name' => $options['parameter34Name'], 'Parameter34.Value' => $options['parameter34Value'], 'Parameter35.Name' => $options['parameter35Name'], 'Parameter35.Value' => $options['parameter35Value'], 'Parameter36.Name' => $options['parameter36Name'], 'Parameter36.Value' => $options['parameter36Value'], 'Parameter37.Name' => $options['parameter37Name'], 'Parameter37.Value' => $options['parameter37Value'], 'Parameter38.Name' => $options['parameter38Name'], 'Parameter38.Value' => $options['parameter38Value'], 'Parameter39.Name' => $options['parameter39Name'], 'Parameter39.Value' => $options['parameter39Value'], 'Parameter40.Name' => $options['parameter40Name'], 'Parameter40.Value' => $options['parameter40Value'], 'Parameter41.Name' => $options['parameter41Name'], 'Parameter41.Value' => $options['parameter41Value'], 'Parameter42.Name' => $options['parameter42Name'], 'Parameter42.Value' => $options['parameter42Value'], 'Parameter43.Name' => $options['parameter43Name'], 'Parameter43.Value' => $options['parameter43Value'], 'Parameter44.Name' => $options['parameter44Name'], 'Parameter44.Value' => $options['parameter44Value'], 'Parameter45.Name' => $options['parameter45Name'], 'Parameter45.Value' => $options['parameter45Value'], 'Parameter46.Name' => $options['parameter46Name'], 'Parameter46.Value' => $options['parameter46Value'], 'Parameter47.Name' => $options['parameter47Name'], 'Parameter47.Value' => $options['parameter47Value'], 'Parameter48.Name' => $options['parameter48Name'], 'Parameter48.Value' => $options['parameter48Value'], 'Parameter49.Name' => $options['parameter49Name'], 'Parameter49.Value' => $options['parameter49Value'], 'Parameter50.Name' => $options['parameter50Name'], 'Parameter50.Value' => $options['parameter50Value'], 'Parameter51.Name' => $options['parameter51Name'], 'Parameter51.Value' => $options['parameter51Value'], 'Parameter52.Name' => $options['parameter52Name'], 'Parameter52.Value' => $options['parameter52Value'], 'Parameter53.Name' => $options['parameter53Name'], 'Parameter53.Value' => $options['parameter53Value'], 'Parameter54.Name' => $options['parameter54Name'], 'Parameter54.Value' => $options['parameter54Value'], 'Parameter55.Name' => $options['parameter55Name'], 'Parameter55.Value' => $options['parameter55Value'], 'Parameter56.Name' => $options['parameter56Name'], 'Parameter56.Value' => $options['parameter56Value'], 'Parameter57.Name' => $options['parameter57Name'], 'Parameter57.Value' => $options['parameter57Value'], 'Parameter58.Name' => $options['parameter58Name'], 'Parameter58.Value' => $options['parameter58Value'], 'Parameter59.Name' => $options['parameter59Name'], 'Parameter59.Value' => $options['parameter59Value'], 'Parameter60.Name' => $options['parameter60Name'], 'Parameter60.Value' => $options['parameter60Value'], 'Parameter61.Name' => $options['parameter61Name'], 'Parameter61.Value' => $options['parameter61Value'], 'Parameter62.Name' => $options['parameter62Name'], 'Parameter62.Value' => $options['parameter62Value'], 'Parameter63.Name' => $options['parameter63Name'], 'Parameter63.Value' => $options['parameter63Value'], 'Parameter64.Name' => $options['parameter64Name'], 'Parameter64.Value' => $options['parameter64Value'], 'Parameter65.Name' => $options['parameter65Name'], 'Parameter65.Value' => $options['parameter65Value'], 'Parameter66.Name' => $options['parameter66Name'], 'Parameter66.Value' => $options['parameter66Value'], 'Parameter67.Name' => $options['parameter67Name'], 'Parameter67.Value' => $options['parameter67Value'], 'Parameter68.Name' => $options['parameter68Name'], 'Parameter68.Value' => $options['parameter68Value'], 'Parameter69.Name' => $options['parameter69Name'], 'Parameter69.Value' => $options['parameter69Value'], 'Parameter70.Name' => $options['parameter70Name'], 'Parameter70.Value' => $options['parameter70Value'], 'Parameter71.Name' => $options['parameter71Name'], 'Parameter71.Value' => $options['parameter71Value'], 'Parameter72.Name' => $options['parameter72Name'], 'Parameter72.Value' => $options['parameter72Value'], 'Parameter73.Name' => $options['parameter73Name'], 'Parameter73.Value' => $options['parameter73Value'], 'Parameter74.Name' => $options['parameter74Name'], 'Parameter74.Value' => $options['parameter74Value'], 'Parameter75.Name' => $options['parameter75Name'], 'Parameter75.Value' => $options['parameter75Value'], 'Parameter76.Name' => $options['parameter76Name'], 'Parameter76.Value' => $options['parameter76Value'], 'Parameter77.Name' => $options['parameter77Name'], 'Parameter77.Value' => $options['parameter77Value'], 'Parameter78.Name' => $options['parameter78Name'], 'Parameter78.Value' => $options['parameter78Value'], 'Parameter79.Name' => $options['parameter79Name'], 'Parameter79.Value' => $options['parameter79Value'], 'Parameter80.Name' => $options['parameter80Name'], 'Parameter80.Value' => $options['parameter80Value'], 'Parameter81.Name' => $options['parameter81Name'], 'Parameter81.Value' => $options['parameter81Value'], 'Parameter82.Name' => $options['parameter82Name'], 'Parameter82.Value' => $options['parameter82Value'], 'Parameter83.Name' => $options['parameter83Name'], 'Parameter83.Value' => $options['parameter83Value'], 'Parameter84.Name' => $options['parameter84Name'], 'Parameter84.Value' => $options['parameter84Value'], 'Parameter85.Name' => $options['parameter85Name'], 'Parameter85.Value' => $options['parameter85Value'], 'Parameter86.Name' => $options['parameter86Name'], 'Parameter86.Value' => $options['parameter86Value'], 'Parameter87.Name' => $options['parameter87Name'], 'Parameter87.Value' => $options['parameter87Value'], 'Parameter88.Name' => $options['parameter88Name'], 'Parameter88.Value' => $options['parameter88Value'], 'Parameter89.Name' => $options['parameter89Name'], 'Parameter89.Value' => $options['parameter89Value'], 'Parameter90.Name' => $options['parameter90Name'], 'Parameter90.Value' => $options['parameter90Value'], 'Parameter91.Name' => $options['parameter91Name'], 'Parameter91.Value' => $options['parameter91Value'], 'Parameter92.Name' => $options['parameter92Name'], 'Parameter92.Value' => $options['parameter92Value'], 'Parameter93.Name' => $options['parameter93Name'], 'Parameter93.Value' => $options['parameter93Value'], 'Parameter94.Name' => $options['parameter94Name'], 'Parameter94.Value' => $options['parameter94Value'], 'Parameter95.Name' => $options['parameter95Name'], 'Parameter95.Value' => $options['parameter95Value'], 'Parameter96.Name' => $options['parameter96Name'], 'Parameter96.Value' => $options['parameter96Value'], 'Parameter97.Name' => $options['parameter97Name'], 'Parameter97.Value' => $options['parameter97Value'], 'Parameter98.Name' => $options['parameter98Name'], 'Parameter98.Value' => $options['parameter98Value'], 'Parameter99.Name' => $options['parameter99Name'], 'Parameter99.Value' => $options['parameter99Value'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SiprecInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Constructs a SiprecContext * * @param string $sid The SID of the Siprec resource, or the `name` used when creating the resource */ public function getContext( string $sid ): SiprecContext { return new SiprecContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.SiprecList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/PaymentOptions.php 0000644 00000042224 15021223077 0017475 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class PaymentOptions { /** * @param string $bankAccountType * @param string $chargeAmount A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. * @param string $currency The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. * @param string $description The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions. * @param string $input A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs. * @param int $minPostalCodeLength A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits. * @param array $parameter A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the <Pay> Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). * @param string $paymentConnector This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [<Pay> Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. * @param string $paymentMethod * @param bool $postalCode Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. * @param bool $securityCode Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. * @param int $timeout The number of seconds that <Pay> should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. * @param string $tokenType * @param string $validCardTypes Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` * @return CreatePaymentOptions Options builder */ public static function create( string $bankAccountType = Values::NONE, string $chargeAmount = Values::NONE, string $currency = Values::NONE, string $description = Values::NONE, string $input = Values::NONE, int $minPostalCodeLength = Values::INT_NONE, array $parameter = Values::ARRAY_NONE, string $paymentConnector = Values::NONE, string $paymentMethod = Values::NONE, bool $postalCode = Values::BOOL_NONE, bool $securityCode = Values::BOOL_NONE, int $timeout = Values::INT_NONE, string $tokenType = Values::NONE, string $validCardTypes = Values::NONE ): CreatePaymentOptions { return new CreatePaymentOptions( $bankAccountType, $chargeAmount, $currency, $description, $input, $minPostalCodeLength, $parameter, $paymentConnector, $paymentMethod, $postalCode, $securityCode, $timeout, $tokenType, $validCardTypes ); } /** * @param string $capture * @param string $status * @return UpdatePaymentOptions Options builder */ public static function update( string $capture = Values::NONE, string $status = Values::NONE ): UpdatePaymentOptions { return new UpdatePaymentOptions( $capture, $status ); } } class CreatePaymentOptions extends Options { /** * @param string $bankAccountType * @param string $chargeAmount A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. * @param string $currency The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. * @param string $description The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions. * @param string $input A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs. * @param int $minPostalCodeLength A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits. * @param array $parameter A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the <Pay> Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). * @param string $paymentConnector This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [<Pay> Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. * @param string $paymentMethod * @param bool $postalCode Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. * @param bool $securityCode Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. * @param int $timeout The number of seconds that <Pay> should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. * @param string $tokenType * @param string $validCardTypes Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` */ public function __construct( string $bankAccountType = Values::NONE, string $chargeAmount = Values::NONE, string $currency = Values::NONE, string $description = Values::NONE, string $input = Values::NONE, int $minPostalCodeLength = Values::INT_NONE, array $parameter = Values::ARRAY_NONE, string $paymentConnector = Values::NONE, string $paymentMethod = Values::NONE, bool $postalCode = Values::BOOL_NONE, bool $securityCode = Values::BOOL_NONE, int $timeout = Values::INT_NONE, string $tokenType = Values::NONE, string $validCardTypes = Values::NONE ) { $this->options['bankAccountType'] = $bankAccountType; $this->options['chargeAmount'] = $chargeAmount; $this->options['currency'] = $currency; $this->options['description'] = $description; $this->options['input'] = $input; $this->options['minPostalCodeLength'] = $minPostalCodeLength; $this->options['parameter'] = $parameter; $this->options['paymentConnector'] = $paymentConnector; $this->options['paymentMethod'] = $paymentMethod; $this->options['postalCode'] = $postalCode; $this->options['securityCode'] = $securityCode; $this->options['timeout'] = $timeout; $this->options['tokenType'] = $tokenType; $this->options['validCardTypes'] = $validCardTypes; } /** * @param string $bankAccountType * @return $this Fluent Builder */ public function setBankAccountType(string $bankAccountType): self { $this->options['bankAccountType'] = $bankAccountType; return $this; } /** * A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. * * @param string $chargeAmount A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. * @return $this Fluent Builder */ public function setChargeAmount(string $chargeAmount): self { $this->options['chargeAmount'] = $chargeAmount; return $this; } /** * The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. * * @param string $currency The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. * @return $this Fluent Builder */ public function setCurrency(string $currency): self { $this->options['currency'] = $currency; return $this; } /** * The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions. * * @param string $description The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions. * @return $this Fluent Builder */ public function setDescription(string $description): self { $this->options['description'] = $description; return $this; } /** * A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs. * * @param string $input A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs. * @return $this Fluent Builder */ public function setInput(string $input): self { $this->options['input'] = $input; return $this; } /** * A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits. * * @param int $minPostalCodeLength A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits. * @return $this Fluent Builder */ public function setMinPostalCodeLength(int $minPostalCodeLength): self { $this->options['minPostalCodeLength'] = $minPostalCodeLength; return $this; } /** * A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the <Pay> Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). * * @param array $parameter A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the <Pay> Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). * @return $this Fluent Builder */ public function setParameter(array $parameter): self { $this->options['parameter'] = $parameter; return $this; } /** * This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [<Pay> Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. * * @param string $paymentConnector This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [<Pay> Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. * @return $this Fluent Builder */ public function setPaymentConnector(string $paymentConnector): self { $this->options['paymentConnector'] = $paymentConnector; return $this; } /** * @param string $paymentMethod * @return $this Fluent Builder */ public function setPaymentMethod(string $paymentMethod): self { $this->options['paymentMethod'] = $paymentMethod; return $this; } /** * Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. * * @param bool $postalCode Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. * @return $this Fluent Builder */ public function setPostalCode(bool $postalCode): self { $this->options['postalCode'] = $postalCode; return $this; } /** * Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. * * @param bool $securityCode Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. * @return $this Fluent Builder */ public function setSecurityCode(bool $securityCode): self { $this->options['securityCode'] = $securityCode; return $this; } /** * The number of seconds that <Pay> should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. * * @param int $timeout The number of seconds that <Pay> should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. * @return $this Fluent Builder */ public function setTimeout(int $timeout): self { $this->options['timeout'] = $timeout; return $this; } /** * @param string $tokenType * @return $this Fluent Builder */ public function setTokenType(string $tokenType): self { $this->options['tokenType'] = $tokenType; return $this; } /** * Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` * * @param string $validCardTypes Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` * @return $this Fluent Builder */ public function setValidCardTypes(string $validCardTypes): self { $this->options['validCardTypes'] = $validCardTypes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreatePaymentOptions ' . $options . ']'; } } class UpdatePaymentOptions extends Options { /** * @param string $capture * @param string $status */ public function __construct( string $capture = Values::NONE, string $status = Values::NONE ) { $this->options['capture'] = $capture; $this->options['status'] = $status; } /** * @param string $capture * @return $this Fluent Builder */ public function setCapture(string $capture): self { $this->options['capture'] = $capture; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdatePaymentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventInstance.php 0000644 00000004464 15021223077 0017256 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property array|null $request * @property array|null $response */ class EventInstance extends InstanceResource { /** * Initialize the EventInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique SID identifier of the Account. * @param string $callSid The unique SID identifier of the Call. */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'request' => Values::array_get($payload, 'request'), 'response' => Values::array_get($payload, 'response'), ]; $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.EventInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageList.php 0000644 00000005366 15021223077 0021050 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class UserDefinedMessageList extends ListResource { /** * Construct the UserDefinedMessageList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created User Defined Message. * @param string $callSid The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User Defined Message is associated with. */ public function __construct( Version $version, string $accountSid, string $callSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/UserDefinedMessages.json'; } /** * Create the UserDefinedMessageInstance * * @param string $content The User Defined Message in the form of URL-encoded JSON string. * @param array|Options $options Optional Arguments * @return UserDefinedMessageInstance Created UserDefinedMessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $content, array $options = []): UserDefinedMessageInstance { $options = new Values($options); $data = Values::of([ 'Content' => $content, 'IdempotencyKey' => $options['idempotencyKey'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new UserDefinedMessageInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.UserDefinedMessageList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamContext.php 0000644 00000005354 15021223077 0017307 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class StreamContext extends InstanceContext { /** * Initialize the StreamContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Stream resource. * @param string $callSid The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Stream resource is associated with. * @param string $sid The SID of the Stream resource, or the `name` used when creating the resource */ public function __construct( Version $version, $accountSid, $callSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Streams/' . \rawurlencode($sid) .'.json'; } /** * Update the StreamInstance * * @param string $status * @return StreamInstance Updated StreamInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): StreamInstance { $data = Values::of([ 'Status' => $status, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new StreamInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.StreamContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamPage.php 0000644 00000003126 15021223077 0016532 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class StreamPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return StreamInstance \Twilio\Rest\Api\V2010\Account\Call\StreamInstance */ public function buildInstance(array $payload): StreamInstance { return new StreamInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.StreamPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingList.php 0000644 00000017051 15021223077 0017254 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class RecordingList extends ListResource { /** * Construct the RecordingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $callSid The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) to associate the resource with. */ public function __construct( Version $version, string $accountSid, string $callSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Recordings.json'; } /** * Create the RecordingInstance * * @param array|Options $options Optional Arguments * @return RecordingInstance Created RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): RecordingInstance { $options = new Values($options); $data = Values::of([ 'RecordingStatusCallbackEvent' => Serialize::map($options['recordingStatusCallbackEvent'], function ($e) { return $e; }), 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'Trim' => $options['trim'], 'RecordingChannels' => $options['recordingChannels'], 'RecordingTrack' => $options['recordingTrack'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Reads RecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RecordingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RecordingPage Page of RecordingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RecordingPage { $options = new Values($options); $params = Values::of([ 'DateCreated<' => Serialize::iso8601Date($options['dateCreatedBefore']), 'DateCreated' => Serialize::iso8601Date($options['dateCreated']), 'DateCreated>' => Serialize::iso8601Date($options['dateCreatedAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RecordingPage Page of RecordingInstance */ public function getPage(string $targetUrl): RecordingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RecordingPage($this->version, $response, $this->solution); } /** * Constructs a RecordingContext * * @param string $sid The Twilio-provided string that uniquely identifies the Recording resource to delete. */ public function getContext( string $sid ): RecordingContext { return new RecordingContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.RecordingList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php 0000644 00000005216 15021223077 0020477 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class NotificationContext extends InstanceContext { /** * Initialize the NotificationContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call Notification resource to fetch. * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the Call Notification resource to fetch. * @param string $sid The Twilio-provided string that uniquely identifies the Call Notification resource to fetch. */ public function __construct( Version $version, $accountSid, $callSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Notifications/' . \rawurlencode($sid) .'.json'; } /** * Fetch the NotificationInstance * * @return NotificationInstance Fetched NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NotificationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new NotificationInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.NotificationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/StreamOptions.php 0000644 00000360601 15021223077 0017315 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Stream; use Twilio\Values; abstract class StreamOptions { /** * @param string $name The user-specified name of this Stream, if one was given when the Stream was created. This may be used to stop the Stream. * @param string $track * @param string $statusCallback Absolute URL of the status callback. * @param string $statusCallbackMethod The http method for the status_callback (one of GET, POST). * @param string $parameter1Name Parameter name * @param string $parameter1Value Parameter value * @param string $parameter2Name Parameter name * @param string $parameter2Value Parameter value * @param string $parameter3Name Parameter name * @param string $parameter3Value Parameter value * @param string $parameter4Name Parameter name * @param string $parameter4Value Parameter value * @param string $parameter5Name Parameter name * @param string $parameter5Value Parameter value * @param string $parameter6Name Parameter name * @param string $parameter6Value Parameter value * @param string $parameter7Name Parameter name * @param string $parameter7Value Parameter value * @param string $parameter8Name Parameter name * @param string $parameter8Value Parameter value * @param string $parameter9Name Parameter name * @param string $parameter9Value Parameter value * @param string $parameter10Name Parameter name * @param string $parameter10Value Parameter value * @param string $parameter11Name Parameter name * @param string $parameter11Value Parameter value * @param string $parameter12Name Parameter name * @param string $parameter12Value Parameter value * @param string $parameter13Name Parameter name * @param string $parameter13Value Parameter value * @param string $parameter14Name Parameter name * @param string $parameter14Value Parameter value * @param string $parameter15Name Parameter name * @param string $parameter15Value Parameter value * @param string $parameter16Name Parameter name * @param string $parameter16Value Parameter value * @param string $parameter17Name Parameter name * @param string $parameter17Value Parameter value * @param string $parameter18Name Parameter name * @param string $parameter18Value Parameter value * @param string $parameter19Name Parameter name * @param string $parameter19Value Parameter value * @param string $parameter20Name Parameter name * @param string $parameter20Value Parameter value * @param string $parameter21Name Parameter name * @param string $parameter21Value Parameter value * @param string $parameter22Name Parameter name * @param string $parameter22Value Parameter value * @param string $parameter23Name Parameter name * @param string $parameter23Value Parameter value * @param string $parameter24Name Parameter name * @param string $parameter24Value Parameter value * @param string $parameter25Name Parameter name * @param string $parameter25Value Parameter value * @param string $parameter26Name Parameter name * @param string $parameter26Value Parameter value * @param string $parameter27Name Parameter name * @param string $parameter27Value Parameter value * @param string $parameter28Name Parameter name * @param string $parameter28Value Parameter value * @param string $parameter29Name Parameter name * @param string $parameter29Value Parameter value * @param string $parameter30Name Parameter name * @param string $parameter30Value Parameter value * @param string $parameter31Name Parameter name * @param string $parameter31Value Parameter value * @param string $parameter32Name Parameter name * @param string $parameter32Value Parameter value * @param string $parameter33Name Parameter name * @param string $parameter33Value Parameter value * @param string $parameter34Name Parameter name * @param string $parameter34Value Parameter value * @param string $parameter35Name Parameter name * @param string $parameter35Value Parameter value * @param string $parameter36Name Parameter name * @param string $parameter36Value Parameter value * @param string $parameter37Name Parameter name * @param string $parameter37Value Parameter value * @param string $parameter38Name Parameter name * @param string $parameter38Value Parameter value * @param string $parameter39Name Parameter name * @param string $parameter39Value Parameter value * @param string $parameter40Name Parameter name * @param string $parameter40Value Parameter value * @param string $parameter41Name Parameter name * @param string $parameter41Value Parameter value * @param string $parameter42Name Parameter name * @param string $parameter42Value Parameter value * @param string $parameter43Name Parameter name * @param string $parameter43Value Parameter value * @param string $parameter44Name Parameter name * @param string $parameter44Value Parameter value * @param string $parameter45Name Parameter name * @param string $parameter45Value Parameter value * @param string $parameter46Name Parameter name * @param string $parameter46Value Parameter value * @param string $parameter47Name Parameter name * @param string $parameter47Value Parameter value * @param string $parameter48Name Parameter name * @param string $parameter48Value Parameter value * @param string $parameter49Name Parameter name * @param string $parameter49Value Parameter value * @param string $parameter50Name Parameter name * @param string $parameter50Value Parameter value * @param string $parameter51Name Parameter name * @param string $parameter51Value Parameter value * @param string $parameter52Name Parameter name * @param string $parameter52Value Parameter value * @param string $parameter53Name Parameter name * @param string $parameter53Value Parameter value * @param string $parameter54Name Parameter name * @param string $parameter54Value Parameter value * @param string $parameter55Name Parameter name * @param string $parameter55Value Parameter value * @param string $parameter56Name Parameter name * @param string $parameter56Value Parameter value * @param string $parameter57Name Parameter name * @param string $parameter57Value Parameter value * @param string $parameter58Name Parameter name * @param string $parameter58Value Parameter value * @param string $parameter59Name Parameter name * @param string $parameter59Value Parameter value * @param string $parameter60Name Parameter name * @param string $parameter60Value Parameter value * @param string $parameter61Name Parameter name * @param string $parameter61Value Parameter value * @param string $parameter62Name Parameter name * @param string $parameter62Value Parameter value * @param string $parameter63Name Parameter name * @param string $parameter63Value Parameter value * @param string $parameter64Name Parameter name * @param string $parameter64Value Parameter value * @param string $parameter65Name Parameter name * @param string $parameter65Value Parameter value * @param string $parameter66Name Parameter name * @param string $parameter66Value Parameter value * @param string $parameter67Name Parameter name * @param string $parameter67Value Parameter value * @param string $parameter68Name Parameter name * @param string $parameter68Value Parameter value * @param string $parameter69Name Parameter name * @param string $parameter69Value Parameter value * @param string $parameter70Name Parameter name * @param string $parameter70Value Parameter value * @param string $parameter71Name Parameter name * @param string $parameter71Value Parameter value * @param string $parameter72Name Parameter name * @param string $parameter72Value Parameter value * @param string $parameter73Name Parameter name * @param string $parameter73Value Parameter value * @param string $parameter74Name Parameter name * @param string $parameter74Value Parameter value * @param string $parameter75Name Parameter name * @param string $parameter75Value Parameter value * @param string $parameter76Name Parameter name * @param string $parameter76Value Parameter value * @param string $parameter77Name Parameter name * @param string $parameter77Value Parameter value * @param string $parameter78Name Parameter name * @param string $parameter78Value Parameter value * @param string $parameter79Name Parameter name * @param string $parameter79Value Parameter value * @param string $parameter80Name Parameter name * @param string $parameter80Value Parameter value * @param string $parameter81Name Parameter name * @param string $parameter81Value Parameter value * @param string $parameter82Name Parameter name * @param string $parameter82Value Parameter value * @param string $parameter83Name Parameter name * @param string $parameter83Value Parameter value * @param string $parameter84Name Parameter name * @param string $parameter84Value Parameter value * @param string $parameter85Name Parameter name * @param string $parameter85Value Parameter value * @param string $parameter86Name Parameter name * @param string $parameter86Value Parameter value * @param string $parameter87Name Parameter name * @param string $parameter87Value Parameter value * @param string $parameter88Name Parameter name * @param string $parameter88Value Parameter value * @param string $parameter89Name Parameter name * @param string $parameter89Value Parameter value * @param string $parameter90Name Parameter name * @param string $parameter90Value Parameter value * @param string $parameter91Name Parameter name * @param string $parameter91Value Parameter value * @param string $parameter92Name Parameter name * @param string $parameter92Value Parameter value * @param string $parameter93Name Parameter name * @param string $parameter93Value Parameter value * @param string $parameter94Name Parameter name * @param string $parameter94Value Parameter value * @param string $parameter95Name Parameter name * @param string $parameter95Value Parameter value * @param string $parameter96Name Parameter name * @param string $parameter96Value Parameter value * @param string $parameter97Name Parameter name * @param string $parameter97Value Parameter value * @param string $parameter98Name Parameter name * @param string $parameter98Value Parameter value * @param string $parameter99Name Parameter name * @param string $parameter99Value Parameter value * @return CreateStreamOptions Options builder */ public static function create( string $name = Values::NONE, string $track = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $parameter1Name = Values::NONE, string $parameter1Value = Values::NONE, string $parameter2Name = Values::NONE, string $parameter2Value = Values::NONE, string $parameter3Name = Values::NONE, string $parameter3Value = Values::NONE, string $parameter4Name = Values::NONE, string $parameter4Value = Values::NONE, string $parameter5Name = Values::NONE, string $parameter5Value = Values::NONE, string $parameter6Name = Values::NONE, string $parameter6Value = Values::NONE, string $parameter7Name = Values::NONE, string $parameter7Value = Values::NONE, string $parameter8Name = Values::NONE, string $parameter8Value = Values::NONE, string $parameter9Name = Values::NONE, string $parameter9Value = Values::NONE, string $parameter10Name = Values::NONE, string $parameter10Value = Values::NONE, string $parameter11Name = Values::NONE, string $parameter11Value = Values::NONE, string $parameter12Name = Values::NONE, string $parameter12Value = Values::NONE, string $parameter13Name = Values::NONE, string $parameter13Value = Values::NONE, string $parameter14Name = Values::NONE, string $parameter14Value = Values::NONE, string $parameter15Name = Values::NONE, string $parameter15Value = Values::NONE, string $parameter16Name = Values::NONE, string $parameter16Value = Values::NONE, string $parameter17Name = Values::NONE, string $parameter17Value = Values::NONE, string $parameter18Name = Values::NONE, string $parameter18Value = Values::NONE, string $parameter19Name = Values::NONE, string $parameter19Value = Values::NONE, string $parameter20Name = Values::NONE, string $parameter20Value = Values::NONE, string $parameter21Name = Values::NONE, string $parameter21Value = Values::NONE, string $parameter22Name = Values::NONE, string $parameter22Value = Values::NONE, string $parameter23Name = Values::NONE, string $parameter23Value = Values::NONE, string $parameter24Name = Values::NONE, string $parameter24Value = Values::NONE, string $parameter25Name = Values::NONE, string $parameter25Value = Values::NONE, string $parameter26Name = Values::NONE, string $parameter26Value = Values::NONE, string $parameter27Name = Values::NONE, string $parameter27Value = Values::NONE, string $parameter28Name = Values::NONE, string $parameter28Value = Values::NONE, string $parameter29Name = Values::NONE, string $parameter29Value = Values::NONE, string $parameter30Name = Values::NONE, string $parameter30Value = Values::NONE, string $parameter31Name = Values::NONE, string $parameter31Value = Values::NONE, string $parameter32Name = Values::NONE, string $parameter32Value = Values::NONE, string $parameter33Name = Values::NONE, string $parameter33Value = Values::NONE, string $parameter34Name = Values::NONE, string $parameter34Value = Values::NONE, string $parameter35Name = Values::NONE, string $parameter35Value = Values::NONE, string $parameter36Name = Values::NONE, string $parameter36Value = Values::NONE, string $parameter37Name = Values::NONE, string $parameter37Value = Values::NONE, string $parameter38Name = Values::NONE, string $parameter38Value = Values::NONE, string $parameter39Name = Values::NONE, string $parameter39Value = Values::NONE, string $parameter40Name = Values::NONE, string $parameter40Value = Values::NONE, string $parameter41Name = Values::NONE, string $parameter41Value = Values::NONE, string $parameter42Name = Values::NONE, string $parameter42Value = Values::NONE, string $parameter43Name = Values::NONE, string $parameter43Value = Values::NONE, string $parameter44Name = Values::NONE, string $parameter44Value = Values::NONE, string $parameter45Name = Values::NONE, string $parameter45Value = Values::NONE, string $parameter46Name = Values::NONE, string $parameter46Value = Values::NONE, string $parameter47Name = Values::NONE, string $parameter47Value = Values::NONE, string $parameter48Name = Values::NONE, string $parameter48Value = Values::NONE, string $parameter49Name = Values::NONE, string $parameter49Value = Values::NONE, string $parameter50Name = Values::NONE, string $parameter50Value = Values::NONE, string $parameter51Name = Values::NONE, string $parameter51Value = Values::NONE, string $parameter52Name = Values::NONE, string $parameter52Value = Values::NONE, string $parameter53Name = Values::NONE, string $parameter53Value = Values::NONE, string $parameter54Name = Values::NONE, string $parameter54Value = Values::NONE, string $parameter55Name = Values::NONE, string $parameter55Value = Values::NONE, string $parameter56Name = Values::NONE, string $parameter56Value = Values::NONE, string $parameter57Name = Values::NONE, string $parameter57Value = Values::NONE, string $parameter58Name = Values::NONE, string $parameter58Value = Values::NONE, string $parameter59Name = Values::NONE, string $parameter59Value = Values::NONE, string $parameter60Name = Values::NONE, string $parameter60Value = Values::NONE, string $parameter61Name = Values::NONE, string $parameter61Value = Values::NONE, string $parameter62Name = Values::NONE, string $parameter62Value = Values::NONE, string $parameter63Name = Values::NONE, string $parameter63Value = Values::NONE, string $parameter64Name = Values::NONE, string $parameter64Value = Values::NONE, string $parameter65Name = Values::NONE, string $parameter65Value = Values::NONE, string $parameter66Name = Values::NONE, string $parameter66Value = Values::NONE, string $parameter67Name = Values::NONE, string $parameter67Value = Values::NONE, string $parameter68Name = Values::NONE, string $parameter68Value = Values::NONE, string $parameter69Name = Values::NONE, string $parameter69Value = Values::NONE, string $parameter70Name = Values::NONE, string $parameter70Value = Values::NONE, string $parameter71Name = Values::NONE, string $parameter71Value = Values::NONE, string $parameter72Name = Values::NONE, string $parameter72Value = Values::NONE, string $parameter73Name = Values::NONE, string $parameter73Value = Values::NONE, string $parameter74Name = Values::NONE, string $parameter74Value = Values::NONE, string $parameter75Name = Values::NONE, string $parameter75Value = Values::NONE, string $parameter76Name = Values::NONE, string $parameter76Value = Values::NONE, string $parameter77Name = Values::NONE, string $parameter77Value = Values::NONE, string $parameter78Name = Values::NONE, string $parameter78Value = Values::NONE, string $parameter79Name = Values::NONE, string $parameter79Value = Values::NONE, string $parameter80Name = Values::NONE, string $parameter80Value = Values::NONE, string $parameter81Name = Values::NONE, string $parameter81Value = Values::NONE, string $parameter82Name = Values::NONE, string $parameter82Value = Values::NONE, string $parameter83Name = Values::NONE, string $parameter83Value = Values::NONE, string $parameter84Name = Values::NONE, string $parameter84Value = Values::NONE, string $parameter85Name = Values::NONE, string $parameter85Value = Values::NONE, string $parameter86Name = Values::NONE, string $parameter86Value = Values::NONE, string $parameter87Name = Values::NONE, string $parameter87Value = Values::NONE, string $parameter88Name = Values::NONE, string $parameter88Value = Values::NONE, string $parameter89Name = Values::NONE, string $parameter89Value = Values::NONE, string $parameter90Name = Values::NONE, string $parameter90Value = Values::NONE, string $parameter91Name = Values::NONE, string $parameter91Value = Values::NONE, string $parameter92Name = Values::NONE, string $parameter92Value = Values::NONE, string $parameter93Name = Values::NONE, string $parameter93Value = Values::NONE, string $parameter94Name = Values::NONE, string $parameter94Value = Values::NONE, string $parameter95Name = Values::NONE, string $parameter95Value = Values::NONE, string $parameter96Name = Values::NONE, string $parameter96Value = Values::NONE, string $parameter97Name = Values::NONE, string $parameter97Value = Values::NONE, string $parameter98Name = Values::NONE, string $parameter98Value = Values::NONE, string $parameter99Name = Values::NONE, string $parameter99Value = Values::NONE ): CreateStreamOptions { return new CreateStreamOptions( $name, $track, $statusCallback, $statusCallbackMethod, $parameter1Name, $parameter1Value, $parameter2Name, $parameter2Value, $parameter3Name, $parameter3Value, $parameter4Name, $parameter4Value, $parameter5Name, $parameter5Value, $parameter6Name, $parameter6Value, $parameter7Name, $parameter7Value, $parameter8Name, $parameter8Value, $parameter9Name, $parameter9Value, $parameter10Name, $parameter10Value, $parameter11Name, $parameter11Value, $parameter12Name, $parameter12Value, $parameter13Name, $parameter13Value, $parameter14Name, $parameter14Value, $parameter15Name, $parameter15Value, $parameter16Name, $parameter16Value, $parameter17Name, $parameter17Value, $parameter18Name, $parameter18Value, $parameter19Name, $parameter19Value, $parameter20Name, $parameter20Value, $parameter21Name, $parameter21Value, $parameter22Name, $parameter22Value, $parameter23Name, $parameter23Value, $parameter24Name, $parameter24Value, $parameter25Name, $parameter25Value, $parameter26Name, $parameter26Value, $parameter27Name, $parameter27Value, $parameter28Name, $parameter28Value, $parameter29Name, $parameter29Value, $parameter30Name, $parameter30Value, $parameter31Name, $parameter31Value, $parameter32Name, $parameter32Value, $parameter33Name, $parameter33Value, $parameter34Name, $parameter34Value, $parameter35Name, $parameter35Value, $parameter36Name, $parameter36Value, $parameter37Name, $parameter37Value, $parameter38Name, $parameter38Value, $parameter39Name, $parameter39Value, $parameter40Name, $parameter40Value, $parameter41Name, $parameter41Value, $parameter42Name, $parameter42Value, $parameter43Name, $parameter43Value, $parameter44Name, $parameter44Value, $parameter45Name, $parameter45Value, $parameter46Name, $parameter46Value, $parameter47Name, $parameter47Value, $parameter48Name, $parameter48Value, $parameter49Name, $parameter49Value, $parameter50Name, $parameter50Value, $parameter51Name, $parameter51Value, $parameter52Name, $parameter52Value, $parameter53Name, $parameter53Value, $parameter54Name, $parameter54Value, $parameter55Name, $parameter55Value, $parameter56Name, $parameter56Value, $parameter57Name, $parameter57Value, $parameter58Name, $parameter58Value, $parameter59Name, $parameter59Value, $parameter60Name, $parameter60Value, $parameter61Name, $parameter61Value, $parameter62Name, $parameter62Value, $parameter63Name, $parameter63Value, $parameter64Name, $parameter64Value, $parameter65Name, $parameter65Value, $parameter66Name, $parameter66Value, $parameter67Name, $parameter67Value, $parameter68Name, $parameter68Value, $parameter69Name, $parameter69Value, $parameter70Name, $parameter70Value, $parameter71Name, $parameter71Value, $parameter72Name, $parameter72Value, $parameter73Name, $parameter73Value, $parameter74Name, $parameter74Value, $parameter75Name, $parameter75Value, $parameter76Name, $parameter76Value, $parameter77Name, $parameter77Value, $parameter78Name, $parameter78Value, $parameter79Name, $parameter79Value, $parameter80Name, $parameter80Value, $parameter81Name, $parameter81Value, $parameter82Name, $parameter82Value, $parameter83Name, $parameter83Value, $parameter84Name, $parameter84Value, $parameter85Name, $parameter85Value, $parameter86Name, $parameter86Value, $parameter87Name, $parameter87Value, $parameter88Name, $parameter88Value, $parameter89Name, $parameter89Value, $parameter90Name, $parameter90Value, $parameter91Name, $parameter91Value, $parameter92Name, $parameter92Value, $parameter93Name, $parameter93Value, $parameter94Name, $parameter94Value, $parameter95Name, $parameter95Value, $parameter96Name, $parameter96Value, $parameter97Name, $parameter97Value, $parameter98Name, $parameter98Value, $parameter99Name, $parameter99Value ); } } class CreateStreamOptions extends Options { /** * @param string $name The user-specified name of this Stream, if one was given when the Stream was created. This may be used to stop the Stream. * @param string $track * @param string $statusCallback Absolute URL of the status callback. * @param string $statusCallbackMethod The http method for the status_callback (one of GET, POST). * @param string $parameter1Name Parameter name * @param string $parameter1Value Parameter value * @param string $parameter2Name Parameter name * @param string $parameter2Value Parameter value * @param string $parameter3Name Parameter name * @param string $parameter3Value Parameter value * @param string $parameter4Name Parameter name * @param string $parameter4Value Parameter value * @param string $parameter5Name Parameter name * @param string $parameter5Value Parameter value * @param string $parameter6Name Parameter name * @param string $parameter6Value Parameter value * @param string $parameter7Name Parameter name * @param string $parameter7Value Parameter value * @param string $parameter8Name Parameter name * @param string $parameter8Value Parameter value * @param string $parameter9Name Parameter name * @param string $parameter9Value Parameter value * @param string $parameter10Name Parameter name * @param string $parameter10Value Parameter value * @param string $parameter11Name Parameter name * @param string $parameter11Value Parameter value * @param string $parameter12Name Parameter name * @param string $parameter12Value Parameter value * @param string $parameter13Name Parameter name * @param string $parameter13Value Parameter value * @param string $parameter14Name Parameter name * @param string $parameter14Value Parameter value * @param string $parameter15Name Parameter name * @param string $parameter15Value Parameter value * @param string $parameter16Name Parameter name * @param string $parameter16Value Parameter value * @param string $parameter17Name Parameter name * @param string $parameter17Value Parameter value * @param string $parameter18Name Parameter name * @param string $parameter18Value Parameter value * @param string $parameter19Name Parameter name * @param string $parameter19Value Parameter value * @param string $parameter20Name Parameter name * @param string $parameter20Value Parameter value * @param string $parameter21Name Parameter name * @param string $parameter21Value Parameter value * @param string $parameter22Name Parameter name * @param string $parameter22Value Parameter value * @param string $parameter23Name Parameter name * @param string $parameter23Value Parameter value * @param string $parameter24Name Parameter name * @param string $parameter24Value Parameter value * @param string $parameter25Name Parameter name * @param string $parameter25Value Parameter value * @param string $parameter26Name Parameter name * @param string $parameter26Value Parameter value * @param string $parameter27Name Parameter name * @param string $parameter27Value Parameter value * @param string $parameter28Name Parameter name * @param string $parameter28Value Parameter value * @param string $parameter29Name Parameter name * @param string $parameter29Value Parameter value * @param string $parameter30Name Parameter name * @param string $parameter30Value Parameter value * @param string $parameter31Name Parameter name * @param string $parameter31Value Parameter value * @param string $parameter32Name Parameter name * @param string $parameter32Value Parameter value * @param string $parameter33Name Parameter name * @param string $parameter33Value Parameter value * @param string $parameter34Name Parameter name * @param string $parameter34Value Parameter value * @param string $parameter35Name Parameter name * @param string $parameter35Value Parameter value * @param string $parameter36Name Parameter name * @param string $parameter36Value Parameter value * @param string $parameter37Name Parameter name * @param string $parameter37Value Parameter value * @param string $parameter38Name Parameter name * @param string $parameter38Value Parameter value * @param string $parameter39Name Parameter name * @param string $parameter39Value Parameter value * @param string $parameter40Name Parameter name * @param string $parameter40Value Parameter value * @param string $parameter41Name Parameter name * @param string $parameter41Value Parameter value * @param string $parameter42Name Parameter name * @param string $parameter42Value Parameter value * @param string $parameter43Name Parameter name * @param string $parameter43Value Parameter value * @param string $parameter44Name Parameter name * @param string $parameter44Value Parameter value * @param string $parameter45Name Parameter name * @param string $parameter45Value Parameter value * @param string $parameter46Name Parameter name * @param string $parameter46Value Parameter value * @param string $parameter47Name Parameter name * @param string $parameter47Value Parameter value * @param string $parameter48Name Parameter name * @param string $parameter48Value Parameter value * @param string $parameter49Name Parameter name * @param string $parameter49Value Parameter value * @param string $parameter50Name Parameter name * @param string $parameter50Value Parameter value * @param string $parameter51Name Parameter name * @param string $parameter51Value Parameter value * @param string $parameter52Name Parameter name * @param string $parameter52Value Parameter value * @param string $parameter53Name Parameter name * @param string $parameter53Value Parameter value * @param string $parameter54Name Parameter name * @param string $parameter54Value Parameter value * @param string $parameter55Name Parameter name * @param string $parameter55Value Parameter value * @param string $parameter56Name Parameter name * @param string $parameter56Value Parameter value * @param string $parameter57Name Parameter name * @param string $parameter57Value Parameter value * @param string $parameter58Name Parameter name * @param string $parameter58Value Parameter value * @param string $parameter59Name Parameter name * @param string $parameter59Value Parameter value * @param string $parameter60Name Parameter name * @param string $parameter60Value Parameter value * @param string $parameter61Name Parameter name * @param string $parameter61Value Parameter value * @param string $parameter62Name Parameter name * @param string $parameter62Value Parameter value * @param string $parameter63Name Parameter name * @param string $parameter63Value Parameter value * @param string $parameter64Name Parameter name * @param string $parameter64Value Parameter value * @param string $parameter65Name Parameter name * @param string $parameter65Value Parameter value * @param string $parameter66Name Parameter name * @param string $parameter66Value Parameter value * @param string $parameter67Name Parameter name * @param string $parameter67Value Parameter value * @param string $parameter68Name Parameter name * @param string $parameter68Value Parameter value * @param string $parameter69Name Parameter name * @param string $parameter69Value Parameter value * @param string $parameter70Name Parameter name * @param string $parameter70Value Parameter value * @param string $parameter71Name Parameter name * @param string $parameter71Value Parameter value * @param string $parameter72Name Parameter name * @param string $parameter72Value Parameter value * @param string $parameter73Name Parameter name * @param string $parameter73Value Parameter value * @param string $parameter74Name Parameter name * @param string $parameter74Value Parameter value * @param string $parameter75Name Parameter name * @param string $parameter75Value Parameter value * @param string $parameter76Name Parameter name * @param string $parameter76Value Parameter value * @param string $parameter77Name Parameter name * @param string $parameter77Value Parameter value * @param string $parameter78Name Parameter name * @param string $parameter78Value Parameter value * @param string $parameter79Name Parameter name * @param string $parameter79Value Parameter value * @param string $parameter80Name Parameter name * @param string $parameter80Value Parameter value * @param string $parameter81Name Parameter name * @param string $parameter81Value Parameter value * @param string $parameter82Name Parameter name * @param string $parameter82Value Parameter value * @param string $parameter83Name Parameter name * @param string $parameter83Value Parameter value * @param string $parameter84Name Parameter name * @param string $parameter84Value Parameter value * @param string $parameter85Name Parameter name * @param string $parameter85Value Parameter value * @param string $parameter86Name Parameter name * @param string $parameter86Value Parameter value * @param string $parameter87Name Parameter name * @param string $parameter87Value Parameter value * @param string $parameter88Name Parameter name * @param string $parameter88Value Parameter value * @param string $parameter89Name Parameter name * @param string $parameter89Value Parameter value * @param string $parameter90Name Parameter name * @param string $parameter90Value Parameter value * @param string $parameter91Name Parameter name * @param string $parameter91Value Parameter value * @param string $parameter92Name Parameter name * @param string $parameter92Value Parameter value * @param string $parameter93Name Parameter name * @param string $parameter93Value Parameter value * @param string $parameter94Name Parameter name * @param string $parameter94Value Parameter value * @param string $parameter95Name Parameter name * @param string $parameter95Value Parameter value * @param string $parameter96Name Parameter name * @param string $parameter96Value Parameter value * @param string $parameter97Name Parameter name * @param string $parameter97Value Parameter value * @param string $parameter98Name Parameter name * @param string $parameter98Value Parameter value * @param string $parameter99Name Parameter name * @param string $parameter99Value Parameter value */ public function __construct( string $name = Values::NONE, string $track = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $parameter1Name = Values::NONE, string $parameter1Value = Values::NONE, string $parameter2Name = Values::NONE, string $parameter2Value = Values::NONE, string $parameter3Name = Values::NONE, string $parameter3Value = Values::NONE, string $parameter4Name = Values::NONE, string $parameter4Value = Values::NONE, string $parameter5Name = Values::NONE, string $parameter5Value = Values::NONE, string $parameter6Name = Values::NONE, string $parameter6Value = Values::NONE, string $parameter7Name = Values::NONE, string $parameter7Value = Values::NONE, string $parameter8Name = Values::NONE, string $parameter8Value = Values::NONE, string $parameter9Name = Values::NONE, string $parameter9Value = Values::NONE, string $parameter10Name = Values::NONE, string $parameter10Value = Values::NONE, string $parameter11Name = Values::NONE, string $parameter11Value = Values::NONE, string $parameter12Name = Values::NONE, string $parameter12Value = Values::NONE, string $parameter13Name = Values::NONE, string $parameter13Value = Values::NONE, string $parameter14Name = Values::NONE, string $parameter14Value = Values::NONE, string $parameter15Name = Values::NONE, string $parameter15Value = Values::NONE, string $parameter16Name = Values::NONE, string $parameter16Value = Values::NONE, string $parameter17Name = Values::NONE, string $parameter17Value = Values::NONE, string $parameter18Name = Values::NONE, string $parameter18Value = Values::NONE, string $parameter19Name = Values::NONE, string $parameter19Value = Values::NONE, string $parameter20Name = Values::NONE, string $parameter20Value = Values::NONE, string $parameter21Name = Values::NONE, string $parameter21Value = Values::NONE, string $parameter22Name = Values::NONE, string $parameter22Value = Values::NONE, string $parameter23Name = Values::NONE, string $parameter23Value = Values::NONE, string $parameter24Name = Values::NONE, string $parameter24Value = Values::NONE, string $parameter25Name = Values::NONE, string $parameter25Value = Values::NONE, string $parameter26Name = Values::NONE, string $parameter26Value = Values::NONE, string $parameter27Name = Values::NONE, string $parameter27Value = Values::NONE, string $parameter28Name = Values::NONE, string $parameter28Value = Values::NONE, string $parameter29Name = Values::NONE, string $parameter29Value = Values::NONE, string $parameter30Name = Values::NONE, string $parameter30Value = Values::NONE, string $parameter31Name = Values::NONE, string $parameter31Value = Values::NONE, string $parameter32Name = Values::NONE, string $parameter32Value = Values::NONE, string $parameter33Name = Values::NONE, string $parameter33Value = Values::NONE, string $parameter34Name = Values::NONE, string $parameter34Value = Values::NONE, string $parameter35Name = Values::NONE, string $parameter35Value = Values::NONE, string $parameter36Name = Values::NONE, string $parameter36Value = Values::NONE, string $parameter37Name = Values::NONE, string $parameter37Value = Values::NONE, string $parameter38Name = Values::NONE, string $parameter38Value = Values::NONE, string $parameter39Name = Values::NONE, string $parameter39Value = Values::NONE, string $parameter40Name = Values::NONE, string $parameter40Value = Values::NONE, string $parameter41Name = Values::NONE, string $parameter41Value = Values::NONE, string $parameter42Name = Values::NONE, string $parameter42Value = Values::NONE, string $parameter43Name = Values::NONE, string $parameter43Value = Values::NONE, string $parameter44Name = Values::NONE, string $parameter44Value = Values::NONE, string $parameter45Name = Values::NONE, string $parameter45Value = Values::NONE, string $parameter46Name = Values::NONE, string $parameter46Value = Values::NONE, string $parameter47Name = Values::NONE, string $parameter47Value = Values::NONE, string $parameter48Name = Values::NONE, string $parameter48Value = Values::NONE, string $parameter49Name = Values::NONE, string $parameter49Value = Values::NONE, string $parameter50Name = Values::NONE, string $parameter50Value = Values::NONE, string $parameter51Name = Values::NONE, string $parameter51Value = Values::NONE, string $parameter52Name = Values::NONE, string $parameter52Value = Values::NONE, string $parameter53Name = Values::NONE, string $parameter53Value = Values::NONE, string $parameter54Name = Values::NONE, string $parameter54Value = Values::NONE, string $parameter55Name = Values::NONE, string $parameter55Value = Values::NONE, string $parameter56Name = Values::NONE, string $parameter56Value = Values::NONE, string $parameter57Name = Values::NONE, string $parameter57Value = Values::NONE, string $parameter58Name = Values::NONE, string $parameter58Value = Values::NONE, string $parameter59Name = Values::NONE, string $parameter59Value = Values::NONE, string $parameter60Name = Values::NONE, string $parameter60Value = Values::NONE, string $parameter61Name = Values::NONE, string $parameter61Value = Values::NONE, string $parameter62Name = Values::NONE, string $parameter62Value = Values::NONE, string $parameter63Name = Values::NONE, string $parameter63Value = Values::NONE, string $parameter64Name = Values::NONE, string $parameter64Value = Values::NONE, string $parameter65Name = Values::NONE, string $parameter65Value = Values::NONE, string $parameter66Name = Values::NONE, string $parameter66Value = Values::NONE, string $parameter67Name = Values::NONE, string $parameter67Value = Values::NONE, string $parameter68Name = Values::NONE, string $parameter68Value = Values::NONE, string $parameter69Name = Values::NONE, string $parameter69Value = Values::NONE, string $parameter70Name = Values::NONE, string $parameter70Value = Values::NONE, string $parameter71Name = Values::NONE, string $parameter71Value = Values::NONE, string $parameter72Name = Values::NONE, string $parameter72Value = Values::NONE, string $parameter73Name = Values::NONE, string $parameter73Value = Values::NONE, string $parameter74Name = Values::NONE, string $parameter74Value = Values::NONE, string $parameter75Name = Values::NONE, string $parameter75Value = Values::NONE, string $parameter76Name = Values::NONE, string $parameter76Value = Values::NONE, string $parameter77Name = Values::NONE, string $parameter77Value = Values::NONE, string $parameter78Name = Values::NONE, string $parameter78Value = Values::NONE, string $parameter79Name = Values::NONE, string $parameter79Value = Values::NONE, string $parameter80Name = Values::NONE, string $parameter80Value = Values::NONE, string $parameter81Name = Values::NONE, string $parameter81Value = Values::NONE, string $parameter82Name = Values::NONE, string $parameter82Value = Values::NONE, string $parameter83Name = Values::NONE, string $parameter83Value = Values::NONE, string $parameter84Name = Values::NONE, string $parameter84Value = Values::NONE, string $parameter85Name = Values::NONE, string $parameter85Value = Values::NONE, string $parameter86Name = Values::NONE, string $parameter86Value = Values::NONE, string $parameter87Name = Values::NONE, string $parameter87Value = Values::NONE, string $parameter88Name = Values::NONE, string $parameter88Value = Values::NONE, string $parameter89Name = Values::NONE, string $parameter89Value = Values::NONE, string $parameter90Name = Values::NONE, string $parameter90Value = Values::NONE, string $parameter91Name = Values::NONE, string $parameter91Value = Values::NONE, string $parameter92Name = Values::NONE, string $parameter92Value = Values::NONE, string $parameter93Name = Values::NONE, string $parameter93Value = Values::NONE, string $parameter94Name = Values::NONE, string $parameter94Value = Values::NONE, string $parameter95Name = Values::NONE, string $parameter95Value = Values::NONE, string $parameter96Name = Values::NONE, string $parameter96Value = Values::NONE, string $parameter97Name = Values::NONE, string $parameter97Value = Values::NONE, string $parameter98Name = Values::NONE, string $parameter98Value = Values::NONE, string $parameter99Name = Values::NONE, string $parameter99Value = Values::NONE ) { $this->options['name'] = $name; $this->options['track'] = $track; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['parameter1Name'] = $parameter1Name; $this->options['parameter1Value'] = $parameter1Value; $this->options['parameter2Name'] = $parameter2Name; $this->options['parameter2Value'] = $parameter2Value; $this->options['parameter3Name'] = $parameter3Name; $this->options['parameter3Value'] = $parameter3Value; $this->options['parameter4Name'] = $parameter4Name; $this->options['parameter4Value'] = $parameter4Value; $this->options['parameter5Name'] = $parameter5Name; $this->options['parameter5Value'] = $parameter5Value; $this->options['parameter6Name'] = $parameter6Name; $this->options['parameter6Value'] = $parameter6Value; $this->options['parameter7Name'] = $parameter7Name; $this->options['parameter7Value'] = $parameter7Value; $this->options['parameter8Name'] = $parameter8Name; $this->options['parameter8Value'] = $parameter8Value; $this->options['parameter9Name'] = $parameter9Name; $this->options['parameter9Value'] = $parameter9Value; $this->options['parameter10Name'] = $parameter10Name; $this->options['parameter10Value'] = $parameter10Value; $this->options['parameter11Name'] = $parameter11Name; $this->options['parameter11Value'] = $parameter11Value; $this->options['parameter12Name'] = $parameter12Name; $this->options['parameter12Value'] = $parameter12Value; $this->options['parameter13Name'] = $parameter13Name; $this->options['parameter13Value'] = $parameter13Value; $this->options['parameter14Name'] = $parameter14Name; $this->options['parameter14Value'] = $parameter14Value; $this->options['parameter15Name'] = $parameter15Name; $this->options['parameter15Value'] = $parameter15Value; $this->options['parameter16Name'] = $parameter16Name; $this->options['parameter16Value'] = $parameter16Value; $this->options['parameter17Name'] = $parameter17Name; $this->options['parameter17Value'] = $parameter17Value; $this->options['parameter18Name'] = $parameter18Name; $this->options['parameter18Value'] = $parameter18Value; $this->options['parameter19Name'] = $parameter19Name; $this->options['parameter19Value'] = $parameter19Value; $this->options['parameter20Name'] = $parameter20Name; $this->options['parameter20Value'] = $parameter20Value; $this->options['parameter21Name'] = $parameter21Name; $this->options['parameter21Value'] = $parameter21Value; $this->options['parameter22Name'] = $parameter22Name; $this->options['parameter22Value'] = $parameter22Value; $this->options['parameter23Name'] = $parameter23Name; $this->options['parameter23Value'] = $parameter23Value; $this->options['parameter24Name'] = $parameter24Name; $this->options['parameter24Value'] = $parameter24Value; $this->options['parameter25Name'] = $parameter25Name; $this->options['parameter25Value'] = $parameter25Value; $this->options['parameter26Name'] = $parameter26Name; $this->options['parameter26Value'] = $parameter26Value; $this->options['parameter27Name'] = $parameter27Name; $this->options['parameter27Value'] = $parameter27Value; $this->options['parameter28Name'] = $parameter28Name; $this->options['parameter28Value'] = $parameter28Value; $this->options['parameter29Name'] = $parameter29Name; $this->options['parameter29Value'] = $parameter29Value; $this->options['parameter30Name'] = $parameter30Name; $this->options['parameter30Value'] = $parameter30Value; $this->options['parameter31Name'] = $parameter31Name; $this->options['parameter31Value'] = $parameter31Value; $this->options['parameter32Name'] = $parameter32Name; $this->options['parameter32Value'] = $parameter32Value; $this->options['parameter33Name'] = $parameter33Name; $this->options['parameter33Value'] = $parameter33Value; $this->options['parameter34Name'] = $parameter34Name; $this->options['parameter34Value'] = $parameter34Value; $this->options['parameter35Name'] = $parameter35Name; $this->options['parameter35Value'] = $parameter35Value; $this->options['parameter36Name'] = $parameter36Name; $this->options['parameter36Value'] = $parameter36Value; $this->options['parameter37Name'] = $parameter37Name; $this->options['parameter37Value'] = $parameter37Value; $this->options['parameter38Name'] = $parameter38Name; $this->options['parameter38Value'] = $parameter38Value; $this->options['parameter39Name'] = $parameter39Name; $this->options['parameter39Value'] = $parameter39Value; $this->options['parameter40Name'] = $parameter40Name; $this->options['parameter40Value'] = $parameter40Value; $this->options['parameter41Name'] = $parameter41Name; $this->options['parameter41Value'] = $parameter41Value; $this->options['parameter42Name'] = $parameter42Name; $this->options['parameter42Value'] = $parameter42Value; $this->options['parameter43Name'] = $parameter43Name; $this->options['parameter43Value'] = $parameter43Value; $this->options['parameter44Name'] = $parameter44Name; $this->options['parameter44Value'] = $parameter44Value; $this->options['parameter45Name'] = $parameter45Name; $this->options['parameter45Value'] = $parameter45Value; $this->options['parameter46Name'] = $parameter46Name; $this->options['parameter46Value'] = $parameter46Value; $this->options['parameter47Name'] = $parameter47Name; $this->options['parameter47Value'] = $parameter47Value; $this->options['parameter48Name'] = $parameter48Name; $this->options['parameter48Value'] = $parameter48Value; $this->options['parameter49Name'] = $parameter49Name; $this->options['parameter49Value'] = $parameter49Value; $this->options['parameter50Name'] = $parameter50Name; $this->options['parameter50Value'] = $parameter50Value; $this->options['parameter51Name'] = $parameter51Name; $this->options['parameter51Value'] = $parameter51Value; $this->options['parameter52Name'] = $parameter52Name; $this->options['parameter52Value'] = $parameter52Value; $this->options['parameter53Name'] = $parameter53Name; $this->options['parameter53Value'] = $parameter53Value; $this->options['parameter54Name'] = $parameter54Name; $this->options['parameter54Value'] = $parameter54Value; $this->options['parameter55Name'] = $parameter55Name; $this->options['parameter55Value'] = $parameter55Value; $this->options['parameter56Name'] = $parameter56Name; $this->options['parameter56Value'] = $parameter56Value; $this->options['parameter57Name'] = $parameter57Name; $this->options['parameter57Value'] = $parameter57Value; $this->options['parameter58Name'] = $parameter58Name; $this->options['parameter58Value'] = $parameter58Value; $this->options['parameter59Name'] = $parameter59Name; $this->options['parameter59Value'] = $parameter59Value; $this->options['parameter60Name'] = $parameter60Name; $this->options['parameter60Value'] = $parameter60Value; $this->options['parameter61Name'] = $parameter61Name; $this->options['parameter61Value'] = $parameter61Value; $this->options['parameter62Name'] = $parameter62Name; $this->options['parameter62Value'] = $parameter62Value; $this->options['parameter63Name'] = $parameter63Name; $this->options['parameter63Value'] = $parameter63Value; $this->options['parameter64Name'] = $parameter64Name; $this->options['parameter64Value'] = $parameter64Value; $this->options['parameter65Name'] = $parameter65Name; $this->options['parameter65Value'] = $parameter65Value; $this->options['parameter66Name'] = $parameter66Name; $this->options['parameter66Value'] = $parameter66Value; $this->options['parameter67Name'] = $parameter67Name; $this->options['parameter67Value'] = $parameter67Value; $this->options['parameter68Name'] = $parameter68Name; $this->options['parameter68Value'] = $parameter68Value; $this->options['parameter69Name'] = $parameter69Name; $this->options['parameter69Value'] = $parameter69Value; $this->options['parameter70Name'] = $parameter70Name; $this->options['parameter70Value'] = $parameter70Value; $this->options['parameter71Name'] = $parameter71Name; $this->options['parameter71Value'] = $parameter71Value; $this->options['parameter72Name'] = $parameter72Name; $this->options['parameter72Value'] = $parameter72Value; $this->options['parameter73Name'] = $parameter73Name; $this->options['parameter73Value'] = $parameter73Value; $this->options['parameter74Name'] = $parameter74Name; $this->options['parameter74Value'] = $parameter74Value; $this->options['parameter75Name'] = $parameter75Name; $this->options['parameter75Value'] = $parameter75Value; $this->options['parameter76Name'] = $parameter76Name; $this->options['parameter76Value'] = $parameter76Value; $this->options['parameter77Name'] = $parameter77Name; $this->options['parameter77Value'] = $parameter77Value; $this->options['parameter78Name'] = $parameter78Name; $this->options['parameter78Value'] = $parameter78Value; $this->options['parameter79Name'] = $parameter79Name; $this->options['parameter79Value'] = $parameter79Value; $this->options['parameter80Name'] = $parameter80Name; $this->options['parameter80Value'] = $parameter80Value; $this->options['parameter81Name'] = $parameter81Name; $this->options['parameter81Value'] = $parameter81Value; $this->options['parameter82Name'] = $parameter82Name; $this->options['parameter82Value'] = $parameter82Value; $this->options['parameter83Name'] = $parameter83Name; $this->options['parameter83Value'] = $parameter83Value; $this->options['parameter84Name'] = $parameter84Name; $this->options['parameter84Value'] = $parameter84Value; $this->options['parameter85Name'] = $parameter85Name; $this->options['parameter85Value'] = $parameter85Value; $this->options['parameter86Name'] = $parameter86Name; $this->options['parameter86Value'] = $parameter86Value; $this->options['parameter87Name'] = $parameter87Name; $this->options['parameter87Value'] = $parameter87Value; $this->options['parameter88Name'] = $parameter88Name; $this->options['parameter88Value'] = $parameter88Value; $this->options['parameter89Name'] = $parameter89Name; $this->options['parameter89Value'] = $parameter89Value; $this->options['parameter90Name'] = $parameter90Name; $this->options['parameter90Value'] = $parameter90Value; $this->options['parameter91Name'] = $parameter91Name; $this->options['parameter91Value'] = $parameter91Value; $this->options['parameter92Name'] = $parameter92Name; $this->options['parameter92Value'] = $parameter92Value; $this->options['parameter93Name'] = $parameter93Name; $this->options['parameter93Value'] = $parameter93Value; $this->options['parameter94Name'] = $parameter94Name; $this->options['parameter94Value'] = $parameter94Value; $this->options['parameter95Name'] = $parameter95Name; $this->options['parameter95Value'] = $parameter95Value; $this->options['parameter96Name'] = $parameter96Name; $this->options['parameter96Value'] = $parameter96Value; $this->options['parameter97Name'] = $parameter97Name; $this->options['parameter97Value'] = $parameter97Value; $this->options['parameter98Name'] = $parameter98Name; $this->options['parameter98Value'] = $parameter98Value; $this->options['parameter99Name'] = $parameter99Name; $this->options['parameter99Value'] = $parameter99Value; } /** * The user-specified name of this Stream, if one was given when the Stream was created. This may be used to stop the Stream. * * @param string $name The user-specified name of this Stream, if one was given when the Stream was created. This may be used to stop the Stream. * @return $this Fluent Builder */ public function setName(string $name): self { $this->options['name'] = $name; return $this; } /** * @param string $track * @return $this Fluent Builder */ public function setTrack(string $track): self { $this->options['track'] = $track; return $this; } /** * Absolute URL of the status callback. * * @param string $statusCallback Absolute URL of the status callback. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The http method for the status_callback (one of GET, POST). * * @param string $statusCallbackMethod The http method for the status_callback (one of GET, POST). * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Parameter name * * @param string $parameter1Name Parameter name * @return $this Fluent Builder */ public function setParameter1Name(string $parameter1Name): self { $this->options['parameter1Name'] = $parameter1Name; return $this; } /** * Parameter value * * @param string $parameter1Value Parameter value * @return $this Fluent Builder */ public function setParameter1Value(string $parameter1Value): self { $this->options['parameter1Value'] = $parameter1Value; return $this; } /** * Parameter name * * @param string $parameter2Name Parameter name * @return $this Fluent Builder */ public function setParameter2Name(string $parameter2Name): self { $this->options['parameter2Name'] = $parameter2Name; return $this; } /** * Parameter value * * @param string $parameter2Value Parameter value * @return $this Fluent Builder */ public function setParameter2Value(string $parameter2Value): self { $this->options['parameter2Value'] = $parameter2Value; return $this; } /** * Parameter name * * @param string $parameter3Name Parameter name * @return $this Fluent Builder */ public function setParameter3Name(string $parameter3Name): self { $this->options['parameter3Name'] = $parameter3Name; return $this; } /** * Parameter value * * @param string $parameter3Value Parameter value * @return $this Fluent Builder */ public function setParameter3Value(string $parameter3Value): self { $this->options['parameter3Value'] = $parameter3Value; return $this; } /** * Parameter name * * @param string $parameter4Name Parameter name * @return $this Fluent Builder */ public function setParameter4Name(string $parameter4Name): self { $this->options['parameter4Name'] = $parameter4Name; return $this; } /** * Parameter value * * @param string $parameter4Value Parameter value * @return $this Fluent Builder */ public function setParameter4Value(string $parameter4Value): self { $this->options['parameter4Value'] = $parameter4Value; return $this; } /** * Parameter name * * @param string $parameter5Name Parameter name * @return $this Fluent Builder */ public function setParameter5Name(string $parameter5Name): self { $this->options['parameter5Name'] = $parameter5Name; return $this; } /** * Parameter value * * @param string $parameter5Value Parameter value * @return $this Fluent Builder */ public function setParameter5Value(string $parameter5Value): self { $this->options['parameter5Value'] = $parameter5Value; return $this; } /** * Parameter name * * @param string $parameter6Name Parameter name * @return $this Fluent Builder */ public function setParameter6Name(string $parameter6Name): self { $this->options['parameter6Name'] = $parameter6Name; return $this; } /** * Parameter value * * @param string $parameter6Value Parameter value * @return $this Fluent Builder */ public function setParameter6Value(string $parameter6Value): self { $this->options['parameter6Value'] = $parameter6Value; return $this; } /** * Parameter name * * @param string $parameter7Name Parameter name * @return $this Fluent Builder */ public function setParameter7Name(string $parameter7Name): self { $this->options['parameter7Name'] = $parameter7Name; return $this; } /** * Parameter value * * @param string $parameter7Value Parameter value * @return $this Fluent Builder */ public function setParameter7Value(string $parameter7Value): self { $this->options['parameter7Value'] = $parameter7Value; return $this; } /** * Parameter name * * @param string $parameter8Name Parameter name * @return $this Fluent Builder */ public function setParameter8Name(string $parameter8Name): self { $this->options['parameter8Name'] = $parameter8Name; return $this; } /** * Parameter value * * @param string $parameter8Value Parameter value * @return $this Fluent Builder */ public function setParameter8Value(string $parameter8Value): self { $this->options['parameter8Value'] = $parameter8Value; return $this; } /** * Parameter name * * @param string $parameter9Name Parameter name * @return $this Fluent Builder */ public function setParameter9Name(string $parameter9Name): self { $this->options['parameter9Name'] = $parameter9Name; return $this; } /** * Parameter value * * @param string $parameter9Value Parameter value * @return $this Fluent Builder */ public function setParameter9Value(string $parameter9Value): self { $this->options['parameter9Value'] = $parameter9Value; return $this; } /** * Parameter name * * @param string $parameter10Name Parameter name * @return $this Fluent Builder */ public function setParameter10Name(string $parameter10Name): self { $this->options['parameter10Name'] = $parameter10Name; return $this; } /** * Parameter value * * @param string $parameter10Value Parameter value * @return $this Fluent Builder */ public function setParameter10Value(string $parameter10Value): self { $this->options['parameter10Value'] = $parameter10Value; return $this; } /** * Parameter name * * @param string $parameter11Name Parameter name * @return $this Fluent Builder */ public function setParameter11Name(string $parameter11Name): self { $this->options['parameter11Name'] = $parameter11Name; return $this; } /** * Parameter value * * @param string $parameter11Value Parameter value * @return $this Fluent Builder */ public function setParameter11Value(string $parameter11Value): self { $this->options['parameter11Value'] = $parameter11Value; return $this; } /** * Parameter name * * @param string $parameter12Name Parameter name * @return $this Fluent Builder */ public function setParameter12Name(string $parameter12Name): self { $this->options['parameter12Name'] = $parameter12Name; return $this; } /** * Parameter value * * @param string $parameter12Value Parameter value * @return $this Fluent Builder */ public function setParameter12Value(string $parameter12Value): self { $this->options['parameter12Value'] = $parameter12Value; return $this; } /** * Parameter name * * @param string $parameter13Name Parameter name * @return $this Fluent Builder */ public function setParameter13Name(string $parameter13Name): self { $this->options['parameter13Name'] = $parameter13Name; return $this; } /** * Parameter value * * @param string $parameter13Value Parameter value * @return $this Fluent Builder */ public function setParameter13Value(string $parameter13Value): self { $this->options['parameter13Value'] = $parameter13Value; return $this; } /** * Parameter name * * @param string $parameter14Name Parameter name * @return $this Fluent Builder */ public function setParameter14Name(string $parameter14Name): self { $this->options['parameter14Name'] = $parameter14Name; return $this; } /** * Parameter value * * @param string $parameter14Value Parameter value * @return $this Fluent Builder */ public function setParameter14Value(string $parameter14Value): self { $this->options['parameter14Value'] = $parameter14Value; return $this; } /** * Parameter name * * @param string $parameter15Name Parameter name * @return $this Fluent Builder */ public function setParameter15Name(string $parameter15Name): self { $this->options['parameter15Name'] = $parameter15Name; return $this; } /** * Parameter value * * @param string $parameter15Value Parameter value * @return $this Fluent Builder */ public function setParameter15Value(string $parameter15Value): self { $this->options['parameter15Value'] = $parameter15Value; return $this; } /** * Parameter name * * @param string $parameter16Name Parameter name * @return $this Fluent Builder */ public function setParameter16Name(string $parameter16Name): self { $this->options['parameter16Name'] = $parameter16Name; return $this; } /** * Parameter value * * @param string $parameter16Value Parameter value * @return $this Fluent Builder */ public function setParameter16Value(string $parameter16Value): self { $this->options['parameter16Value'] = $parameter16Value; return $this; } /** * Parameter name * * @param string $parameter17Name Parameter name * @return $this Fluent Builder */ public function setParameter17Name(string $parameter17Name): self { $this->options['parameter17Name'] = $parameter17Name; return $this; } /** * Parameter value * * @param string $parameter17Value Parameter value * @return $this Fluent Builder */ public function setParameter17Value(string $parameter17Value): self { $this->options['parameter17Value'] = $parameter17Value; return $this; } /** * Parameter name * * @param string $parameter18Name Parameter name * @return $this Fluent Builder */ public function setParameter18Name(string $parameter18Name): self { $this->options['parameter18Name'] = $parameter18Name; return $this; } /** * Parameter value * * @param string $parameter18Value Parameter value * @return $this Fluent Builder */ public function setParameter18Value(string $parameter18Value): self { $this->options['parameter18Value'] = $parameter18Value; return $this; } /** * Parameter name * * @param string $parameter19Name Parameter name * @return $this Fluent Builder */ public function setParameter19Name(string $parameter19Name): self { $this->options['parameter19Name'] = $parameter19Name; return $this; } /** * Parameter value * * @param string $parameter19Value Parameter value * @return $this Fluent Builder */ public function setParameter19Value(string $parameter19Value): self { $this->options['parameter19Value'] = $parameter19Value; return $this; } /** * Parameter name * * @param string $parameter20Name Parameter name * @return $this Fluent Builder */ public function setParameter20Name(string $parameter20Name): self { $this->options['parameter20Name'] = $parameter20Name; return $this; } /** * Parameter value * * @param string $parameter20Value Parameter value * @return $this Fluent Builder */ public function setParameter20Value(string $parameter20Value): self { $this->options['parameter20Value'] = $parameter20Value; return $this; } /** * Parameter name * * @param string $parameter21Name Parameter name * @return $this Fluent Builder */ public function setParameter21Name(string $parameter21Name): self { $this->options['parameter21Name'] = $parameter21Name; return $this; } /** * Parameter value * * @param string $parameter21Value Parameter value * @return $this Fluent Builder */ public function setParameter21Value(string $parameter21Value): self { $this->options['parameter21Value'] = $parameter21Value; return $this; } /** * Parameter name * * @param string $parameter22Name Parameter name * @return $this Fluent Builder */ public function setParameter22Name(string $parameter22Name): self { $this->options['parameter22Name'] = $parameter22Name; return $this; } /** * Parameter value * * @param string $parameter22Value Parameter value * @return $this Fluent Builder */ public function setParameter22Value(string $parameter22Value): self { $this->options['parameter22Value'] = $parameter22Value; return $this; } /** * Parameter name * * @param string $parameter23Name Parameter name * @return $this Fluent Builder */ public function setParameter23Name(string $parameter23Name): self { $this->options['parameter23Name'] = $parameter23Name; return $this; } /** * Parameter value * * @param string $parameter23Value Parameter value * @return $this Fluent Builder */ public function setParameter23Value(string $parameter23Value): self { $this->options['parameter23Value'] = $parameter23Value; return $this; } /** * Parameter name * * @param string $parameter24Name Parameter name * @return $this Fluent Builder */ public function setParameter24Name(string $parameter24Name): self { $this->options['parameter24Name'] = $parameter24Name; return $this; } /** * Parameter value * * @param string $parameter24Value Parameter value * @return $this Fluent Builder */ public function setParameter24Value(string $parameter24Value): self { $this->options['parameter24Value'] = $parameter24Value; return $this; } /** * Parameter name * * @param string $parameter25Name Parameter name * @return $this Fluent Builder */ public function setParameter25Name(string $parameter25Name): self { $this->options['parameter25Name'] = $parameter25Name; return $this; } /** * Parameter value * * @param string $parameter25Value Parameter value * @return $this Fluent Builder */ public function setParameter25Value(string $parameter25Value): self { $this->options['parameter25Value'] = $parameter25Value; return $this; } /** * Parameter name * * @param string $parameter26Name Parameter name * @return $this Fluent Builder */ public function setParameter26Name(string $parameter26Name): self { $this->options['parameter26Name'] = $parameter26Name; return $this; } /** * Parameter value * * @param string $parameter26Value Parameter value * @return $this Fluent Builder */ public function setParameter26Value(string $parameter26Value): self { $this->options['parameter26Value'] = $parameter26Value; return $this; } /** * Parameter name * * @param string $parameter27Name Parameter name * @return $this Fluent Builder */ public function setParameter27Name(string $parameter27Name): self { $this->options['parameter27Name'] = $parameter27Name; return $this; } /** * Parameter value * * @param string $parameter27Value Parameter value * @return $this Fluent Builder */ public function setParameter27Value(string $parameter27Value): self { $this->options['parameter27Value'] = $parameter27Value; return $this; } /** * Parameter name * * @param string $parameter28Name Parameter name * @return $this Fluent Builder */ public function setParameter28Name(string $parameter28Name): self { $this->options['parameter28Name'] = $parameter28Name; return $this; } /** * Parameter value * * @param string $parameter28Value Parameter value * @return $this Fluent Builder */ public function setParameter28Value(string $parameter28Value): self { $this->options['parameter28Value'] = $parameter28Value; return $this; } /** * Parameter name * * @param string $parameter29Name Parameter name * @return $this Fluent Builder */ public function setParameter29Name(string $parameter29Name): self { $this->options['parameter29Name'] = $parameter29Name; return $this; } /** * Parameter value * * @param string $parameter29Value Parameter value * @return $this Fluent Builder */ public function setParameter29Value(string $parameter29Value): self { $this->options['parameter29Value'] = $parameter29Value; return $this; } /** * Parameter name * * @param string $parameter30Name Parameter name * @return $this Fluent Builder */ public function setParameter30Name(string $parameter30Name): self { $this->options['parameter30Name'] = $parameter30Name; return $this; } /** * Parameter value * * @param string $parameter30Value Parameter value * @return $this Fluent Builder */ public function setParameter30Value(string $parameter30Value): self { $this->options['parameter30Value'] = $parameter30Value; return $this; } /** * Parameter name * * @param string $parameter31Name Parameter name * @return $this Fluent Builder */ public function setParameter31Name(string $parameter31Name): self { $this->options['parameter31Name'] = $parameter31Name; return $this; } /** * Parameter value * * @param string $parameter31Value Parameter value * @return $this Fluent Builder */ public function setParameter31Value(string $parameter31Value): self { $this->options['parameter31Value'] = $parameter31Value; return $this; } /** * Parameter name * * @param string $parameter32Name Parameter name * @return $this Fluent Builder */ public function setParameter32Name(string $parameter32Name): self { $this->options['parameter32Name'] = $parameter32Name; return $this; } /** * Parameter value * * @param string $parameter32Value Parameter value * @return $this Fluent Builder */ public function setParameter32Value(string $parameter32Value): self { $this->options['parameter32Value'] = $parameter32Value; return $this; } /** * Parameter name * * @param string $parameter33Name Parameter name * @return $this Fluent Builder */ public function setParameter33Name(string $parameter33Name): self { $this->options['parameter33Name'] = $parameter33Name; return $this; } /** * Parameter value * * @param string $parameter33Value Parameter value * @return $this Fluent Builder */ public function setParameter33Value(string $parameter33Value): self { $this->options['parameter33Value'] = $parameter33Value; return $this; } /** * Parameter name * * @param string $parameter34Name Parameter name * @return $this Fluent Builder */ public function setParameter34Name(string $parameter34Name): self { $this->options['parameter34Name'] = $parameter34Name; return $this; } /** * Parameter value * * @param string $parameter34Value Parameter value * @return $this Fluent Builder */ public function setParameter34Value(string $parameter34Value): self { $this->options['parameter34Value'] = $parameter34Value; return $this; } /** * Parameter name * * @param string $parameter35Name Parameter name * @return $this Fluent Builder */ public function setParameter35Name(string $parameter35Name): self { $this->options['parameter35Name'] = $parameter35Name; return $this; } /** * Parameter value * * @param string $parameter35Value Parameter value * @return $this Fluent Builder */ public function setParameter35Value(string $parameter35Value): self { $this->options['parameter35Value'] = $parameter35Value; return $this; } /** * Parameter name * * @param string $parameter36Name Parameter name * @return $this Fluent Builder */ public function setParameter36Name(string $parameter36Name): self { $this->options['parameter36Name'] = $parameter36Name; return $this; } /** * Parameter value * * @param string $parameter36Value Parameter value * @return $this Fluent Builder */ public function setParameter36Value(string $parameter36Value): self { $this->options['parameter36Value'] = $parameter36Value; return $this; } /** * Parameter name * * @param string $parameter37Name Parameter name * @return $this Fluent Builder */ public function setParameter37Name(string $parameter37Name): self { $this->options['parameter37Name'] = $parameter37Name; return $this; } /** * Parameter value * * @param string $parameter37Value Parameter value * @return $this Fluent Builder */ public function setParameter37Value(string $parameter37Value): self { $this->options['parameter37Value'] = $parameter37Value; return $this; } /** * Parameter name * * @param string $parameter38Name Parameter name * @return $this Fluent Builder */ public function setParameter38Name(string $parameter38Name): self { $this->options['parameter38Name'] = $parameter38Name; return $this; } /** * Parameter value * * @param string $parameter38Value Parameter value * @return $this Fluent Builder */ public function setParameter38Value(string $parameter38Value): self { $this->options['parameter38Value'] = $parameter38Value; return $this; } /** * Parameter name * * @param string $parameter39Name Parameter name * @return $this Fluent Builder */ public function setParameter39Name(string $parameter39Name): self { $this->options['parameter39Name'] = $parameter39Name; return $this; } /** * Parameter value * * @param string $parameter39Value Parameter value * @return $this Fluent Builder */ public function setParameter39Value(string $parameter39Value): self { $this->options['parameter39Value'] = $parameter39Value; return $this; } /** * Parameter name * * @param string $parameter40Name Parameter name * @return $this Fluent Builder */ public function setParameter40Name(string $parameter40Name): self { $this->options['parameter40Name'] = $parameter40Name; return $this; } /** * Parameter value * * @param string $parameter40Value Parameter value * @return $this Fluent Builder */ public function setParameter40Value(string $parameter40Value): self { $this->options['parameter40Value'] = $parameter40Value; return $this; } /** * Parameter name * * @param string $parameter41Name Parameter name * @return $this Fluent Builder */ public function setParameter41Name(string $parameter41Name): self { $this->options['parameter41Name'] = $parameter41Name; return $this; } /** * Parameter value * * @param string $parameter41Value Parameter value * @return $this Fluent Builder */ public function setParameter41Value(string $parameter41Value): self { $this->options['parameter41Value'] = $parameter41Value; return $this; } /** * Parameter name * * @param string $parameter42Name Parameter name * @return $this Fluent Builder */ public function setParameter42Name(string $parameter42Name): self { $this->options['parameter42Name'] = $parameter42Name; return $this; } /** * Parameter value * * @param string $parameter42Value Parameter value * @return $this Fluent Builder */ public function setParameter42Value(string $parameter42Value): self { $this->options['parameter42Value'] = $parameter42Value; return $this; } /** * Parameter name * * @param string $parameter43Name Parameter name * @return $this Fluent Builder */ public function setParameter43Name(string $parameter43Name): self { $this->options['parameter43Name'] = $parameter43Name; return $this; } /** * Parameter value * * @param string $parameter43Value Parameter value * @return $this Fluent Builder */ public function setParameter43Value(string $parameter43Value): self { $this->options['parameter43Value'] = $parameter43Value; return $this; } /** * Parameter name * * @param string $parameter44Name Parameter name * @return $this Fluent Builder */ public function setParameter44Name(string $parameter44Name): self { $this->options['parameter44Name'] = $parameter44Name; return $this; } /** * Parameter value * * @param string $parameter44Value Parameter value * @return $this Fluent Builder */ public function setParameter44Value(string $parameter44Value): self { $this->options['parameter44Value'] = $parameter44Value; return $this; } /** * Parameter name * * @param string $parameter45Name Parameter name * @return $this Fluent Builder */ public function setParameter45Name(string $parameter45Name): self { $this->options['parameter45Name'] = $parameter45Name; return $this; } /** * Parameter value * * @param string $parameter45Value Parameter value * @return $this Fluent Builder */ public function setParameter45Value(string $parameter45Value): self { $this->options['parameter45Value'] = $parameter45Value; return $this; } /** * Parameter name * * @param string $parameter46Name Parameter name * @return $this Fluent Builder */ public function setParameter46Name(string $parameter46Name): self { $this->options['parameter46Name'] = $parameter46Name; return $this; } /** * Parameter value * * @param string $parameter46Value Parameter value * @return $this Fluent Builder */ public function setParameter46Value(string $parameter46Value): self { $this->options['parameter46Value'] = $parameter46Value; return $this; } /** * Parameter name * * @param string $parameter47Name Parameter name * @return $this Fluent Builder */ public function setParameter47Name(string $parameter47Name): self { $this->options['parameter47Name'] = $parameter47Name; return $this; } /** * Parameter value * * @param string $parameter47Value Parameter value * @return $this Fluent Builder */ public function setParameter47Value(string $parameter47Value): self { $this->options['parameter47Value'] = $parameter47Value; return $this; } /** * Parameter name * * @param string $parameter48Name Parameter name * @return $this Fluent Builder */ public function setParameter48Name(string $parameter48Name): self { $this->options['parameter48Name'] = $parameter48Name; return $this; } /** * Parameter value * * @param string $parameter48Value Parameter value * @return $this Fluent Builder */ public function setParameter48Value(string $parameter48Value): self { $this->options['parameter48Value'] = $parameter48Value; return $this; } /** * Parameter name * * @param string $parameter49Name Parameter name * @return $this Fluent Builder */ public function setParameter49Name(string $parameter49Name): self { $this->options['parameter49Name'] = $parameter49Name; return $this; } /** * Parameter value * * @param string $parameter49Value Parameter value * @return $this Fluent Builder */ public function setParameter49Value(string $parameter49Value): self { $this->options['parameter49Value'] = $parameter49Value; return $this; } /** * Parameter name * * @param string $parameter50Name Parameter name * @return $this Fluent Builder */ public function setParameter50Name(string $parameter50Name): self { $this->options['parameter50Name'] = $parameter50Name; return $this; } /** * Parameter value * * @param string $parameter50Value Parameter value * @return $this Fluent Builder */ public function setParameter50Value(string $parameter50Value): self { $this->options['parameter50Value'] = $parameter50Value; return $this; } /** * Parameter name * * @param string $parameter51Name Parameter name * @return $this Fluent Builder */ public function setParameter51Name(string $parameter51Name): self { $this->options['parameter51Name'] = $parameter51Name; return $this; } /** * Parameter value * * @param string $parameter51Value Parameter value * @return $this Fluent Builder */ public function setParameter51Value(string $parameter51Value): self { $this->options['parameter51Value'] = $parameter51Value; return $this; } /** * Parameter name * * @param string $parameter52Name Parameter name * @return $this Fluent Builder */ public function setParameter52Name(string $parameter52Name): self { $this->options['parameter52Name'] = $parameter52Name; return $this; } /** * Parameter value * * @param string $parameter52Value Parameter value * @return $this Fluent Builder */ public function setParameter52Value(string $parameter52Value): self { $this->options['parameter52Value'] = $parameter52Value; return $this; } /** * Parameter name * * @param string $parameter53Name Parameter name * @return $this Fluent Builder */ public function setParameter53Name(string $parameter53Name): self { $this->options['parameter53Name'] = $parameter53Name; return $this; } /** * Parameter value * * @param string $parameter53Value Parameter value * @return $this Fluent Builder */ public function setParameter53Value(string $parameter53Value): self { $this->options['parameter53Value'] = $parameter53Value; return $this; } /** * Parameter name * * @param string $parameter54Name Parameter name * @return $this Fluent Builder */ public function setParameter54Name(string $parameter54Name): self { $this->options['parameter54Name'] = $parameter54Name; return $this; } /** * Parameter value * * @param string $parameter54Value Parameter value * @return $this Fluent Builder */ public function setParameter54Value(string $parameter54Value): self { $this->options['parameter54Value'] = $parameter54Value; return $this; } /** * Parameter name * * @param string $parameter55Name Parameter name * @return $this Fluent Builder */ public function setParameter55Name(string $parameter55Name): self { $this->options['parameter55Name'] = $parameter55Name; return $this; } /** * Parameter value * * @param string $parameter55Value Parameter value * @return $this Fluent Builder */ public function setParameter55Value(string $parameter55Value): self { $this->options['parameter55Value'] = $parameter55Value; return $this; } /** * Parameter name * * @param string $parameter56Name Parameter name * @return $this Fluent Builder */ public function setParameter56Name(string $parameter56Name): self { $this->options['parameter56Name'] = $parameter56Name; return $this; } /** * Parameter value * * @param string $parameter56Value Parameter value * @return $this Fluent Builder */ public function setParameter56Value(string $parameter56Value): self { $this->options['parameter56Value'] = $parameter56Value; return $this; } /** * Parameter name * * @param string $parameter57Name Parameter name * @return $this Fluent Builder */ public function setParameter57Name(string $parameter57Name): self { $this->options['parameter57Name'] = $parameter57Name; return $this; } /** * Parameter value * * @param string $parameter57Value Parameter value * @return $this Fluent Builder */ public function setParameter57Value(string $parameter57Value): self { $this->options['parameter57Value'] = $parameter57Value; return $this; } /** * Parameter name * * @param string $parameter58Name Parameter name * @return $this Fluent Builder */ public function setParameter58Name(string $parameter58Name): self { $this->options['parameter58Name'] = $parameter58Name; return $this; } /** * Parameter value * * @param string $parameter58Value Parameter value * @return $this Fluent Builder */ public function setParameter58Value(string $parameter58Value): self { $this->options['parameter58Value'] = $parameter58Value; return $this; } /** * Parameter name * * @param string $parameter59Name Parameter name * @return $this Fluent Builder */ public function setParameter59Name(string $parameter59Name): self { $this->options['parameter59Name'] = $parameter59Name; return $this; } /** * Parameter value * * @param string $parameter59Value Parameter value * @return $this Fluent Builder */ public function setParameter59Value(string $parameter59Value): self { $this->options['parameter59Value'] = $parameter59Value; return $this; } /** * Parameter name * * @param string $parameter60Name Parameter name * @return $this Fluent Builder */ public function setParameter60Name(string $parameter60Name): self { $this->options['parameter60Name'] = $parameter60Name; return $this; } /** * Parameter value * * @param string $parameter60Value Parameter value * @return $this Fluent Builder */ public function setParameter60Value(string $parameter60Value): self { $this->options['parameter60Value'] = $parameter60Value; return $this; } /** * Parameter name * * @param string $parameter61Name Parameter name * @return $this Fluent Builder */ public function setParameter61Name(string $parameter61Name): self { $this->options['parameter61Name'] = $parameter61Name; return $this; } /** * Parameter value * * @param string $parameter61Value Parameter value * @return $this Fluent Builder */ public function setParameter61Value(string $parameter61Value): self { $this->options['parameter61Value'] = $parameter61Value; return $this; } /** * Parameter name * * @param string $parameter62Name Parameter name * @return $this Fluent Builder */ public function setParameter62Name(string $parameter62Name): self { $this->options['parameter62Name'] = $parameter62Name; return $this; } /** * Parameter value * * @param string $parameter62Value Parameter value * @return $this Fluent Builder */ public function setParameter62Value(string $parameter62Value): self { $this->options['parameter62Value'] = $parameter62Value; return $this; } /** * Parameter name * * @param string $parameter63Name Parameter name * @return $this Fluent Builder */ public function setParameter63Name(string $parameter63Name): self { $this->options['parameter63Name'] = $parameter63Name; return $this; } /** * Parameter value * * @param string $parameter63Value Parameter value * @return $this Fluent Builder */ public function setParameter63Value(string $parameter63Value): self { $this->options['parameter63Value'] = $parameter63Value; return $this; } /** * Parameter name * * @param string $parameter64Name Parameter name * @return $this Fluent Builder */ public function setParameter64Name(string $parameter64Name): self { $this->options['parameter64Name'] = $parameter64Name; return $this; } /** * Parameter value * * @param string $parameter64Value Parameter value * @return $this Fluent Builder */ public function setParameter64Value(string $parameter64Value): self { $this->options['parameter64Value'] = $parameter64Value; return $this; } /** * Parameter name * * @param string $parameter65Name Parameter name * @return $this Fluent Builder */ public function setParameter65Name(string $parameter65Name): self { $this->options['parameter65Name'] = $parameter65Name; return $this; } /** * Parameter value * * @param string $parameter65Value Parameter value * @return $this Fluent Builder */ public function setParameter65Value(string $parameter65Value): self { $this->options['parameter65Value'] = $parameter65Value; return $this; } /** * Parameter name * * @param string $parameter66Name Parameter name * @return $this Fluent Builder */ public function setParameter66Name(string $parameter66Name): self { $this->options['parameter66Name'] = $parameter66Name; return $this; } /** * Parameter value * * @param string $parameter66Value Parameter value * @return $this Fluent Builder */ public function setParameter66Value(string $parameter66Value): self { $this->options['parameter66Value'] = $parameter66Value; return $this; } /** * Parameter name * * @param string $parameter67Name Parameter name * @return $this Fluent Builder */ public function setParameter67Name(string $parameter67Name): self { $this->options['parameter67Name'] = $parameter67Name; return $this; } /** * Parameter value * * @param string $parameter67Value Parameter value * @return $this Fluent Builder */ public function setParameter67Value(string $parameter67Value): self { $this->options['parameter67Value'] = $parameter67Value; return $this; } /** * Parameter name * * @param string $parameter68Name Parameter name * @return $this Fluent Builder */ public function setParameter68Name(string $parameter68Name): self { $this->options['parameter68Name'] = $parameter68Name; return $this; } /** * Parameter value * * @param string $parameter68Value Parameter value * @return $this Fluent Builder */ public function setParameter68Value(string $parameter68Value): self { $this->options['parameter68Value'] = $parameter68Value; return $this; } /** * Parameter name * * @param string $parameter69Name Parameter name * @return $this Fluent Builder */ public function setParameter69Name(string $parameter69Name): self { $this->options['parameter69Name'] = $parameter69Name; return $this; } /** * Parameter value * * @param string $parameter69Value Parameter value * @return $this Fluent Builder */ public function setParameter69Value(string $parameter69Value): self { $this->options['parameter69Value'] = $parameter69Value; return $this; } /** * Parameter name * * @param string $parameter70Name Parameter name * @return $this Fluent Builder */ public function setParameter70Name(string $parameter70Name): self { $this->options['parameter70Name'] = $parameter70Name; return $this; } /** * Parameter value * * @param string $parameter70Value Parameter value * @return $this Fluent Builder */ public function setParameter70Value(string $parameter70Value): self { $this->options['parameter70Value'] = $parameter70Value; return $this; } /** * Parameter name * * @param string $parameter71Name Parameter name * @return $this Fluent Builder */ public function setParameter71Name(string $parameter71Name): self { $this->options['parameter71Name'] = $parameter71Name; return $this; } /** * Parameter value * * @param string $parameter71Value Parameter value * @return $this Fluent Builder */ public function setParameter71Value(string $parameter71Value): self { $this->options['parameter71Value'] = $parameter71Value; return $this; } /** * Parameter name * * @param string $parameter72Name Parameter name * @return $this Fluent Builder */ public function setParameter72Name(string $parameter72Name): self { $this->options['parameter72Name'] = $parameter72Name; return $this; } /** * Parameter value * * @param string $parameter72Value Parameter value * @return $this Fluent Builder */ public function setParameter72Value(string $parameter72Value): self { $this->options['parameter72Value'] = $parameter72Value; return $this; } /** * Parameter name * * @param string $parameter73Name Parameter name * @return $this Fluent Builder */ public function setParameter73Name(string $parameter73Name): self { $this->options['parameter73Name'] = $parameter73Name; return $this; } /** * Parameter value * * @param string $parameter73Value Parameter value * @return $this Fluent Builder */ public function setParameter73Value(string $parameter73Value): self { $this->options['parameter73Value'] = $parameter73Value; return $this; } /** * Parameter name * * @param string $parameter74Name Parameter name * @return $this Fluent Builder */ public function setParameter74Name(string $parameter74Name): self { $this->options['parameter74Name'] = $parameter74Name; return $this; } /** * Parameter value * * @param string $parameter74Value Parameter value * @return $this Fluent Builder */ public function setParameter74Value(string $parameter74Value): self { $this->options['parameter74Value'] = $parameter74Value; return $this; } /** * Parameter name * * @param string $parameter75Name Parameter name * @return $this Fluent Builder */ public function setParameter75Name(string $parameter75Name): self { $this->options['parameter75Name'] = $parameter75Name; return $this; } /** * Parameter value * * @param string $parameter75Value Parameter value * @return $this Fluent Builder */ public function setParameter75Value(string $parameter75Value): self { $this->options['parameter75Value'] = $parameter75Value; return $this; } /** * Parameter name * * @param string $parameter76Name Parameter name * @return $this Fluent Builder */ public function setParameter76Name(string $parameter76Name): self { $this->options['parameter76Name'] = $parameter76Name; return $this; } /** * Parameter value * * @param string $parameter76Value Parameter value * @return $this Fluent Builder */ public function setParameter76Value(string $parameter76Value): self { $this->options['parameter76Value'] = $parameter76Value; return $this; } /** * Parameter name * * @param string $parameter77Name Parameter name * @return $this Fluent Builder */ public function setParameter77Name(string $parameter77Name): self { $this->options['parameter77Name'] = $parameter77Name; return $this; } /** * Parameter value * * @param string $parameter77Value Parameter value * @return $this Fluent Builder */ public function setParameter77Value(string $parameter77Value): self { $this->options['parameter77Value'] = $parameter77Value; return $this; } /** * Parameter name * * @param string $parameter78Name Parameter name * @return $this Fluent Builder */ public function setParameter78Name(string $parameter78Name): self { $this->options['parameter78Name'] = $parameter78Name; return $this; } /** * Parameter value * * @param string $parameter78Value Parameter value * @return $this Fluent Builder */ public function setParameter78Value(string $parameter78Value): self { $this->options['parameter78Value'] = $parameter78Value; return $this; } /** * Parameter name * * @param string $parameter79Name Parameter name * @return $this Fluent Builder */ public function setParameter79Name(string $parameter79Name): self { $this->options['parameter79Name'] = $parameter79Name; return $this; } /** * Parameter value * * @param string $parameter79Value Parameter value * @return $this Fluent Builder */ public function setParameter79Value(string $parameter79Value): self { $this->options['parameter79Value'] = $parameter79Value; return $this; } /** * Parameter name * * @param string $parameter80Name Parameter name * @return $this Fluent Builder */ public function setParameter80Name(string $parameter80Name): self { $this->options['parameter80Name'] = $parameter80Name; return $this; } /** * Parameter value * * @param string $parameter80Value Parameter value * @return $this Fluent Builder */ public function setParameter80Value(string $parameter80Value): self { $this->options['parameter80Value'] = $parameter80Value; return $this; } /** * Parameter name * * @param string $parameter81Name Parameter name * @return $this Fluent Builder */ public function setParameter81Name(string $parameter81Name): self { $this->options['parameter81Name'] = $parameter81Name; return $this; } /** * Parameter value * * @param string $parameter81Value Parameter value * @return $this Fluent Builder */ public function setParameter81Value(string $parameter81Value): self { $this->options['parameter81Value'] = $parameter81Value; return $this; } /** * Parameter name * * @param string $parameter82Name Parameter name * @return $this Fluent Builder */ public function setParameter82Name(string $parameter82Name): self { $this->options['parameter82Name'] = $parameter82Name; return $this; } /** * Parameter value * * @param string $parameter82Value Parameter value * @return $this Fluent Builder */ public function setParameter82Value(string $parameter82Value): self { $this->options['parameter82Value'] = $parameter82Value; return $this; } /** * Parameter name * * @param string $parameter83Name Parameter name * @return $this Fluent Builder */ public function setParameter83Name(string $parameter83Name): self { $this->options['parameter83Name'] = $parameter83Name; return $this; } /** * Parameter value * * @param string $parameter83Value Parameter value * @return $this Fluent Builder */ public function setParameter83Value(string $parameter83Value): self { $this->options['parameter83Value'] = $parameter83Value; return $this; } /** * Parameter name * * @param string $parameter84Name Parameter name * @return $this Fluent Builder */ public function setParameter84Name(string $parameter84Name): self { $this->options['parameter84Name'] = $parameter84Name; return $this; } /** * Parameter value * * @param string $parameter84Value Parameter value * @return $this Fluent Builder */ public function setParameter84Value(string $parameter84Value): self { $this->options['parameter84Value'] = $parameter84Value; return $this; } /** * Parameter name * * @param string $parameter85Name Parameter name * @return $this Fluent Builder */ public function setParameter85Name(string $parameter85Name): self { $this->options['parameter85Name'] = $parameter85Name; return $this; } /** * Parameter value * * @param string $parameter85Value Parameter value * @return $this Fluent Builder */ public function setParameter85Value(string $parameter85Value): self { $this->options['parameter85Value'] = $parameter85Value; return $this; } /** * Parameter name * * @param string $parameter86Name Parameter name * @return $this Fluent Builder */ public function setParameter86Name(string $parameter86Name): self { $this->options['parameter86Name'] = $parameter86Name; return $this; } /** * Parameter value * * @param string $parameter86Value Parameter value * @return $this Fluent Builder */ public function setParameter86Value(string $parameter86Value): self { $this->options['parameter86Value'] = $parameter86Value; return $this; } /** * Parameter name * * @param string $parameter87Name Parameter name * @return $this Fluent Builder */ public function setParameter87Name(string $parameter87Name): self { $this->options['parameter87Name'] = $parameter87Name; return $this; } /** * Parameter value * * @param string $parameter87Value Parameter value * @return $this Fluent Builder */ public function setParameter87Value(string $parameter87Value): self { $this->options['parameter87Value'] = $parameter87Value; return $this; } /** * Parameter name * * @param string $parameter88Name Parameter name * @return $this Fluent Builder */ public function setParameter88Name(string $parameter88Name): self { $this->options['parameter88Name'] = $parameter88Name; return $this; } /** * Parameter value * * @param string $parameter88Value Parameter value * @return $this Fluent Builder */ public function setParameter88Value(string $parameter88Value): self { $this->options['parameter88Value'] = $parameter88Value; return $this; } /** * Parameter name * * @param string $parameter89Name Parameter name * @return $this Fluent Builder */ public function setParameter89Name(string $parameter89Name): self { $this->options['parameter89Name'] = $parameter89Name; return $this; } /** * Parameter value * * @param string $parameter89Value Parameter value * @return $this Fluent Builder */ public function setParameter89Value(string $parameter89Value): self { $this->options['parameter89Value'] = $parameter89Value; return $this; } /** * Parameter name * * @param string $parameter90Name Parameter name * @return $this Fluent Builder */ public function setParameter90Name(string $parameter90Name): self { $this->options['parameter90Name'] = $parameter90Name; return $this; } /** * Parameter value * * @param string $parameter90Value Parameter value * @return $this Fluent Builder */ public function setParameter90Value(string $parameter90Value): self { $this->options['parameter90Value'] = $parameter90Value; return $this; } /** * Parameter name * * @param string $parameter91Name Parameter name * @return $this Fluent Builder */ public function setParameter91Name(string $parameter91Name): self { $this->options['parameter91Name'] = $parameter91Name; return $this; } /** * Parameter value * * @param string $parameter91Value Parameter value * @return $this Fluent Builder */ public function setParameter91Value(string $parameter91Value): self { $this->options['parameter91Value'] = $parameter91Value; return $this; } /** * Parameter name * * @param string $parameter92Name Parameter name * @return $this Fluent Builder */ public function setParameter92Name(string $parameter92Name): self { $this->options['parameter92Name'] = $parameter92Name; return $this; } /** * Parameter value * * @param string $parameter92Value Parameter value * @return $this Fluent Builder */ public function setParameter92Value(string $parameter92Value): self { $this->options['parameter92Value'] = $parameter92Value; return $this; } /** * Parameter name * * @param string $parameter93Name Parameter name * @return $this Fluent Builder */ public function setParameter93Name(string $parameter93Name): self { $this->options['parameter93Name'] = $parameter93Name; return $this; } /** * Parameter value * * @param string $parameter93Value Parameter value * @return $this Fluent Builder */ public function setParameter93Value(string $parameter93Value): self { $this->options['parameter93Value'] = $parameter93Value; return $this; } /** * Parameter name * * @param string $parameter94Name Parameter name * @return $this Fluent Builder */ public function setParameter94Name(string $parameter94Name): self { $this->options['parameter94Name'] = $parameter94Name; return $this; } /** * Parameter value * * @param string $parameter94Value Parameter value * @return $this Fluent Builder */ public function setParameter94Value(string $parameter94Value): self { $this->options['parameter94Value'] = $parameter94Value; return $this; } /** * Parameter name * * @param string $parameter95Name Parameter name * @return $this Fluent Builder */ public function setParameter95Name(string $parameter95Name): self { $this->options['parameter95Name'] = $parameter95Name; return $this; } /** * Parameter value * * @param string $parameter95Value Parameter value * @return $this Fluent Builder */ public function setParameter95Value(string $parameter95Value): self { $this->options['parameter95Value'] = $parameter95Value; return $this; } /** * Parameter name * * @param string $parameter96Name Parameter name * @return $this Fluent Builder */ public function setParameter96Name(string $parameter96Name): self { $this->options['parameter96Name'] = $parameter96Name; return $this; } /** * Parameter value * * @param string $parameter96Value Parameter value * @return $this Fluent Builder */ public function setParameter96Value(string $parameter96Value): self { $this->options['parameter96Value'] = $parameter96Value; return $this; } /** * Parameter name * * @param string $parameter97Name Parameter name * @return $this Fluent Builder */ public function setParameter97Name(string $parameter97Name): self { $this->options['parameter97Name'] = $parameter97Name; return $this; } /** * Parameter value * * @param string $parameter97Value Parameter value * @return $this Fluent Builder */ public function setParameter97Value(string $parameter97Value): self { $this->options['parameter97Value'] = $parameter97Value; return $this; } /** * Parameter name * * @param string $parameter98Name Parameter name * @return $this Fluent Builder */ public function setParameter98Name(string $parameter98Name): self { $this->options['parameter98Name'] = $parameter98Name; return $this; } /** * Parameter value * * @param string $parameter98Value Parameter value * @return $this Fluent Builder */ public function setParameter98Value(string $parameter98Value): self { $this->options['parameter98Value'] = $parameter98Value; return $this; } /** * Parameter name * * @param string $parameter99Name Parameter name * @return $this Fluent Builder */ public function setParameter99Name(string $parameter99Name): self { $this->options['parameter99Name'] = $parameter99Name; return $this; } /** * Parameter value * * @param string $parameter99Value Parameter value * @return $this Fluent Builder */ public function setParameter99Value(string $parameter99Value): self { $this->options['parameter99Value'] = $parameter99Value; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateStreamOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventList.php 0000644 00000012172 15021223077 0016420 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class EventList extends ListResource { /** * Construct the EventList * * @param Version $version Version that contains the resource * @param string $accountSid The unique SID identifier of the Account. * @param string $callSid The unique SID identifier of the Call. */ public function __construct( Version $version, string $accountSid, string $callSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Events.json'; } /** * Reads EventInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EventInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams EventInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EventInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EventPage Page of EventInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EventPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EventPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EventInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EventPage Page of EventInstance */ public function getPage(string $targetUrl): EventPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EventPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.EventList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/EventPage.php 0000644 00000003120 15021223077 0016352 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EventPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return EventInstance \Twilio\Rest\Api\V2010\Account\Call\EventInstance */ public function buildInstance(array $payload): EventInstance { return new EventInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.EventPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageOptions.php 0000644 00000004477 15021223077 0021572 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class UserDefinedMessageOptions { /** * @param string $idempotencyKey A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. * @return CreateUserDefinedMessageOptions Options builder */ public static function create( string $idempotencyKey = Values::NONE ): CreateUserDefinedMessageOptions { return new CreateUserDefinedMessageOptions( $idempotencyKey ); } } class CreateUserDefinedMessageOptions extends Options { /** * @param string $idempotencyKey A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. */ public function __construct( string $idempotencyKey = Values::NONE ) { $this->options['idempotencyKey'] = $idempotencyKey; } /** * A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. * * @param string $idempotencyKey A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. * @return $this Fluent Builder */ public function setIdempotencyKey(string $idempotencyKey): self { $this->options['idempotencyKey'] = $idempotencyKey; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateUserDefinedMessageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionInstance.php 0000644 00000010352 15021223077 0024275 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $callSid * @property string|null $sid * @property \DateTime|null $dateCreated * @property string|null $uri */ class UserDefinedMessageSubscriptionInstance extends InstanceResource { /** * Initialize the UserDefinedMessageSubscriptionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that subscribed to the User Defined Messages. * @param string $callSid The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User Defined Messages subscription is associated with. This refers to the Call SID that is producing the user defined messages. * @param string $sid The SID that uniquely identifies this User Defined Message Subscription. */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'callSid' => Values::array_get($payload, 'call_sid'), 'sid' => Values::array_get($payload, 'sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserDefinedMessageSubscriptionContext Context for this UserDefinedMessageSubscriptionInstance */ protected function proxy(): UserDefinedMessageSubscriptionContext { if (!$this->context) { $this->context = new UserDefinedMessageSubscriptionContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UserDefinedMessageSubscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.UserDefinedMessageSubscriptionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageInstance.php 0000644 00000005356 15021223077 0021700 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $callSid * @property string|null $sid * @property \DateTime|null $dateCreated */ class UserDefinedMessageInstance extends InstanceResource { /** * Initialize the UserDefinedMessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created User Defined Message. * @param string $callSid The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User Defined Message is associated with. */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'callSid' => Values::array_get($payload, 'call_sid'), 'sid' => Values::array_get($payload, 'sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), ]; $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.UserDefinedMessageInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecInstance.php 0000644 00000010261 15021223077 0017412 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $callSid * @property string|null $name * @property string $status * @property \DateTime|null $dateUpdated * @property string|null $uri */ class SiprecInstance extends InstanceResource { /** * Initialize the SiprecInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Siprec resource. * @param string $callSid The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Siprec resource is associated with. * @param string $sid The SID of the Siprec resource, or the `name` used when creating the resource */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'callSid' => Values::array_get($payload, 'call_sid'), 'name' => Values::array_get($payload, 'name'), 'status' => Values::array_get($payload, 'status'), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SiprecContext Context for this SiprecInstance */ protected function proxy(): SiprecContext { if (!$this->context) { $this->context = new SiprecContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the SiprecInstance * * @param string $status * @return SiprecInstance Updated SiprecInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): SiprecInstance { return $this->proxy()->update($status); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.SiprecInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationOptions.php 0000644 00000015560 15021223077 0020511 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class NotificationOptions { /** * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return ReadNotificationOptions Options builder */ public static function read( int $log = Values::INT_NONE, string $messageDateBefore = null, string $messageDate = null, string $messageDateAfter = null ): ReadNotificationOptions { return new ReadNotificationOptions( $log, $messageDateBefore, $messageDate, $messageDateAfter ); } } class ReadNotificationOptions extends Options { /** * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. */ public function __construct( int $log = Values::INT_NONE, string $messageDateBefore = null, string $messageDate = null, string $messageDateAfter = null ) { $this->options['log'] = $log; $this->options['messageDateBefore'] = $messageDateBefore; $this->options['messageDate'] = $messageDate; $this->options['messageDateAfter'] = $messageDateAfter; } /** * Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * @return $this Fluent Builder */ public function setLog(int $log): self { $this->options['log'] = $log; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return $this Fluent Builder */ public function setMessageDateBefore(string $messageDateBefore): self { $this->options['messageDateBefore'] = $messageDateBefore; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return $this Fluent Builder */ public function setMessageDate(string $messageDate): self { $this->options['messageDate'] = $messageDate; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * @return $this Fluent Builder */ public function setMessageDateAfter(string $messageDateAfter): self { $this->options['messageDateAfter'] = $messageDateAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadNotificationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecOptions.php 0000644 00000362215 15021223077 0017312 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class SiprecOptions { /** * @param string $name The user-specified name of this Siprec, if one was given when the Siprec was created. This may be used to stop the Siprec. * @param string $connectorName Unique name used when configuring the connector via Marketplace Add-on. * @param string $track * @param string $statusCallback Absolute URL of the status callback. * @param string $statusCallbackMethod The http method for the status_callback (one of GET, POST). * @param string $parameter1Name Parameter name * @param string $parameter1Value Parameter value * @param string $parameter2Name Parameter name * @param string $parameter2Value Parameter value * @param string $parameter3Name Parameter name * @param string $parameter3Value Parameter value * @param string $parameter4Name Parameter name * @param string $parameter4Value Parameter value * @param string $parameter5Name Parameter name * @param string $parameter5Value Parameter value * @param string $parameter6Name Parameter name * @param string $parameter6Value Parameter value * @param string $parameter7Name Parameter name * @param string $parameter7Value Parameter value * @param string $parameter8Name Parameter name * @param string $parameter8Value Parameter value * @param string $parameter9Name Parameter name * @param string $parameter9Value Parameter value * @param string $parameter10Name Parameter name * @param string $parameter10Value Parameter value * @param string $parameter11Name Parameter name * @param string $parameter11Value Parameter value * @param string $parameter12Name Parameter name * @param string $parameter12Value Parameter value * @param string $parameter13Name Parameter name * @param string $parameter13Value Parameter value * @param string $parameter14Name Parameter name * @param string $parameter14Value Parameter value * @param string $parameter15Name Parameter name * @param string $parameter15Value Parameter value * @param string $parameter16Name Parameter name * @param string $parameter16Value Parameter value * @param string $parameter17Name Parameter name * @param string $parameter17Value Parameter value * @param string $parameter18Name Parameter name * @param string $parameter18Value Parameter value * @param string $parameter19Name Parameter name * @param string $parameter19Value Parameter value * @param string $parameter20Name Parameter name * @param string $parameter20Value Parameter value * @param string $parameter21Name Parameter name * @param string $parameter21Value Parameter value * @param string $parameter22Name Parameter name * @param string $parameter22Value Parameter value * @param string $parameter23Name Parameter name * @param string $parameter23Value Parameter value * @param string $parameter24Name Parameter name * @param string $parameter24Value Parameter value * @param string $parameter25Name Parameter name * @param string $parameter25Value Parameter value * @param string $parameter26Name Parameter name * @param string $parameter26Value Parameter value * @param string $parameter27Name Parameter name * @param string $parameter27Value Parameter value * @param string $parameter28Name Parameter name * @param string $parameter28Value Parameter value * @param string $parameter29Name Parameter name * @param string $parameter29Value Parameter value * @param string $parameter30Name Parameter name * @param string $parameter30Value Parameter value * @param string $parameter31Name Parameter name * @param string $parameter31Value Parameter value * @param string $parameter32Name Parameter name * @param string $parameter32Value Parameter value * @param string $parameter33Name Parameter name * @param string $parameter33Value Parameter value * @param string $parameter34Name Parameter name * @param string $parameter34Value Parameter value * @param string $parameter35Name Parameter name * @param string $parameter35Value Parameter value * @param string $parameter36Name Parameter name * @param string $parameter36Value Parameter value * @param string $parameter37Name Parameter name * @param string $parameter37Value Parameter value * @param string $parameter38Name Parameter name * @param string $parameter38Value Parameter value * @param string $parameter39Name Parameter name * @param string $parameter39Value Parameter value * @param string $parameter40Name Parameter name * @param string $parameter40Value Parameter value * @param string $parameter41Name Parameter name * @param string $parameter41Value Parameter value * @param string $parameter42Name Parameter name * @param string $parameter42Value Parameter value * @param string $parameter43Name Parameter name * @param string $parameter43Value Parameter value * @param string $parameter44Name Parameter name * @param string $parameter44Value Parameter value * @param string $parameter45Name Parameter name * @param string $parameter45Value Parameter value * @param string $parameter46Name Parameter name * @param string $parameter46Value Parameter value * @param string $parameter47Name Parameter name * @param string $parameter47Value Parameter value * @param string $parameter48Name Parameter name * @param string $parameter48Value Parameter value * @param string $parameter49Name Parameter name * @param string $parameter49Value Parameter value * @param string $parameter50Name Parameter name * @param string $parameter50Value Parameter value * @param string $parameter51Name Parameter name * @param string $parameter51Value Parameter value * @param string $parameter52Name Parameter name * @param string $parameter52Value Parameter value * @param string $parameter53Name Parameter name * @param string $parameter53Value Parameter value * @param string $parameter54Name Parameter name * @param string $parameter54Value Parameter value * @param string $parameter55Name Parameter name * @param string $parameter55Value Parameter value * @param string $parameter56Name Parameter name * @param string $parameter56Value Parameter value * @param string $parameter57Name Parameter name * @param string $parameter57Value Parameter value * @param string $parameter58Name Parameter name * @param string $parameter58Value Parameter value * @param string $parameter59Name Parameter name * @param string $parameter59Value Parameter value * @param string $parameter60Name Parameter name * @param string $parameter60Value Parameter value * @param string $parameter61Name Parameter name * @param string $parameter61Value Parameter value * @param string $parameter62Name Parameter name * @param string $parameter62Value Parameter value * @param string $parameter63Name Parameter name * @param string $parameter63Value Parameter value * @param string $parameter64Name Parameter name * @param string $parameter64Value Parameter value * @param string $parameter65Name Parameter name * @param string $parameter65Value Parameter value * @param string $parameter66Name Parameter name * @param string $parameter66Value Parameter value * @param string $parameter67Name Parameter name * @param string $parameter67Value Parameter value * @param string $parameter68Name Parameter name * @param string $parameter68Value Parameter value * @param string $parameter69Name Parameter name * @param string $parameter69Value Parameter value * @param string $parameter70Name Parameter name * @param string $parameter70Value Parameter value * @param string $parameter71Name Parameter name * @param string $parameter71Value Parameter value * @param string $parameter72Name Parameter name * @param string $parameter72Value Parameter value * @param string $parameter73Name Parameter name * @param string $parameter73Value Parameter value * @param string $parameter74Name Parameter name * @param string $parameter74Value Parameter value * @param string $parameter75Name Parameter name * @param string $parameter75Value Parameter value * @param string $parameter76Name Parameter name * @param string $parameter76Value Parameter value * @param string $parameter77Name Parameter name * @param string $parameter77Value Parameter value * @param string $parameter78Name Parameter name * @param string $parameter78Value Parameter value * @param string $parameter79Name Parameter name * @param string $parameter79Value Parameter value * @param string $parameter80Name Parameter name * @param string $parameter80Value Parameter value * @param string $parameter81Name Parameter name * @param string $parameter81Value Parameter value * @param string $parameter82Name Parameter name * @param string $parameter82Value Parameter value * @param string $parameter83Name Parameter name * @param string $parameter83Value Parameter value * @param string $parameter84Name Parameter name * @param string $parameter84Value Parameter value * @param string $parameter85Name Parameter name * @param string $parameter85Value Parameter value * @param string $parameter86Name Parameter name * @param string $parameter86Value Parameter value * @param string $parameter87Name Parameter name * @param string $parameter87Value Parameter value * @param string $parameter88Name Parameter name * @param string $parameter88Value Parameter value * @param string $parameter89Name Parameter name * @param string $parameter89Value Parameter value * @param string $parameter90Name Parameter name * @param string $parameter90Value Parameter value * @param string $parameter91Name Parameter name * @param string $parameter91Value Parameter value * @param string $parameter92Name Parameter name * @param string $parameter92Value Parameter value * @param string $parameter93Name Parameter name * @param string $parameter93Value Parameter value * @param string $parameter94Name Parameter name * @param string $parameter94Value Parameter value * @param string $parameter95Name Parameter name * @param string $parameter95Value Parameter value * @param string $parameter96Name Parameter name * @param string $parameter96Value Parameter value * @param string $parameter97Name Parameter name * @param string $parameter97Value Parameter value * @param string $parameter98Name Parameter name * @param string $parameter98Value Parameter value * @param string $parameter99Name Parameter name * @param string $parameter99Value Parameter value * @return CreateSiprecOptions Options builder */ public static function create( string $name = Values::NONE, string $connectorName = Values::NONE, string $track = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $parameter1Name = Values::NONE, string $parameter1Value = Values::NONE, string $parameter2Name = Values::NONE, string $parameter2Value = Values::NONE, string $parameter3Name = Values::NONE, string $parameter3Value = Values::NONE, string $parameter4Name = Values::NONE, string $parameter4Value = Values::NONE, string $parameter5Name = Values::NONE, string $parameter5Value = Values::NONE, string $parameter6Name = Values::NONE, string $parameter6Value = Values::NONE, string $parameter7Name = Values::NONE, string $parameter7Value = Values::NONE, string $parameter8Name = Values::NONE, string $parameter8Value = Values::NONE, string $parameter9Name = Values::NONE, string $parameter9Value = Values::NONE, string $parameter10Name = Values::NONE, string $parameter10Value = Values::NONE, string $parameter11Name = Values::NONE, string $parameter11Value = Values::NONE, string $parameter12Name = Values::NONE, string $parameter12Value = Values::NONE, string $parameter13Name = Values::NONE, string $parameter13Value = Values::NONE, string $parameter14Name = Values::NONE, string $parameter14Value = Values::NONE, string $parameter15Name = Values::NONE, string $parameter15Value = Values::NONE, string $parameter16Name = Values::NONE, string $parameter16Value = Values::NONE, string $parameter17Name = Values::NONE, string $parameter17Value = Values::NONE, string $parameter18Name = Values::NONE, string $parameter18Value = Values::NONE, string $parameter19Name = Values::NONE, string $parameter19Value = Values::NONE, string $parameter20Name = Values::NONE, string $parameter20Value = Values::NONE, string $parameter21Name = Values::NONE, string $parameter21Value = Values::NONE, string $parameter22Name = Values::NONE, string $parameter22Value = Values::NONE, string $parameter23Name = Values::NONE, string $parameter23Value = Values::NONE, string $parameter24Name = Values::NONE, string $parameter24Value = Values::NONE, string $parameter25Name = Values::NONE, string $parameter25Value = Values::NONE, string $parameter26Name = Values::NONE, string $parameter26Value = Values::NONE, string $parameter27Name = Values::NONE, string $parameter27Value = Values::NONE, string $parameter28Name = Values::NONE, string $parameter28Value = Values::NONE, string $parameter29Name = Values::NONE, string $parameter29Value = Values::NONE, string $parameter30Name = Values::NONE, string $parameter30Value = Values::NONE, string $parameter31Name = Values::NONE, string $parameter31Value = Values::NONE, string $parameter32Name = Values::NONE, string $parameter32Value = Values::NONE, string $parameter33Name = Values::NONE, string $parameter33Value = Values::NONE, string $parameter34Name = Values::NONE, string $parameter34Value = Values::NONE, string $parameter35Name = Values::NONE, string $parameter35Value = Values::NONE, string $parameter36Name = Values::NONE, string $parameter36Value = Values::NONE, string $parameter37Name = Values::NONE, string $parameter37Value = Values::NONE, string $parameter38Name = Values::NONE, string $parameter38Value = Values::NONE, string $parameter39Name = Values::NONE, string $parameter39Value = Values::NONE, string $parameter40Name = Values::NONE, string $parameter40Value = Values::NONE, string $parameter41Name = Values::NONE, string $parameter41Value = Values::NONE, string $parameter42Name = Values::NONE, string $parameter42Value = Values::NONE, string $parameter43Name = Values::NONE, string $parameter43Value = Values::NONE, string $parameter44Name = Values::NONE, string $parameter44Value = Values::NONE, string $parameter45Name = Values::NONE, string $parameter45Value = Values::NONE, string $parameter46Name = Values::NONE, string $parameter46Value = Values::NONE, string $parameter47Name = Values::NONE, string $parameter47Value = Values::NONE, string $parameter48Name = Values::NONE, string $parameter48Value = Values::NONE, string $parameter49Name = Values::NONE, string $parameter49Value = Values::NONE, string $parameter50Name = Values::NONE, string $parameter50Value = Values::NONE, string $parameter51Name = Values::NONE, string $parameter51Value = Values::NONE, string $parameter52Name = Values::NONE, string $parameter52Value = Values::NONE, string $parameter53Name = Values::NONE, string $parameter53Value = Values::NONE, string $parameter54Name = Values::NONE, string $parameter54Value = Values::NONE, string $parameter55Name = Values::NONE, string $parameter55Value = Values::NONE, string $parameter56Name = Values::NONE, string $parameter56Value = Values::NONE, string $parameter57Name = Values::NONE, string $parameter57Value = Values::NONE, string $parameter58Name = Values::NONE, string $parameter58Value = Values::NONE, string $parameter59Name = Values::NONE, string $parameter59Value = Values::NONE, string $parameter60Name = Values::NONE, string $parameter60Value = Values::NONE, string $parameter61Name = Values::NONE, string $parameter61Value = Values::NONE, string $parameter62Name = Values::NONE, string $parameter62Value = Values::NONE, string $parameter63Name = Values::NONE, string $parameter63Value = Values::NONE, string $parameter64Name = Values::NONE, string $parameter64Value = Values::NONE, string $parameter65Name = Values::NONE, string $parameter65Value = Values::NONE, string $parameter66Name = Values::NONE, string $parameter66Value = Values::NONE, string $parameter67Name = Values::NONE, string $parameter67Value = Values::NONE, string $parameter68Name = Values::NONE, string $parameter68Value = Values::NONE, string $parameter69Name = Values::NONE, string $parameter69Value = Values::NONE, string $parameter70Name = Values::NONE, string $parameter70Value = Values::NONE, string $parameter71Name = Values::NONE, string $parameter71Value = Values::NONE, string $parameter72Name = Values::NONE, string $parameter72Value = Values::NONE, string $parameter73Name = Values::NONE, string $parameter73Value = Values::NONE, string $parameter74Name = Values::NONE, string $parameter74Value = Values::NONE, string $parameter75Name = Values::NONE, string $parameter75Value = Values::NONE, string $parameter76Name = Values::NONE, string $parameter76Value = Values::NONE, string $parameter77Name = Values::NONE, string $parameter77Value = Values::NONE, string $parameter78Name = Values::NONE, string $parameter78Value = Values::NONE, string $parameter79Name = Values::NONE, string $parameter79Value = Values::NONE, string $parameter80Name = Values::NONE, string $parameter80Value = Values::NONE, string $parameter81Name = Values::NONE, string $parameter81Value = Values::NONE, string $parameter82Name = Values::NONE, string $parameter82Value = Values::NONE, string $parameter83Name = Values::NONE, string $parameter83Value = Values::NONE, string $parameter84Name = Values::NONE, string $parameter84Value = Values::NONE, string $parameter85Name = Values::NONE, string $parameter85Value = Values::NONE, string $parameter86Name = Values::NONE, string $parameter86Value = Values::NONE, string $parameter87Name = Values::NONE, string $parameter87Value = Values::NONE, string $parameter88Name = Values::NONE, string $parameter88Value = Values::NONE, string $parameter89Name = Values::NONE, string $parameter89Value = Values::NONE, string $parameter90Name = Values::NONE, string $parameter90Value = Values::NONE, string $parameter91Name = Values::NONE, string $parameter91Value = Values::NONE, string $parameter92Name = Values::NONE, string $parameter92Value = Values::NONE, string $parameter93Name = Values::NONE, string $parameter93Value = Values::NONE, string $parameter94Name = Values::NONE, string $parameter94Value = Values::NONE, string $parameter95Name = Values::NONE, string $parameter95Value = Values::NONE, string $parameter96Name = Values::NONE, string $parameter96Value = Values::NONE, string $parameter97Name = Values::NONE, string $parameter97Value = Values::NONE, string $parameter98Name = Values::NONE, string $parameter98Value = Values::NONE, string $parameter99Name = Values::NONE, string $parameter99Value = Values::NONE ): CreateSiprecOptions { return new CreateSiprecOptions( $name, $connectorName, $track, $statusCallback, $statusCallbackMethod, $parameter1Name, $parameter1Value, $parameter2Name, $parameter2Value, $parameter3Name, $parameter3Value, $parameter4Name, $parameter4Value, $parameter5Name, $parameter5Value, $parameter6Name, $parameter6Value, $parameter7Name, $parameter7Value, $parameter8Name, $parameter8Value, $parameter9Name, $parameter9Value, $parameter10Name, $parameter10Value, $parameter11Name, $parameter11Value, $parameter12Name, $parameter12Value, $parameter13Name, $parameter13Value, $parameter14Name, $parameter14Value, $parameter15Name, $parameter15Value, $parameter16Name, $parameter16Value, $parameter17Name, $parameter17Value, $parameter18Name, $parameter18Value, $parameter19Name, $parameter19Value, $parameter20Name, $parameter20Value, $parameter21Name, $parameter21Value, $parameter22Name, $parameter22Value, $parameter23Name, $parameter23Value, $parameter24Name, $parameter24Value, $parameter25Name, $parameter25Value, $parameter26Name, $parameter26Value, $parameter27Name, $parameter27Value, $parameter28Name, $parameter28Value, $parameter29Name, $parameter29Value, $parameter30Name, $parameter30Value, $parameter31Name, $parameter31Value, $parameter32Name, $parameter32Value, $parameter33Name, $parameter33Value, $parameter34Name, $parameter34Value, $parameter35Name, $parameter35Value, $parameter36Name, $parameter36Value, $parameter37Name, $parameter37Value, $parameter38Name, $parameter38Value, $parameter39Name, $parameter39Value, $parameter40Name, $parameter40Value, $parameter41Name, $parameter41Value, $parameter42Name, $parameter42Value, $parameter43Name, $parameter43Value, $parameter44Name, $parameter44Value, $parameter45Name, $parameter45Value, $parameter46Name, $parameter46Value, $parameter47Name, $parameter47Value, $parameter48Name, $parameter48Value, $parameter49Name, $parameter49Value, $parameter50Name, $parameter50Value, $parameter51Name, $parameter51Value, $parameter52Name, $parameter52Value, $parameter53Name, $parameter53Value, $parameter54Name, $parameter54Value, $parameter55Name, $parameter55Value, $parameter56Name, $parameter56Value, $parameter57Name, $parameter57Value, $parameter58Name, $parameter58Value, $parameter59Name, $parameter59Value, $parameter60Name, $parameter60Value, $parameter61Name, $parameter61Value, $parameter62Name, $parameter62Value, $parameter63Name, $parameter63Value, $parameter64Name, $parameter64Value, $parameter65Name, $parameter65Value, $parameter66Name, $parameter66Value, $parameter67Name, $parameter67Value, $parameter68Name, $parameter68Value, $parameter69Name, $parameter69Value, $parameter70Name, $parameter70Value, $parameter71Name, $parameter71Value, $parameter72Name, $parameter72Value, $parameter73Name, $parameter73Value, $parameter74Name, $parameter74Value, $parameter75Name, $parameter75Value, $parameter76Name, $parameter76Value, $parameter77Name, $parameter77Value, $parameter78Name, $parameter78Value, $parameter79Name, $parameter79Value, $parameter80Name, $parameter80Value, $parameter81Name, $parameter81Value, $parameter82Name, $parameter82Value, $parameter83Name, $parameter83Value, $parameter84Name, $parameter84Value, $parameter85Name, $parameter85Value, $parameter86Name, $parameter86Value, $parameter87Name, $parameter87Value, $parameter88Name, $parameter88Value, $parameter89Name, $parameter89Value, $parameter90Name, $parameter90Value, $parameter91Name, $parameter91Value, $parameter92Name, $parameter92Value, $parameter93Name, $parameter93Value, $parameter94Name, $parameter94Value, $parameter95Name, $parameter95Value, $parameter96Name, $parameter96Value, $parameter97Name, $parameter97Value, $parameter98Name, $parameter98Value, $parameter99Name, $parameter99Value ); } } class CreateSiprecOptions extends Options { /** * @param string $name The user-specified name of this Siprec, if one was given when the Siprec was created. This may be used to stop the Siprec. * @param string $connectorName Unique name used when configuring the connector via Marketplace Add-on. * @param string $track * @param string $statusCallback Absolute URL of the status callback. * @param string $statusCallbackMethod The http method for the status_callback (one of GET, POST). * @param string $parameter1Name Parameter name * @param string $parameter1Value Parameter value * @param string $parameter2Name Parameter name * @param string $parameter2Value Parameter value * @param string $parameter3Name Parameter name * @param string $parameter3Value Parameter value * @param string $parameter4Name Parameter name * @param string $parameter4Value Parameter value * @param string $parameter5Name Parameter name * @param string $parameter5Value Parameter value * @param string $parameter6Name Parameter name * @param string $parameter6Value Parameter value * @param string $parameter7Name Parameter name * @param string $parameter7Value Parameter value * @param string $parameter8Name Parameter name * @param string $parameter8Value Parameter value * @param string $parameter9Name Parameter name * @param string $parameter9Value Parameter value * @param string $parameter10Name Parameter name * @param string $parameter10Value Parameter value * @param string $parameter11Name Parameter name * @param string $parameter11Value Parameter value * @param string $parameter12Name Parameter name * @param string $parameter12Value Parameter value * @param string $parameter13Name Parameter name * @param string $parameter13Value Parameter value * @param string $parameter14Name Parameter name * @param string $parameter14Value Parameter value * @param string $parameter15Name Parameter name * @param string $parameter15Value Parameter value * @param string $parameter16Name Parameter name * @param string $parameter16Value Parameter value * @param string $parameter17Name Parameter name * @param string $parameter17Value Parameter value * @param string $parameter18Name Parameter name * @param string $parameter18Value Parameter value * @param string $parameter19Name Parameter name * @param string $parameter19Value Parameter value * @param string $parameter20Name Parameter name * @param string $parameter20Value Parameter value * @param string $parameter21Name Parameter name * @param string $parameter21Value Parameter value * @param string $parameter22Name Parameter name * @param string $parameter22Value Parameter value * @param string $parameter23Name Parameter name * @param string $parameter23Value Parameter value * @param string $parameter24Name Parameter name * @param string $parameter24Value Parameter value * @param string $parameter25Name Parameter name * @param string $parameter25Value Parameter value * @param string $parameter26Name Parameter name * @param string $parameter26Value Parameter value * @param string $parameter27Name Parameter name * @param string $parameter27Value Parameter value * @param string $parameter28Name Parameter name * @param string $parameter28Value Parameter value * @param string $parameter29Name Parameter name * @param string $parameter29Value Parameter value * @param string $parameter30Name Parameter name * @param string $parameter30Value Parameter value * @param string $parameter31Name Parameter name * @param string $parameter31Value Parameter value * @param string $parameter32Name Parameter name * @param string $parameter32Value Parameter value * @param string $parameter33Name Parameter name * @param string $parameter33Value Parameter value * @param string $parameter34Name Parameter name * @param string $parameter34Value Parameter value * @param string $parameter35Name Parameter name * @param string $parameter35Value Parameter value * @param string $parameter36Name Parameter name * @param string $parameter36Value Parameter value * @param string $parameter37Name Parameter name * @param string $parameter37Value Parameter value * @param string $parameter38Name Parameter name * @param string $parameter38Value Parameter value * @param string $parameter39Name Parameter name * @param string $parameter39Value Parameter value * @param string $parameter40Name Parameter name * @param string $parameter40Value Parameter value * @param string $parameter41Name Parameter name * @param string $parameter41Value Parameter value * @param string $parameter42Name Parameter name * @param string $parameter42Value Parameter value * @param string $parameter43Name Parameter name * @param string $parameter43Value Parameter value * @param string $parameter44Name Parameter name * @param string $parameter44Value Parameter value * @param string $parameter45Name Parameter name * @param string $parameter45Value Parameter value * @param string $parameter46Name Parameter name * @param string $parameter46Value Parameter value * @param string $parameter47Name Parameter name * @param string $parameter47Value Parameter value * @param string $parameter48Name Parameter name * @param string $parameter48Value Parameter value * @param string $parameter49Name Parameter name * @param string $parameter49Value Parameter value * @param string $parameter50Name Parameter name * @param string $parameter50Value Parameter value * @param string $parameter51Name Parameter name * @param string $parameter51Value Parameter value * @param string $parameter52Name Parameter name * @param string $parameter52Value Parameter value * @param string $parameter53Name Parameter name * @param string $parameter53Value Parameter value * @param string $parameter54Name Parameter name * @param string $parameter54Value Parameter value * @param string $parameter55Name Parameter name * @param string $parameter55Value Parameter value * @param string $parameter56Name Parameter name * @param string $parameter56Value Parameter value * @param string $parameter57Name Parameter name * @param string $parameter57Value Parameter value * @param string $parameter58Name Parameter name * @param string $parameter58Value Parameter value * @param string $parameter59Name Parameter name * @param string $parameter59Value Parameter value * @param string $parameter60Name Parameter name * @param string $parameter60Value Parameter value * @param string $parameter61Name Parameter name * @param string $parameter61Value Parameter value * @param string $parameter62Name Parameter name * @param string $parameter62Value Parameter value * @param string $parameter63Name Parameter name * @param string $parameter63Value Parameter value * @param string $parameter64Name Parameter name * @param string $parameter64Value Parameter value * @param string $parameter65Name Parameter name * @param string $parameter65Value Parameter value * @param string $parameter66Name Parameter name * @param string $parameter66Value Parameter value * @param string $parameter67Name Parameter name * @param string $parameter67Value Parameter value * @param string $parameter68Name Parameter name * @param string $parameter68Value Parameter value * @param string $parameter69Name Parameter name * @param string $parameter69Value Parameter value * @param string $parameter70Name Parameter name * @param string $parameter70Value Parameter value * @param string $parameter71Name Parameter name * @param string $parameter71Value Parameter value * @param string $parameter72Name Parameter name * @param string $parameter72Value Parameter value * @param string $parameter73Name Parameter name * @param string $parameter73Value Parameter value * @param string $parameter74Name Parameter name * @param string $parameter74Value Parameter value * @param string $parameter75Name Parameter name * @param string $parameter75Value Parameter value * @param string $parameter76Name Parameter name * @param string $parameter76Value Parameter value * @param string $parameter77Name Parameter name * @param string $parameter77Value Parameter value * @param string $parameter78Name Parameter name * @param string $parameter78Value Parameter value * @param string $parameter79Name Parameter name * @param string $parameter79Value Parameter value * @param string $parameter80Name Parameter name * @param string $parameter80Value Parameter value * @param string $parameter81Name Parameter name * @param string $parameter81Value Parameter value * @param string $parameter82Name Parameter name * @param string $parameter82Value Parameter value * @param string $parameter83Name Parameter name * @param string $parameter83Value Parameter value * @param string $parameter84Name Parameter name * @param string $parameter84Value Parameter value * @param string $parameter85Name Parameter name * @param string $parameter85Value Parameter value * @param string $parameter86Name Parameter name * @param string $parameter86Value Parameter value * @param string $parameter87Name Parameter name * @param string $parameter87Value Parameter value * @param string $parameter88Name Parameter name * @param string $parameter88Value Parameter value * @param string $parameter89Name Parameter name * @param string $parameter89Value Parameter value * @param string $parameter90Name Parameter name * @param string $parameter90Value Parameter value * @param string $parameter91Name Parameter name * @param string $parameter91Value Parameter value * @param string $parameter92Name Parameter name * @param string $parameter92Value Parameter value * @param string $parameter93Name Parameter name * @param string $parameter93Value Parameter value * @param string $parameter94Name Parameter name * @param string $parameter94Value Parameter value * @param string $parameter95Name Parameter name * @param string $parameter95Value Parameter value * @param string $parameter96Name Parameter name * @param string $parameter96Value Parameter value * @param string $parameter97Name Parameter name * @param string $parameter97Value Parameter value * @param string $parameter98Name Parameter name * @param string $parameter98Value Parameter value * @param string $parameter99Name Parameter name * @param string $parameter99Value Parameter value */ public function __construct( string $name = Values::NONE, string $connectorName = Values::NONE, string $track = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $parameter1Name = Values::NONE, string $parameter1Value = Values::NONE, string $parameter2Name = Values::NONE, string $parameter2Value = Values::NONE, string $parameter3Name = Values::NONE, string $parameter3Value = Values::NONE, string $parameter4Name = Values::NONE, string $parameter4Value = Values::NONE, string $parameter5Name = Values::NONE, string $parameter5Value = Values::NONE, string $parameter6Name = Values::NONE, string $parameter6Value = Values::NONE, string $parameter7Name = Values::NONE, string $parameter7Value = Values::NONE, string $parameter8Name = Values::NONE, string $parameter8Value = Values::NONE, string $parameter9Name = Values::NONE, string $parameter9Value = Values::NONE, string $parameter10Name = Values::NONE, string $parameter10Value = Values::NONE, string $parameter11Name = Values::NONE, string $parameter11Value = Values::NONE, string $parameter12Name = Values::NONE, string $parameter12Value = Values::NONE, string $parameter13Name = Values::NONE, string $parameter13Value = Values::NONE, string $parameter14Name = Values::NONE, string $parameter14Value = Values::NONE, string $parameter15Name = Values::NONE, string $parameter15Value = Values::NONE, string $parameter16Name = Values::NONE, string $parameter16Value = Values::NONE, string $parameter17Name = Values::NONE, string $parameter17Value = Values::NONE, string $parameter18Name = Values::NONE, string $parameter18Value = Values::NONE, string $parameter19Name = Values::NONE, string $parameter19Value = Values::NONE, string $parameter20Name = Values::NONE, string $parameter20Value = Values::NONE, string $parameter21Name = Values::NONE, string $parameter21Value = Values::NONE, string $parameter22Name = Values::NONE, string $parameter22Value = Values::NONE, string $parameter23Name = Values::NONE, string $parameter23Value = Values::NONE, string $parameter24Name = Values::NONE, string $parameter24Value = Values::NONE, string $parameter25Name = Values::NONE, string $parameter25Value = Values::NONE, string $parameter26Name = Values::NONE, string $parameter26Value = Values::NONE, string $parameter27Name = Values::NONE, string $parameter27Value = Values::NONE, string $parameter28Name = Values::NONE, string $parameter28Value = Values::NONE, string $parameter29Name = Values::NONE, string $parameter29Value = Values::NONE, string $parameter30Name = Values::NONE, string $parameter30Value = Values::NONE, string $parameter31Name = Values::NONE, string $parameter31Value = Values::NONE, string $parameter32Name = Values::NONE, string $parameter32Value = Values::NONE, string $parameter33Name = Values::NONE, string $parameter33Value = Values::NONE, string $parameter34Name = Values::NONE, string $parameter34Value = Values::NONE, string $parameter35Name = Values::NONE, string $parameter35Value = Values::NONE, string $parameter36Name = Values::NONE, string $parameter36Value = Values::NONE, string $parameter37Name = Values::NONE, string $parameter37Value = Values::NONE, string $parameter38Name = Values::NONE, string $parameter38Value = Values::NONE, string $parameter39Name = Values::NONE, string $parameter39Value = Values::NONE, string $parameter40Name = Values::NONE, string $parameter40Value = Values::NONE, string $parameter41Name = Values::NONE, string $parameter41Value = Values::NONE, string $parameter42Name = Values::NONE, string $parameter42Value = Values::NONE, string $parameter43Name = Values::NONE, string $parameter43Value = Values::NONE, string $parameter44Name = Values::NONE, string $parameter44Value = Values::NONE, string $parameter45Name = Values::NONE, string $parameter45Value = Values::NONE, string $parameter46Name = Values::NONE, string $parameter46Value = Values::NONE, string $parameter47Name = Values::NONE, string $parameter47Value = Values::NONE, string $parameter48Name = Values::NONE, string $parameter48Value = Values::NONE, string $parameter49Name = Values::NONE, string $parameter49Value = Values::NONE, string $parameter50Name = Values::NONE, string $parameter50Value = Values::NONE, string $parameter51Name = Values::NONE, string $parameter51Value = Values::NONE, string $parameter52Name = Values::NONE, string $parameter52Value = Values::NONE, string $parameter53Name = Values::NONE, string $parameter53Value = Values::NONE, string $parameter54Name = Values::NONE, string $parameter54Value = Values::NONE, string $parameter55Name = Values::NONE, string $parameter55Value = Values::NONE, string $parameter56Name = Values::NONE, string $parameter56Value = Values::NONE, string $parameter57Name = Values::NONE, string $parameter57Value = Values::NONE, string $parameter58Name = Values::NONE, string $parameter58Value = Values::NONE, string $parameter59Name = Values::NONE, string $parameter59Value = Values::NONE, string $parameter60Name = Values::NONE, string $parameter60Value = Values::NONE, string $parameter61Name = Values::NONE, string $parameter61Value = Values::NONE, string $parameter62Name = Values::NONE, string $parameter62Value = Values::NONE, string $parameter63Name = Values::NONE, string $parameter63Value = Values::NONE, string $parameter64Name = Values::NONE, string $parameter64Value = Values::NONE, string $parameter65Name = Values::NONE, string $parameter65Value = Values::NONE, string $parameter66Name = Values::NONE, string $parameter66Value = Values::NONE, string $parameter67Name = Values::NONE, string $parameter67Value = Values::NONE, string $parameter68Name = Values::NONE, string $parameter68Value = Values::NONE, string $parameter69Name = Values::NONE, string $parameter69Value = Values::NONE, string $parameter70Name = Values::NONE, string $parameter70Value = Values::NONE, string $parameter71Name = Values::NONE, string $parameter71Value = Values::NONE, string $parameter72Name = Values::NONE, string $parameter72Value = Values::NONE, string $parameter73Name = Values::NONE, string $parameter73Value = Values::NONE, string $parameter74Name = Values::NONE, string $parameter74Value = Values::NONE, string $parameter75Name = Values::NONE, string $parameter75Value = Values::NONE, string $parameter76Name = Values::NONE, string $parameter76Value = Values::NONE, string $parameter77Name = Values::NONE, string $parameter77Value = Values::NONE, string $parameter78Name = Values::NONE, string $parameter78Value = Values::NONE, string $parameter79Name = Values::NONE, string $parameter79Value = Values::NONE, string $parameter80Name = Values::NONE, string $parameter80Value = Values::NONE, string $parameter81Name = Values::NONE, string $parameter81Value = Values::NONE, string $parameter82Name = Values::NONE, string $parameter82Value = Values::NONE, string $parameter83Name = Values::NONE, string $parameter83Value = Values::NONE, string $parameter84Name = Values::NONE, string $parameter84Value = Values::NONE, string $parameter85Name = Values::NONE, string $parameter85Value = Values::NONE, string $parameter86Name = Values::NONE, string $parameter86Value = Values::NONE, string $parameter87Name = Values::NONE, string $parameter87Value = Values::NONE, string $parameter88Name = Values::NONE, string $parameter88Value = Values::NONE, string $parameter89Name = Values::NONE, string $parameter89Value = Values::NONE, string $parameter90Name = Values::NONE, string $parameter90Value = Values::NONE, string $parameter91Name = Values::NONE, string $parameter91Value = Values::NONE, string $parameter92Name = Values::NONE, string $parameter92Value = Values::NONE, string $parameter93Name = Values::NONE, string $parameter93Value = Values::NONE, string $parameter94Name = Values::NONE, string $parameter94Value = Values::NONE, string $parameter95Name = Values::NONE, string $parameter95Value = Values::NONE, string $parameter96Name = Values::NONE, string $parameter96Value = Values::NONE, string $parameter97Name = Values::NONE, string $parameter97Value = Values::NONE, string $parameter98Name = Values::NONE, string $parameter98Value = Values::NONE, string $parameter99Name = Values::NONE, string $parameter99Value = Values::NONE ) { $this->options['name'] = $name; $this->options['connectorName'] = $connectorName; $this->options['track'] = $track; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['parameter1Name'] = $parameter1Name; $this->options['parameter1Value'] = $parameter1Value; $this->options['parameter2Name'] = $parameter2Name; $this->options['parameter2Value'] = $parameter2Value; $this->options['parameter3Name'] = $parameter3Name; $this->options['parameter3Value'] = $parameter3Value; $this->options['parameter4Name'] = $parameter4Name; $this->options['parameter4Value'] = $parameter4Value; $this->options['parameter5Name'] = $parameter5Name; $this->options['parameter5Value'] = $parameter5Value; $this->options['parameter6Name'] = $parameter6Name; $this->options['parameter6Value'] = $parameter6Value; $this->options['parameter7Name'] = $parameter7Name; $this->options['parameter7Value'] = $parameter7Value; $this->options['parameter8Name'] = $parameter8Name; $this->options['parameter8Value'] = $parameter8Value; $this->options['parameter9Name'] = $parameter9Name; $this->options['parameter9Value'] = $parameter9Value; $this->options['parameter10Name'] = $parameter10Name; $this->options['parameter10Value'] = $parameter10Value; $this->options['parameter11Name'] = $parameter11Name; $this->options['parameter11Value'] = $parameter11Value; $this->options['parameter12Name'] = $parameter12Name; $this->options['parameter12Value'] = $parameter12Value; $this->options['parameter13Name'] = $parameter13Name; $this->options['parameter13Value'] = $parameter13Value; $this->options['parameter14Name'] = $parameter14Name; $this->options['parameter14Value'] = $parameter14Value; $this->options['parameter15Name'] = $parameter15Name; $this->options['parameter15Value'] = $parameter15Value; $this->options['parameter16Name'] = $parameter16Name; $this->options['parameter16Value'] = $parameter16Value; $this->options['parameter17Name'] = $parameter17Name; $this->options['parameter17Value'] = $parameter17Value; $this->options['parameter18Name'] = $parameter18Name; $this->options['parameter18Value'] = $parameter18Value; $this->options['parameter19Name'] = $parameter19Name; $this->options['parameter19Value'] = $parameter19Value; $this->options['parameter20Name'] = $parameter20Name; $this->options['parameter20Value'] = $parameter20Value; $this->options['parameter21Name'] = $parameter21Name; $this->options['parameter21Value'] = $parameter21Value; $this->options['parameter22Name'] = $parameter22Name; $this->options['parameter22Value'] = $parameter22Value; $this->options['parameter23Name'] = $parameter23Name; $this->options['parameter23Value'] = $parameter23Value; $this->options['parameter24Name'] = $parameter24Name; $this->options['parameter24Value'] = $parameter24Value; $this->options['parameter25Name'] = $parameter25Name; $this->options['parameter25Value'] = $parameter25Value; $this->options['parameter26Name'] = $parameter26Name; $this->options['parameter26Value'] = $parameter26Value; $this->options['parameter27Name'] = $parameter27Name; $this->options['parameter27Value'] = $parameter27Value; $this->options['parameter28Name'] = $parameter28Name; $this->options['parameter28Value'] = $parameter28Value; $this->options['parameter29Name'] = $parameter29Name; $this->options['parameter29Value'] = $parameter29Value; $this->options['parameter30Name'] = $parameter30Name; $this->options['parameter30Value'] = $parameter30Value; $this->options['parameter31Name'] = $parameter31Name; $this->options['parameter31Value'] = $parameter31Value; $this->options['parameter32Name'] = $parameter32Name; $this->options['parameter32Value'] = $parameter32Value; $this->options['parameter33Name'] = $parameter33Name; $this->options['parameter33Value'] = $parameter33Value; $this->options['parameter34Name'] = $parameter34Name; $this->options['parameter34Value'] = $parameter34Value; $this->options['parameter35Name'] = $parameter35Name; $this->options['parameter35Value'] = $parameter35Value; $this->options['parameter36Name'] = $parameter36Name; $this->options['parameter36Value'] = $parameter36Value; $this->options['parameter37Name'] = $parameter37Name; $this->options['parameter37Value'] = $parameter37Value; $this->options['parameter38Name'] = $parameter38Name; $this->options['parameter38Value'] = $parameter38Value; $this->options['parameter39Name'] = $parameter39Name; $this->options['parameter39Value'] = $parameter39Value; $this->options['parameter40Name'] = $parameter40Name; $this->options['parameter40Value'] = $parameter40Value; $this->options['parameter41Name'] = $parameter41Name; $this->options['parameter41Value'] = $parameter41Value; $this->options['parameter42Name'] = $parameter42Name; $this->options['parameter42Value'] = $parameter42Value; $this->options['parameter43Name'] = $parameter43Name; $this->options['parameter43Value'] = $parameter43Value; $this->options['parameter44Name'] = $parameter44Name; $this->options['parameter44Value'] = $parameter44Value; $this->options['parameter45Name'] = $parameter45Name; $this->options['parameter45Value'] = $parameter45Value; $this->options['parameter46Name'] = $parameter46Name; $this->options['parameter46Value'] = $parameter46Value; $this->options['parameter47Name'] = $parameter47Name; $this->options['parameter47Value'] = $parameter47Value; $this->options['parameter48Name'] = $parameter48Name; $this->options['parameter48Value'] = $parameter48Value; $this->options['parameter49Name'] = $parameter49Name; $this->options['parameter49Value'] = $parameter49Value; $this->options['parameter50Name'] = $parameter50Name; $this->options['parameter50Value'] = $parameter50Value; $this->options['parameter51Name'] = $parameter51Name; $this->options['parameter51Value'] = $parameter51Value; $this->options['parameter52Name'] = $parameter52Name; $this->options['parameter52Value'] = $parameter52Value; $this->options['parameter53Name'] = $parameter53Name; $this->options['parameter53Value'] = $parameter53Value; $this->options['parameter54Name'] = $parameter54Name; $this->options['parameter54Value'] = $parameter54Value; $this->options['parameter55Name'] = $parameter55Name; $this->options['parameter55Value'] = $parameter55Value; $this->options['parameter56Name'] = $parameter56Name; $this->options['parameter56Value'] = $parameter56Value; $this->options['parameter57Name'] = $parameter57Name; $this->options['parameter57Value'] = $parameter57Value; $this->options['parameter58Name'] = $parameter58Name; $this->options['parameter58Value'] = $parameter58Value; $this->options['parameter59Name'] = $parameter59Name; $this->options['parameter59Value'] = $parameter59Value; $this->options['parameter60Name'] = $parameter60Name; $this->options['parameter60Value'] = $parameter60Value; $this->options['parameter61Name'] = $parameter61Name; $this->options['parameter61Value'] = $parameter61Value; $this->options['parameter62Name'] = $parameter62Name; $this->options['parameter62Value'] = $parameter62Value; $this->options['parameter63Name'] = $parameter63Name; $this->options['parameter63Value'] = $parameter63Value; $this->options['parameter64Name'] = $parameter64Name; $this->options['parameter64Value'] = $parameter64Value; $this->options['parameter65Name'] = $parameter65Name; $this->options['parameter65Value'] = $parameter65Value; $this->options['parameter66Name'] = $parameter66Name; $this->options['parameter66Value'] = $parameter66Value; $this->options['parameter67Name'] = $parameter67Name; $this->options['parameter67Value'] = $parameter67Value; $this->options['parameter68Name'] = $parameter68Name; $this->options['parameter68Value'] = $parameter68Value; $this->options['parameter69Name'] = $parameter69Name; $this->options['parameter69Value'] = $parameter69Value; $this->options['parameter70Name'] = $parameter70Name; $this->options['parameter70Value'] = $parameter70Value; $this->options['parameter71Name'] = $parameter71Name; $this->options['parameter71Value'] = $parameter71Value; $this->options['parameter72Name'] = $parameter72Name; $this->options['parameter72Value'] = $parameter72Value; $this->options['parameter73Name'] = $parameter73Name; $this->options['parameter73Value'] = $parameter73Value; $this->options['parameter74Name'] = $parameter74Name; $this->options['parameter74Value'] = $parameter74Value; $this->options['parameter75Name'] = $parameter75Name; $this->options['parameter75Value'] = $parameter75Value; $this->options['parameter76Name'] = $parameter76Name; $this->options['parameter76Value'] = $parameter76Value; $this->options['parameter77Name'] = $parameter77Name; $this->options['parameter77Value'] = $parameter77Value; $this->options['parameter78Name'] = $parameter78Name; $this->options['parameter78Value'] = $parameter78Value; $this->options['parameter79Name'] = $parameter79Name; $this->options['parameter79Value'] = $parameter79Value; $this->options['parameter80Name'] = $parameter80Name; $this->options['parameter80Value'] = $parameter80Value; $this->options['parameter81Name'] = $parameter81Name; $this->options['parameter81Value'] = $parameter81Value; $this->options['parameter82Name'] = $parameter82Name; $this->options['parameter82Value'] = $parameter82Value; $this->options['parameter83Name'] = $parameter83Name; $this->options['parameter83Value'] = $parameter83Value; $this->options['parameter84Name'] = $parameter84Name; $this->options['parameter84Value'] = $parameter84Value; $this->options['parameter85Name'] = $parameter85Name; $this->options['parameter85Value'] = $parameter85Value; $this->options['parameter86Name'] = $parameter86Name; $this->options['parameter86Value'] = $parameter86Value; $this->options['parameter87Name'] = $parameter87Name; $this->options['parameter87Value'] = $parameter87Value; $this->options['parameter88Name'] = $parameter88Name; $this->options['parameter88Value'] = $parameter88Value; $this->options['parameter89Name'] = $parameter89Name; $this->options['parameter89Value'] = $parameter89Value; $this->options['parameter90Name'] = $parameter90Name; $this->options['parameter90Value'] = $parameter90Value; $this->options['parameter91Name'] = $parameter91Name; $this->options['parameter91Value'] = $parameter91Value; $this->options['parameter92Name'] = $parameter92Name; $this->options['parameter92Value'] = $parameter92Value; $this->options['parameter93Name'] = $parameter93Name; $this->options['parameter93Value'] = $parameter93Value; $this->options['parameter94Name'] = $parameter94Name; $this->options['parameter94Value'] = $parameter94Value; $this->options['parameter95Name'] = $parameter95Name; $this->options['parameter95Value'] = $parameter95Value; $this->options['parameter96Name'] = $parameter96Name; $this->options['parameter96Value'] = $parameter96Value; $this->options['parameter97Name'] = $parameter97Name; $this->options['parameter97Value'] = $parameter97Value; $this->options['parameter98Name'] = $parameter98Name; $this->options['parameter98Value'] = $parameter98Value; $this->options['parameter99Name'] = $parameter99Name; $this->options['parameter99Value'] = $parameter99Value; } /** * The user-specified name of this Siprec, if one was given when the Siprec was created. This may be used to stop the Siprec. * * @param string $name The user-specified name of this Siprec, if one was given when the Siprec was created. This may be used to stop the Siprec. * @return $this Fluent Builder */ public function setName(string $name): self { $this->options['name'] = $name; return $this; } /** * Unique name used when configuring the connector via Marketplace Add-on. * * @param string $connectorName Unique name used when configuring the connector via Marketplace Add-on. * @return $this Fluent Builder */ public function setConnectorName(string $connectorName): self { $this->options['connectorName'] = $connectorName; return $this; } /** * @param string $track * @return $this Fluent Builder */ public function setTrack(string $track): self { $this->options['track'] = $track; return $this; } /** * Absolute URL of the status callback. * * @param string $statusCallback Absolute URL of the status callback. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The http method for the status_callback (one of GET, POST). * * @param string $statusCallbackMethod The http method for the status_callback (one of GET, POST). * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Parameter name * * @param string $parameter1Name Parameter name * @return $this Fluent Builder */ public function setParameter1Name(string $parameter1Name): self { $this->options['parameter1Name'] = $parameter1Name; return $this; } /** * Parameter value * * @param string $parameter1Value Parameter value * @return $this Fluent Builder */ public function setParameter1Value(string $parameter1Value): self { $this->options['parameter1Value'] = $parameter1Value; return $this; } /** * Parameter name * * @param string $parameter2Name Parameter name * @return $this Fluent Builder */ public function setParameter2Name(string $parameter2Name): self { $this->options['parameter2Name'] = $parameter2Name; return $this; } /** * Parameter value * * @param string $parameter2Value Parameter value * @return $this Fluent Builder */ public function setParameter2Value(string $parameter2Value): self { $this->options['parameter2Value'] = $parameter2Value; return $this; } /** * Parameter name * * @param string $parameter3Name Parameter name * @return $this Fluent Builder */ public function setParameter3Name(string $parameter3Name): self { $this->options['parameter3Name'] = $parameter3Name; return $this; } /** * Parameter value * * @param string $parameter3Value Parameter value * @return $this Fluent Builder */ public function setParameter3Value(string $parameter3Value): self { $this->options['parameter3Value'] = $parameter3Value; return $this; } /** * Parameter name * * @param string $parameter4Name Parameter name * @return $this Fluent Builder */ public function setParameter4Name(string $parameter4Name): self { $this->options['parameter4Name'] = $parameter4Name; return $this; } /** * Parameter value * * @param string $parameter4Value Parameter value * @return $this Fluent Builder */ public function setParameter4Value(string $parameter4Value): self { $this->options['parameter4Value'] = $parameter4Value; return $this; } /** * Parameter name * * @param string $parameter5Name Parameter name * @return $this Fluent Builder */ public function setParameter5Name(string $parameter5Name): self { $this->options['parameter5Name'] = $parameter5Name; return $this; } /** * Parameter value * * @param string $parameter5Value Parameter value * @return $this Fluent Builder */ public function setParameter5Value(string $parameter5Value): self { $this->options['parameter5Value'] = $parameter5Value; return $this; } /** * Parameter name * * @param string $parameter6Name Parameter name * @return $this Fluent Builder */ public function setParameter6Name(string $parameter6Name): self { $this->options['parameter6Name'] = $parameter6Name; return $this; } /** * Parameter value * * @param string $parameter6Value Parameter value * @return $this Fluent Builder */ public function setParameter6Value(string $parameter6Value): self { $this->options['parameter6Value'] = $parameter6Value; return $this; } /** * Parameter name * * @param string $parameter7Name Parameter name * @return $this Fluent Builder */ public function setParameter7Name(string $parameter7Name): self { $this->options['parameter7Name'] = $parameter7Name; return $this; } /** * Parameter value * * @param string $parameter7Value Parameter value * @return $this Fluent Builder */ public function setParameter7Value(string $parameter7Value): self { $this->options['parameter7Value'] = $parameter7Value; return $this; } /** * Parameter name * * @param string $parameter8Name Parameter name * @return $this Fluent Builder */ public function setParameter8Name(string $parameter8Name): self { $this->options['parameter8Name'] = $parameter8Name; return $this; } /** * Parameter value * * @param string $parameter8Value Parameter value * @return $this Fluent Builder */ public function setParameter8Value(string $parameter8Value): self { $this->options['parameter8Value'] = $parameter8Value; return $this; } /** * Parameter name * * @param string $parameter9Name Parameter name * @return $this Fluent Builder */ public function setParameter9Name(string $parameter9Name): self { $this->options['parameter9Name'] = $parameter9Name; return $this; } /** * Parameter value * * @param string $parameter9Value Parameter value * @return $this Fluent Builder */ public function setParameter9Value(string $parameter9Value): self { $this->options['parameter9Value'] = $parameter9Value; return $this; } /** * Parameter name * * @param string $parameter10Name Parameter name * @return $this Fluent Builder */ public function setParameter10Name(string $parameter10Name): self { $this->options['parameter10Name'] = $parameter10Name; return $this; } /** * Parameter value * * @param string $parameter10Value Parameter value * @return $this Fluent Builder */ public function setParameter10Value(string $parameter10Value): self { $this->options['parameter10Value'] = $parameter10Value; return $this; } /** * Parameter name * * @param string $parameter11Name Parameter name * @return $this Fluent Builder */ public function setParameter11Name(string $parameter11Name): self { $this->options['parameter11Name'] = $parameter11Name; return $this; } /** * Parameter value * * @param string $parameter11Value Parameter value * @return $this Fluent Builder */ public function setParameter11Value(string $parameter11Value): self { $this->options['parameter11Value'] = $parameter11Value; return $this; } /** * Parameter name * * @param string $parameter12Name Parameter name * @return $this Fluent Builder */ public function setParameter12Name(string $parameter12Name): self { $this->options['parameter12Name'] = $parameter12Name; return $this; } /** * Parameter value * * @param string $parameter12Value Parameter value * @return $this Fluent Builder */ public function setParameter12Value(string $parameter12Value): self { $this->options['parameter12Value'] = $parameter12Value; return $this; } /** * Parameter name * * @param string $parameter13Name Parameter name * @return $this Fluent Builder */ public function setParameter13Name(string $parameter13Name): self { $this->options['parameter13Name'] = $parameter13Name; return $this; } /** * Parameter value * * @param string $parameter13Value Parameter value * @return $this Fluent Builder */ public function setParameter13Value(string $parameter13Value): self { $this->options['parameter13Value'] = $parameter13Value; return $this; } /** * Parameter name * * @param string $parameter14Name Parameter name * @return $this Fluent Builder */ public function setParameter14Name(string $parameter14Name): self { $this->options['parameter14Name'] = $parameter14Name; return $this; } /** * Parameter value * * @param string $parameter14Value Parameter value * @return $this Fluent Builder */ public function setParameter14Value(string $parameter14Value): self { $this->options['parameter14Value'] = $parameter14Value; return $this; } /** * Parameter name * * @param string $parameter15Name Parameter name * @return $this Fluent Builder */ public function setParameter15Name(string $parameter15Name): self { $this->options['parameter15Name'] = $parameter15Name; return $this; } /** * Parameter value * * @param string $parameter15Value Parameter value * @return $this Fluent Builder */ public function setParameter15Value(string $parameter15Value): self { $this->options['parameter15Value'] = $parameter15Value; return $this; } /** * Parameter name * * @param string $parameter16Name Parameter name * @return $this Fluent Builder */ public function setParameter16Name(string $parameter16Name): self { $this->options['parameter16Name'] = $parameter16Name; return $this; } /** * Parameter value * * @param string $parameter16Value Parameter value * @return $this Fluent Builder */ public function setParameter16Value(string $parameter16Value): self { $this->options['parameter16Value'] = $parameter16Value; return $this; } /** * Parameter name * * @param string $parameter17Name Parameter name * @return $this Fluent Builder */ public function setParameter17Name(string $parameter17Name): self { $this->options['parameter17Name'] = $parameter17Name; return $this; } /** * Parameter value * * @param string $parameter17Value Parameter value * @return $this Fluent Builder */ public function setParameter17Value(string $parameter17Value): self { $this->options['parameter17Value'] = $parameter17Value; return $this; } /** * Parameter name * * @param string $parameter18Name Parameter name * @return $this Fluent Builder */ public function setParameter18Name(string $parameter18Name): self { $this->options['parameter18Name'] = $parameter18Name; return $this; } /** * Parameter value * * @param string $parameter18Value Parameter value * @return $this Fluent Builder */ public function setParameter18Value(string $parameter18Value): self { $this->options['parameter18Value'] = $parameter18Value; return $this; } /** * Parameter name * * @param string $parameter19Name Parameter name * @return $this Fluent Builder */ public function setParameter19Name(string $parameter19Name): self { $this->options['parameter19Name'] = $parameter19Name; return $this; } /** * Parameter value * * @param string $parameter19Value Parameter value * @return $this Fluent Builder */ public function setParameter19Value(string $parameter19Value): self { $this->options['parameter19Value'] = $parameter19Value; return $this; } /** * Parameter name * * @param string $parameter20Name Parameter name * @return $this Fluent Builder */ public function setParameter20Name(string $parameter20Name): self { $this->options['parameter20Name'] = $parameter20Name; return $this; } /** * Parameter value * * @param string $parameter20Value Parameter value * @return $this Fluent Builder */ public function setParameter20Value(string $parameter20Value): self { $this->options['parameter20Value'] = $parameter20Value; return $this; } /** * Parameter name * * @param string $parameter21Name Parameter name * @return $this Fluent Builder */ public function setParameter21Name(string $parameter21Name): self { $this->options['parameter21Name'] = $parameter21Name; return $this; } /** * Parameter value * * @param string $parameter21Value Parameter value * @return $this Fluent Builder */ public function setParameter21Value(string $parameter21Value): self { $this->options['parameter21Value'] = $parameter21Value; return $this; } /** * Parameter name * * @param string $parameter22Name Parameter name * @return $this Fluent Builder */ public function setParameter22Name(string $parameter22Name): self { $this->options['parameter22Name'] = $parameter22Name; return $this; } /** * Parameter value * * @param string $parameter22Value Parameter value * @return $this Fluent Builder */ public function setParameter22Value(string $parameter22Value): self { $this->options['parameter22Value'] = $parameter22Value; return $this; } /** * Parameter name * * @param string $parameter23Name Parameter name * @return $this Fluent Builder */ public function setParameter23Name(string $parameter23Name): self { $this->options['parameter23Name'] = $parameter23Name; return $this; } /** * Parameter value * * @param string $parameter23Value Parameter value * @return $this Fluent Builder */ public function setParameter23Value(string $parameter23Value): self { $this->options['parameter23Value'] = $parameter23Value; return $this; } /** * Parameter name * * @param string $parameter24Name Parameter name * @return $this Fluent Builder */ public function setParameter24Name(string $parameter24Name): self { $this->options['parameter24Name'] = $parameter24Name; return $this; } /** * Parameter value * * @param string $parameter24Value Parameter value * @return $this Fluent Builder */ public function setParameter24Value(string $parameter24Value): self { $this->options['parameter24Value'] = $parameter24Value; return $this; } /** * Parameter name * * @param string $parameter25Name Parameter name * @return $this Fluent Builder */ public function setParameter25Name(string $parameter25Name): self { $this->options['parameter25Name'] = $parameter25Name; return $this; } /** * Parameter value * * @param string $parameter25Value Parameter value * @return $this Fluent Builder */ public function setParameter25Value(string $parameter25Value): self { $this->options['parameter25Value'] = $parameter25Value; return $this; } /** * Parameter name * * @param string $parameter26Name Parameter name * @return $this Fluent Builder */ public function setParameter26Name(string $parameter26Name): self { $this->options['parameter26Name'] = $parameter26Name; return $this; } /** * Parameter value * * @param string $parameter26Value Parameter value * @return $this Fluent Builder */ public function setParameter26Value(string $parameter26Value): self { $this->options['parameter26Value'] = $parameter26Value; return $this; } /** * Parameter name * * @param string $parameter27Name Parameter name * @return $this Fluent Builder */ public function setParameter27Name(string $parameter27Name): self { $this->options['parameter27Name'] = $parameter27Name; return $this; } /** * Parameter value * * @param string $parameter27Value Parameter value * @return $this Fluent Builder */ public function setParameter27Value(string $parameter27Value): self { $this->options['parameter27Value'] = $parameter27Value; return $this; } /** * Parameter name * * @param string $parameter28Name Parameter name * @return $this Fluent Builder */ public function setParameter28Name(string $parameter28Name): self { $this->options['parameter28Name'] = $parameter28Name; return $this; } /** * Parameter value * * @param string $parameter28Value Parameter value * @return $this Fluent Builder */ public function setParameter28Value(string $parameter28Value): self { $this->options['parameter28Value'] = $parameter28Value; return $this; } /** * Parameter name * * @param string $parameter29Name Parameter name * @return $this Fluent Builder */ public function setParameter29Name(string $parameter29Name): self { $this->options['parameter29Name'] = $parameter29Name; return $this; } /** * Parameter value * * @param string $parameter29Value Parameter value * @return $this Fluent Builder */ public function setParameter29Value(string $parameter29Value): self { $this->options['parameter29Value'] = $parameter29Value; return $this; } /** * Parameter name * * @param string $parameter30Name Parameter name * @return $this Fluent Builder */ public function setParameter30Name(string $parameter30Name): self { $this->options['parameter30Name'] = $parameter30Name; return $this; } /** * Parameter value * * @param string $parameter30Value Parameter value * @return $this Fluent Builder */ public function setParameter30Value(string $parameter30Value): self { $this->options['parameter30Value'] = $parameter30Value; return $this; } /** * Parameter name * * @param string $parameter31Name Parameter name * @return $this Fluent Builder */ public function setParameter31Name(string $parameter31Name): self { $this->options['parameter31Name'] = $parameter31Name; return $this; } /** * Parameter value * * @param string $parameter31Value Parameter value * @return $this Fluent Builder */ public function setParameter31Value(string $parameter31Value): self { $this->options['parameter31Value'] = $parameter31Value; return $this; } /** * Parameter name * * @param string $parameter32Name Parameter name * @return $this Fluent Builder */ public function setParameter32Name(string $parameter32Name): self { $this->options['parameter32Name'] = $parameter32Name; return $this; } /** * Parameter value * * @param string $parameter32Value Parameter value * @return $this Fluent Builder */ public function setParameter32Value(string $parameter32Value): self { $this->options['parameter32Value'] = $parameter32Value; return $this; } /** * Parameter name * * @param string $parameter33Name Parameter name * @return $this Fluent Builder */ public function setParameter33Name(string $parameter33Name): self { $this->options['parameter33Name'] = $parameter33Name; return $this; } /** * Parameter value * * @param string $parameter33Value Parameter value * @return $this Fluent Builder */ public function setParameter33Value(string $parameter33Value): self { $this->options['parameter33Value'] = $parameter33Value; return $this; } /** * Parameter name * * @param string $parameter34Name Parameter name * @return $this Fluent Builder */ public function setParameter34Name(string $parameter34Name): self { $this->options['parameter34Name'] = $parameter34Name; return $this; } /** * Parameter value * * @param string $parameter34Value Parameter value * @return $this Fluent Builder */ public function setParameter34Value(string $parameter34Value): self { $this->options['parameter34Value'] = $parameter34Value; return $this; } /** * Parameter name * * @param string $parameter35Name Parameter name * @return $this Fluent Builder */ public function setParameter35Name(string $parameter35Name): self { $this->options['parameter35Name'] = $parameter35Name; return $this; } /** * Parameter value * * @param string $parameter35Value Parameter value * @return $this Fluent Builder */ public function setParameter35Value(string $parameter35Value): self { $this->options['parameter35Value'] = $parameter35Value; return $this; } /** * Parameter name * * @param string $parameter36Name Parameter name * @return $this Fluent Builder */ public function setParameter36Name(string $parameter36Name): self { $this->options['parameter36Name'] = $parameter36Name; return $this; } /** * Parameter value * * @param string $parameter36Value Parameter value * @return $this Fluent Builder */ public function setParameter36Value(string $parameter36Value): self { $this->options['parameter36Value'] = $parameter36Value; return $this; } /** * Parameter name * * @param string $parameter37Name Parameter name * @return $this Fluent Builder */ public function setParameter37Name(string $parameter37Name): self { $this->options['parameter37Name'] = $parameter37Name; return $this; } /** * Parameter value * * @param string $parameter37Value Parameter value * @return $this Fluent Builder */ public function setParameter37Value(string $parameter37Value): self { $this->options['parameter37Value'] = $parameter37Value; return $this; } /** * Parameter name * * @param string $parameter38Name Parameter name * @return $this Fluent Builder */ public function setParameter38Name(string $parameter38Name): self { $this->options['parameter38Name'] = $parameter38Name; return $this; } /** * Parameter value * * @param string $parameter38Value Parameter value * @return $this Fluent Builder */ public function setParameter38Value(string $parameter38Value): self { $this->options['parameter38Value'] = $parameter38Value; return $this; } /** * Parameter name * * @param string $parameter39Name Parameter name * @return $this Fluent Builder */ public function setParameter39Name(string $parameter39Name): self { $this->options['parameter39Name'] = $parameter39Name; return $this; } /** * Parameter value * * @param string $parameter39Value Parameter value * @return $this Fluent Builder */ public function setParameter39Value(string $parameter39Value): self { $this->options['parameter39Value'] = $parameter39Value; return $this; } /** * Parameter name * * @param string $parameter40Name Parameter name * @return $this Fluent Builder */ public function setParameter40Name(string $parameter40Name): self { $this->options['parameter40Name'] = $parameter40Name; return $this; } /** * Parameter value * * @param string $parameter40Value Parameter value * @return $this Fluent Builder */ public function setParameter40Value(string $parameter40Value): self { $this->options['parameter40Value'] = $parameter40Value; return $this; } /** * Parameter name * * @param string $parameter41Name Parameter name * @return $this Fluent Builder */ public function setParameter41Name(string $parameter41Name): self { $this->options['parameter41Name'] = $parameter41Name; return $this; } /** * Parameter value * * @param string $parameter41Value Parameter value * @return $this Fluent Builder */ public function setParameter41Value(string $parameter41Value): self { $this->options['parameter41Value'] = $parameter41Value; return $this; } /** * Parameter name * * @param string $parameter42Name Parameter name * @return $this Fluent Builder */ public function setParameter42Name(string $parameter42Name): self { $this->options['parameter42Name'] = $parameter42Name; return $this; } /** * Parameter value * * @param string $parameter42Value Parameter value * @return $this Fluent Builder */ public function setParameter42Value(string $parameter42Value): self { $this->options['parameter42Value'] = $parameter42Value; return $this; } /** * Parameter name * * @param string $parameter43Name Parameter name * @return $this Fluent Builder */ public function setParameter43Name(string $parameter43Name): self { $this->options['parameter43Name'] = $parameter43Name; return $this; } /** * Parameter value * * @param string $parameter43Value Parameter value * @return $this Fluent Builder */ public function setParameter43Value(string $parameter43Value): self { $this->options['parameter43Value'] = $parameter43Value; return $this; } /** * Parameter name * * @param string $parameter44Name Parameter name * @return $this Fluent Builder */ public function setParameter44Name(string $parameter44Name): self { $this->options['parameter44Name'] = $parameter44Name; return $this; } /** * Parameter value * * @param string $parameter44Value Parameter value * @return $this Fluent Builder */ public function setParameter44Value(string $parameter44Value): self { $this->options['parameter44Value'] = $parameter44Value; return $this; } /** * Parameter name * * @param string $parameter45Name Parameter name * @return $this Fluent Builder */ public function setParameter45Name(string $parameter45Name): self { $this->options['parameter45Name'] = $parameter45Name; return $this; } /** * Parameter value * * @param string $parameter45Value Parameter value * @return $this Fluent Builder */ public function setParameter45Value(string $parameter45Value): self { $this->options['parameter45Value'] = $parameter45Value; return $this; } /** * Parameter name * * @param string $parameter46Name Parameter name * @return $this Fluent Builder */ public function setParameter46Name(string $parameter46Name): self { $this->options['parameter46Name'] = $parameter46Name; return $this; } /** * Parameter value * * @param string $parameter46Value Parameter value * @return $this Fluent Builder */ public function setParameter46Value(string $parameter46Value): self { $this->options['parameter46Value'] = $parameter46Value; return $this; } /** * Parameter name * * @param string $parameter47Name Parameter name * @return $this Fluent Builder */ public function setParameter47Name(string $parameter47Name): self { $this->options['parameter47Name'] = $parameter47Name; return $this; } /** * Parameter value * * @param string $parameter47Value Parameter value * @return $this Fluent Builder */ public function setParameter47Value(string $parameter47Value): self { $this->options['parameter47Value'] = $parameter47Value; return $this; } /** * Parameter name * * @param string $parameter48Name Parameter name * @return $this Fluent Builder */ public function setParameter48Name(string $parameter48Name): self { $this->options['parameter48Name'] = $parameter48Name; return $this; } /** * Parameter value * * @param string $parameter48Value Parameter value * @return $this Fluent Builder */ public function setParameter48Value(string $parameter48Value): self { $this->options['parameter48Value'] = $parameter48Value; return $this; } /** * Parameter name * * @param string $parameter49Name Parameter name * @return $this Fluent Builder */ public function setParameter49Name(string $parameter49Name): self { $this->options['parameter49Name'] = $parameter49Name; return $this; } /** * Parameter value * * @param string $parameter49Value Parameter value * @return $this Fluent Builder */ public function setParameter49Value(string $parameter49Value): self { $this->options['parameter49Value'] = $parameter49Value; return $this; } /** * Parameter name * * @param string $parameter50Name Parameter name * @return $this Fluent Builder */ public function setParameter50Name(string $parameter50Name): self { $this->options['parameter50Name'] = $parameter50Name; return $this; } /** * Parameter value * * @param string $parameter50Value Parameter value * @return $this Fluent Builder */ public function setParameter50Value(string $parameter50Value): self { $this->options['parameter50Value'] = $parameter50Value; return $this; } /** * Parameter name * * @param string $parameter51Name Parameter name * @return $this Fluent Builder */ public function setParameter51Name(string $parameter51Name): self { $this->options['parameter51Name'] = $parameter51Name; return $this; } /** * Parameter value * * @param string $parameter51Value Parameter value * @return $this Fluent Builder */ public function setParameter51Value(string $parameter51Value): self { $this->options['parameter51Value'] = $parameter51Value; return $this; } /** * Parameter name * * @param string $parameter52Name Parameter name * @return $this Fluent Builder */ public function setParameter52Name(string $parameter52Name): self { $this->options['parameter52Name'] = $parameter52Name; return $this; } /** * Parameter value * * @param string $parameter52Value Parameter value * @return $this Fluent Builder */ public function setParameter52Value(string $parameter52Value): self { $this->options['parameter52Value'] = $parameter52Value; return $this; } /** * Parameter name * * @param string $parameter53Name Parameter name * @return $this Fluent Builder */ public function setParameter53Name(string $parameter53Name): self { $this->options['parameter53Name'] = $parameter53Name; return $this; } /** * Parameter value * * @param string $parameter53Value Parameter value * @return $this Fluent Builder */ public function setParameter53Value(string $parameter53Value): self { $this->options['parameter53Value'] = $parameter53Value; return $this; } /** * Parameter name * * @param string $parameter54Name Parameter name * @return $this Fluent Builder */ public function setParameter54Name(string $parameter54Name): self { $this->options['parameter54Name'] = $parameter54Name; return $this; } /** * Parameter value * * @param string $parameter54Value Parameter value * @return $this Fluent Builder */ public function setParameter54Value(string $parameter54Value): self { $this->options['parameter54Value'] = $parameter54Value; return $this; } /** * Parameter name * * @param string $parameter55Name Parameter name * @return $this Fluent Builder */ public function setParameter55Name(string $parameter55Name): self { $this->options['parameter55Name'] = $parameter55Name; return $this; } /** * Parameter value * * @param string $parameter55Value Parameter value * @return $this Fluent Builder */ public function setParameter55Value(string $parameter55Value): self { $this->options['parameter55Value'] = $parameter55Value; return $this; } /** * Parameter name * * @param string $parameter56Name Parameter name * @return $this Fluent Builder */ public function setParameter56Name(string $parameter56Name): self { $this->options['parameter56Name'] = $parameter56Name; return $this; } /** * Parameter value * * @param string $parameter56Value Parameter value * @return $this Fluent Builder */ public function setParameter56Value(string $parameter56Value): self { $this->options['parameter56Value'] = $parameter56Value; return $this; } /** * Parameter name * * @param string $parameter57Name Parameter name * @return $this Fluent Builder */ public function setParameter57Name(string $parameter57Name): self { $this->options['parameter57Name'] = $parameter57Name; return $this; } /** * Parameter value * * @param string $parameter57Value Parameter value * @return $this Fluent Builder */ public function setParameter57Value(string $parameter57Value): self { $this->options['parameter57Value'] = $parameter57Value; return $this; } /** * Parameter name * * @param string $parameter58Name Parameter name * @return $this Fluent Builder */ public function setParameter58Name(string $parameter58Name): self { $this->options['parameter58Name'] = $parameter58Name; return $this; } /** * Parameter value * * @param string $parameter58Value Parameter value * @return $this Fluent Builder */ public function setParameter58Value(string $parameter58Value): self { $this->options['parameter58Value'] = $parameter58Value; return $this; } /** * Parameter name * * @param string $parameter59Name Parameter name * @return $this Fluent Builder */ public function setParameter59Name(string $parameter59Name): self { $this->options['parameter59Name'] = $parameter59Name; return $this; } /** * Parameter value * * @param string $parameter59Value Parameter value * @return $this Fluent Builder */ public function setParameter59Value(string $parameter59Value): self { $this->options['parameter59Value'] = $parameter59Value; return $this; } /** * Parameter name * * @param string $parameter60Name Parameter name * @return $this Fluent Builder */ public function setParameter60Name(string $parameter60Name): self { $this->options['parameter60Name'] = $parameter60Name; return $this; } /** * Parameter value * * @param string $parameter60Value Parameter value * @return $this Fluent Builder */ public function setParameter60Value(string $parameter60Value): self { $this->options['parameter60Value'] = $parameter60Value; return $this; } /** * Parameter name * * @param string $parameter61Name Parameter name * @return $this Fluent Builder */ public function setParameter61Name(string $parameter61Name): self { $this->options['parameter61Name'] = $parameter61Name; return $this; } /** * Parameter value * * @param string $parameter61Value Parameter value * @return $this Fluent Builder */ public function setParameter61Value(string $parameter61Value): self { $this->options['parameter61Value'] = $parameter61Value; return $this; } /** * Parameter name * * @param string $parameter62Name Parameter name * @return $this Fluent Builder */ public function setParameter62Name(string $parameter62Name): self { $this->options['parameter62Name'] = $parameter62Name; return $this; } /** * Parameter value * * @param string $parameter62Value Parameter value * @return $this Fluent Builder */ public function setParameter62Value(string $parameter62Value): self { $this->options['parameter62Value'] = $parameter62Value; return $this; } /** * Parameter name * * @param string $parameter63Name Parameter name * @return $this Fluent Builder */ public function setParameter63Name(string $parameter63Name): self { $this->options['parameter63Name'] = $parameter63Name; return $this; } /** * Parameter value * * @param string $parameter63Value Parameter value * @return $this Fluent Builder */ public function setParameter63Value(string $parameter63Value): self { $this->options['parameter63Value'] = $parameter63Value; return $this; } /** * Parameter name * * @param string $parameter64Name Parameter name * @return $this Fluent Builder */ public function setParameter64Name(string $parameter64Name): self { $this->options['parameter64Name'] = $parameter64Name; return $this; } /** * Parameter value * * @param string $parameter64Value Parameter value * @return $this Fluent Builder */ public function setParameter64Value(string $parameter64Value): self { $this->options['parameter64Value'] = $parameter64Value; return $this; } /** * Parameter name * * @param string $parameter65Name Parameter name * @return $this Fluent Builder */ public function setParameter65Name(string $parameter65Name): self { $this->options['parameter65Name'] = $parameter65Name; return $this; } /** * Parameter value * * @param string $parameter65Value Parameter value * @return $this Fluent Builder */ public function setParameter65Value(string $parameter65Value): self { $this->options['parameter65Value'] = $parameter65Value; return $this; } /** * Parameter name * * @param string $parameter66Name Parameter name * @return $this Fluent Builder */ public function setParameter66Name(string $parameter66Name): self { $this->options['parameter66Name'] = $parameter66Name; return $this; } /** * Parameter value * * @param string $parameter66Value Parameter value * @return $this Fluent Builder */ public function setParameter66Value(string $parameter66Value): self { $this->options['parameter66Value'] = $parameter66Value; return $this; } /** * Parameter name * * @param string $parameter67Name Parameter name * @return $this Fluent Builder */ public function setParameter67Name(string $parameter67Name): self { $this->options['parameter67Name'] = $parameter67Name; return $this; } /** * Parameter value * * @param string $parameter67Value Parameter value * @return $this Fluent Builder */ public function setParameter67Value(string $parameter67Value): self { $this->options['parameter67Value'] = $parameter67Value; return $this; } /** * Parameter name * * @param string $parameter68Name Parameter name * @return $this Fluent Builder */ public function setParameter68Name(string $parameter68Name): self { $this->options['parameter68Name'] = $parameter68Name; return $this; } /** * Parameter value * * @param string $parameter68Value Parameter value * @return $this Fluent Builder */ public function setParameter68Value(string $parameter68Value): self { $this->options['parameter68Value'] = $parameter68Value; return $this; } /** * Parameter name * * @param string $parameter69Name Parameter name * @return $this Fluent Builder */ public function setParameter69Name(string $parameter69Name): self { $this->options['parameter69Name'] = $parameter69Name; return $this; } /** * Parameter value * * @param string $parameter69Value Parameter value * @return $this Fluent Builder */ public function setParameter69Value(string $parameter69Value): self { $this->options['parameter69Value'] = $parameter69Value; return $this; } /** * Parameter name * * @param string $parameter70Name Parameter name * @return $this Fluent Builder */ public function setParameter70Name(string $parameter70Name): self { $this->options['parameter70Name'] = $parameter70Name; return $this; } /** * Parameter value * * @param string $parameter70Value Parameter value * @return $this Fluent Builder */ public function setParameter70Value(string $parameter70Value): self { $this->options['parameter70Value'] = $parameter70Value; return $this; } /** * Parameter name * * @param string $parameter71Name Parameter name * @return $this Fluent Builder */ public function setParameter71Name(string $parameter71Name): self { $this->options['parameter71Name'] = $parameter71Name; return $this; } /** * Parameter value * * @param string $parameter71Value Parameter value * @return $this Fluent Builder */ public function setParameter71Value(string $parameter71Value): self { $this->options['parameter71Value'] = $parameter71Value; return $this; } /** * Parameter name * * @param string $parameter72Name Parameter name * @return $this Fluent Builder */ public function setParameter72Name(string $parameter72Name): self { $this->options['parameter72Name'] = $parameter72Name; return $this; } /** * Parameter value * * @param string $parameter72Value Parameter value * @return $this Fluent Builder */ public function setParameter72Value(string $parameter72Value): self { $this->options['parameter72Value'] = $parameter72Value; return $this; } /** * Parameter name * * @param string $parameter73Name Parameter name * @return $this Fluent Builder */ public function setParameter73Name(string $parameter73Name): self { $this->options['parameter73Name'] = $parameter73Name; return $this; } /** * Parameter value * * @param string $parameter73Value Parameter value * @return $this Fluent Builder */ public function setParameter73Value(string $parameter73Value): self { $this->options['parameter73Value'] = $parameter73Value; return $this; } /** * Parameter name * * @param string $parameter74Name Parameter name * @return $this Fluent Builder */ public function setParameter74Name(string $parameter74Name): self { $this->options['parameter74Name'] = $parameter74Name; return $this; } /** * Parameter value * * @param string $parameter74Value Parameter value * @return $this Fluent Builder */ public function setParameter74Value(string $parameter74Value): self { $this->options['parameter74Value'] = $parameter74Value; return $this; } /** * Parameter name * * @param string $parameter75Name Parameter name * @return $this Fluent Builder */ public function setParameter75Name(string $parameter75Name): self { $this->options['parameter75Name'] = $parameter75Name; return $this; } /** * Parameter value * * @param string $parameter75Value Parameter value * @return $this Fluent Builder */ public function setParameter75Value(string $parameter75Value): self { $this->options['parameter75Value'] = $parameter75Value; return $this; } /** * Parameter name * * @param string $parameter76Name Parameter name * @return $this Fluent Builder */ public function setParameter76Name(string $parameter76Name): self { $this->options['parameter76Name'] = $parameter76Name; return $this; } /** * Parameter value * * @param string $parameter76Value Parameter value * @return $this Fluent Builder */ public function setParameter76Value(string $parameter76Value): self { $this->options['parameter76Value'] = $parameter76Value; return $this; } /** * Parameter name * * @param string $parameter77Name Parameter name * @return $this Fluent Builder */ public function setParameter77Name(string $parameter77Name): self { $this->options['parameter77Name'] = $parameter77Name; return $this; } /** * Parameter value * * @param string $parameter77Value Parameter value * @return $this Fluent Builder */ public function setParameter77Value(string $parameter77Value): self { $this->options['parameter77Value'] = $parameter77Value; return $this; } /** * Parameter name * * @param string $parameter78Name Parameter name * @return $this Fluent Builder */ public function setParameter78Name(string $parameter78Name): self { $this->options['parameter78Name'] = $parameter78Name; return $this; } /** * Parameter value * * @param string $parameter78Value Parameter value * @return $this Fluent Builder */ public function setParameter78Value(string $parameter78Value): self { $this->options['parameter78Value'] = $parameter78Value; return $this; } /** * Parameter name * * @param string $parameter79Name Parameter name * @return $this Fluent Builder */ public function setParameter79Name(string $parameter79Name): self { $this->options['parameter79Name'] = $parameter79Name; return $this; } /** * Parameter value * * @param string $parameter79Value Parameter value * @return $this Fluent Builder */ public function setParameter79Value(string $parameter79Value): self { $this->options['parameter79Value'] = $parameter79Value; return $this; } /** * Parameter name * * @param string $parameter80Name Parameter name * @return $this Fluent Builder */ public function setParameter80Name(string $parameter80Name): self { $this->options['parameter80Name'] = $parameter80Name; return $this; } /** * Parameter value * * @param string $parameter80Value Parameter value * @return $this Fluent Builder */ public function setParameter80Value(string $parameter80Value): self { $this->options['parameter80Value'] = $parameter80Value; return $this; } /** * Parameter name * * @param string $parameter81Name Parameter name * @return $this Fluent Builder */ public function setParameter81Name(string $parameter81Name): self { $this->options['parameter81Name'] = $parameter81Name; return $this; } /** * Parameter value * * @param string $parameter81Value Parameter value * @return $this Fluent Builder */ public function setParameter81Value(string $parameter81Value): self { $this->options['parameter81Value'] = $parameter81Value; return $this; } /** * Parameter name * * @param string $parameter82Name Parameter name * @return $this Fluent Builder */ public function setParameter82Name(string $parameter82Name): self { $this->options['parameter82Name'] = $parameter82Name; return $this; } /** * Parameter value * * @param string $parameter82Value Parameter value * @return $this Fluent Builder */ public function setParameter82Value(string $parameter82Value): self { $this->options['parameter82Value'] = $parameter82Value; return $this; } /** * Parameter name * * @param string $parameter83Name Parameter name * @return $this Fluent Builder */ public function setParameter83Name(string $parameter83Name): self { $this->options['parameter83Name'] = $parameter83Name; return $this; } /** * Parameter value * * @param string $parameter83Value Parameter value * @return $this Fluent Builder */ public function setParameter83Value(string $parameter83Value): self { $this->options['parameter83Value'] = $parameter83Value; return $this; } /** * Parameter name * * @param string $parameter84Name Parameter name * @return $this Fluent Builder */ public function setParameter84Name(string $parameter84Name): self { $this->options['parameter84Name'] = $parameter84Name; return $this; } /** * Parameter value * * @param string $parameter84Value Parameter value * @return $this Fluent Builder */ public function setParameter84Value(string $parameter84Value): self { $this->options['parameter84Value'] = $parameter84Value; return $this; } /** * Parameter name * * @param string $parameter85Name Parameter name * @return $this Fluent Builder */ public function setParameter85Name(string $parameter85Name): self { $this->options['parameter85Name'] = $parameter85Name; return $this; } /** * Parameter value * * @param string $parameter85Value Parameter value * @return $this Fluent Builder */ public function setParameter85Value(string $parameter85Value): self { $this->options['parameter85Value'] = $parameter85Value; return $this; } /** * Parameter name * * @param string $parameter86Name Parameter name * @return $this Fluent Builder */ public function setParameter86Name(string $parameter86Name): self { $this->options['parameter86Name'] = $parameter86Name; return $this; } /** * Parameter value * * @param string $parameter86Value Parameter value * @return $this Fluent Builder */ public function setParameter86Value(string $parameter86Value): self { $this->options['parameter86Value'] = $parameter86Value; return $this; } /** * Parameter name * * @param string $parameter87Name Parameter name * @return $this Fluent Builder */ public function setParameter87Name(string $parameter87Name): self { $this->options['parameter87Name'] = $parameter87Name; return $this; } /** * Parameter value * * @param string $parameter87Value Parameter value * @return $this Fluent Builder */ public function setParameter87Value(string $parameter87Value): self { $this->options['parameter87Value'] = $parameter87Value; return $this; } /** * Parameter name * * @param string $parameter88Name Parameter name * @return $this Fluent Builder */ public function setParameter88Name(string $parameter88Name): self { $this->options['parameter88Name'] = $parameter88Name; return $this; } /** * Parameter value * * @param string $parameter88Value Parameter value * @return $this Fluent Builder */ public function setParameter88Value(string $parameter88Value): self { $this->options['parameter88Value'] = $parameter88Value; return $this; } /** * Parameter name * * @param string $parameter89Name Parameter name * @return $this Fluent Builder */ public function setParameter89Name(string $parameter89Name): self { $this->options['parameter89Name'] = $parameter89Name; return $this; } /** * Parameter value * * @param string $parameter89Value Parameter value * @return $this Fluent Builder */ public function setParameter89Value(string $parameter89Value): self { $this->options['parameter89Value'] = $parameter89Value; return $this; } /** * Parameter name * * @param string $parameter90Name Parameter name * @return $this Fluent Builder */ public function setParameter90Name(string $parameter90Name): self { $this->options['parameter90Name'] = $parameter90Name; return $this; } /** * Parameter value * * @param string $parameter90Value Parameter value * @return $this Fluent Builder */ public function setParameter90Value(string $parameter90Value): self { $this->options['parameter90Value'] = $parameter90Value; return $this; } /** * Parameter name * * @param string $parameter91Name Parameter name * @return $this Fluent Builder */ public function setParameter91Name(string $parameter91Name): self { $this->options['parameter91Name'] = $parameter91Name; return $this; } /** * Parameter value * * @param string $parameter91Value Parameter value * @return $this Fluent Builder */ public function setParameter91Value(string $parameter91Value): self { $this->options['parameter91Value'] = $parameter91Value; return $this; } /** * Parameter name * * @param string $parameter92Name Parameter name * @return $this Fluent Builder */ public function setParameter92Name(string $parameter92Name): self { $this->options['parameter92Name'] = $parameter92Name; return $this; } /** * Parameter value * * @param string $parameter92Value Parameter value * @return $this Fluent Builder */ public function setParameter92Value(string $parameter92Value): self { $this->options['parameter92Value'] = $parameter92Value; return $this; } /** * Parameter name * * @param string $parameter93Name Parameter name * @return $this Fluent Builder */ public function setParameter93Name(string $parameter93Name): self { $this->options['parameter93Name'] = $parameter93Name; return $this; } /** * Parameter value * * @param string $parameter93Value Parameter value * @return $this Fluent Builder */ public function setParameter93Value(string $parameter93Value): self { $this->options['parameter93Value'] = $parameter93Value; return $this; } /** * Parameter name * * @param string $parameter94Name Parameter name * @return $this Fluent Builder */ public function setParameter94Name(string $parameter94Name): self { $this->options['parameter94Name'] = $parameter94Name; return $this; } /** * Parameter value * * @param string $parameter94Value Parameter value * @return $this Fluent Builder */ public function setParameter94Value(string $parameter94Value): self { $this->options['parameter94Value'] = $parameter94Value; return $this; } /** * Parameter name * * @param string $parameter95Name Parameter name * @return $this Fluent Builder */ public function setParameter95Name(string $parameter95Name): self { $this->options['parameter95Name'] = $parameter95Name; return $this; } /** * Parameter value * * @param string $parameter95Value Parameter value * @return $this Fluent Builder */ public function setParameter95Value(string $parameter95Value): self { $this->options['parameter95Value'] = $parameter95Value; return $this; } /** * Parameter name * * @param string $parameter96Name Parameter name * @return $this Fluent Builder */ public function setParameter96Name(string $parameter96Name): self { $this->options['parameter96Name'] = $parameter96Name; return $this; } /** * Parameter value * * @param string $parameter96Value Parameter value * @return $this Fluent Builder */ public function setParameter96Value(string $parameter96Value): self { $this->options['parameter96Value'] = $parameter96Value; return $this; } /** * Parameter name * * @param string $parameter97Name Parameter name * @return $this Fluent Builder */ public function setParameter97Name(string $parameter97Name): self { $this->options['parameter97Name'] = $parameter97Name; return $this; } /** * Parameter value * * @param string $parameter97Value Parameter value * @return $this Fluent Builder */ public function setParameter97Value(string $parameter97Value): self { $this->options['parameter97Value'] = $parameter97Value; return $this; } /** * Parameter name * * @param string $parameter98Name Parameter name * @return $this Fluent Builder */ public function setParameter98Name(string $parameter98Name): self { $this->options['parameter98Name'] = $parameter98Name; return $this; } /** * Parameter value * * @param string $parameter98Value Parameter value * @return $this Fluent Builder */ public function setParameter98Value(string $parameter98Value): self { $this->options['parameter98Value'] = $parameter98Value; return $this; } /** * Parameter name * * @param string $parameter99Name Parameter name * @return $this Fluent Builder */ public function setParameter99Name(string $parameter99Name): self { $this->options['parameter99Name'] = $parameter99Name; return $this; } /** * Parameter value * * @param string $parameter99Value Parameter value * @return $this Fluent Builder */ public function setParameter99Value(string $parameter99Value): self { $this->options['parameter99Value'] = $parameter99Value; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateSiprecOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionPage.php 0000644 00000003346 15021223077 0023412 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserDefinedMessageSubscriptionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserDefinedMessageSubscriptionInstance \Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageSubscriptionInstance */ public function buildInstance(array $payload): UserDefinedMessageSubscriptionInstance { return new UserDefinedMessageSubscriptionInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.UserDefinedMessageSubscriptionPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationList.php 0000644 00000014725 15021223077 0017773 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class NotificationList extends ListResource { /** * Construct the NotificationList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call Notification resource to fetch. * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the Call Notification resource to fetch. */ public function __construct( Version $version, string $accountSid, string $callSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Notifications.json'; } /** * Reads NotificationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return NotificationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams NotificationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of NotificationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return NotificationPage Page of NotificationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): NotificationPage { $options = new Values($options); $params = Values::of([ 'Log' => $options['log'], 'MessageDate<' => Serialize::iso8601Date($options['messageDateBefore']), 'MessageDate' => Serialize::iso8601Date($options['messageDate']), 'MessageDate>' => Serialize::iso8601Date($options['messageDateAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new NotificationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of NotificationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return NotificationPage Page of NotificationInstance */ public function getPage(string $targetUrl): NotificationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new NotificationPage($this->version, $response, $this->solution); } /** * Constructs a NotificationContext * * @param string $sid The Twilio-provided string that uniquely identifies the Call Notification resource to fetch. */ public function getContext( string $sid ): NotificationContext { return new NotificationContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NotificationList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/SiprecPage.php 0000644 00000003126 15021223077 0016524 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SiprecPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SiprecInstance \Twilio\Rest\Api\V2010\Account\Call\SiprecInstance */ public function buildInstance(array $payload): SiprecInstance { return new SiprecInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.SiprecPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationPage.php 0000644 00000003172 15021223077 0017726 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NotificationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return NotificationInstance \Twilio\Rest\Api\V2010\Account\Call\NotificationInstance */ public function buildInstance(array $payload): NotificationInstance { return new NotificationInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NotificationPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionOptions.php 0000644 00000006344 15021223077 0024172 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class UserDefinedMessageSubscriptionOptions { /** * @param string $idempotencyKey A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. * @param string $method The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. Default is `POST`. * @return CreateUserDefinedMessageSubscriptionOptions Options builder */ public static function create( string $idempotencyKey = Values::NONE, string $method = Values::NONE ): CreateUserDefinedMessageSubscriptionOptions { return new CreateUserDefinedMessageSubscriptionOptions( $idempotencyKey, $method ); } } class CreateUserDefinedMessageSubscriptionOptions extends Options { /** * @param string $idempotencyKey A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. * @param string $method The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. Default is `POST`. */ public function __construct( string $idempotencyKey = Values::NONE, string $method = Values::NONE ) { $this->options['idempotencyKey'] = $idempotencyKey; $this->options['method'] = $method; } /** * A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. * * @param string $idempotencyKey A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. * @return $this Fluent Builder */ public function setIdempotencyKey(string $idempotencyKey): self { $this->options['idempotencyKey'] = $idempotencyKey; return $this; } /** * The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. Default is `POST`. * * @param string $method The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. Default is `POST`. * @return $this Fluent Builder */ public function setMethod(string $method): self { $this->options['method'] = $method; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateUserDefinedMessageSubscriptionOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingContext.php 0000644 00000007362 15021223077 0017771 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class RecordingContext extends InstanceContext { /** * Initialize the RecordingContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $callSid The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) to associate the resource with. * @param string $sid The Twilio-provided string that uniquely identifies the Recording resource to delete. */ public function __construct( Version $version, $accountSid, $callSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/Recordings/' . \rawurlencode($sid) .'.json'; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } /** * Update the RecordingInstance * * @param string $status * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): RecordingInstance { $options = new Values($options); $data = Values::of([ 'Status' => $status, 'PauseBehavior' => $options['pauseBehavior'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionContext.php 0000644 00000005064 15021223077 0024161 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class UserDefinedMessageSubscriptionContext extends InstanceContext { /** * Initialize the UserDefinedMessageSubscriptionContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that subscribed to the User Defined Messages. * @param string $callSid The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User Defined Messages subscription is associated with. This refers to the Call SID that is producing the user defined messages. * @param string $sid The SID that uniquely identifies this User Defined Message Subscription. */ public function __construct( Version $version, $accountSid, $callSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Calls/' . \rawurlencode($callSid) .'/UserDefinedMessageSubscriptions/' . \rawurlencode($sid) .'.json'; } /** * Delete the UserDefinedMessageSubscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.UserDefinedMessageSubscriptionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingInstance.php 0000644 00000014040 15021223077 0020100 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $callSid * @property string|null $conferenceSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property \DateTime|null $startTime * @property string|null $duration * @property string|null $sid * @property string|null $price * @property string|null $uri * @property array|null $encryptionDetails * @property string|null $priceUnit * @property string $status * @property int|null $channels * @property string $source * @property int|null $errorCode * @property string|null $track */ class RecordingInstance extends InstanceResource { /** * Initialize the RecordingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $callSid The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) to associate the resource with. * @param string $sid The Twilio-provided string that uniquely identifies the Recording resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $callSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callSid' => Values::array_get($payload, 'call_sid'), 'conferenceSid' => Values::array_get($payload, 'conference_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'duration' => Values::array_get($payload, 'duration'), 'sid' => Values::array_get($payload, 'sid'), 'price' => Values::array_get($payload, 'price'), 'uri' => Values::array_get($payload, 'uri'), 'encryptionDetails' => Values::array_get($payload, 'encryption_details'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'status' => Values::array_get($payload, 'status'), 'channels' => Values::array_get($payload, 'channels'), 'source' => Values::array_get($payload, 'source'), 'errorCode' => Values::array_get($payload, 'error_code'), 'track' => Values::array_get($payload, 'track'), ]; $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RecordingContext Context for this RecordingInstance */ protected function proxy(): RecordingContext { if (!$this->context) { $this->context = new RecordingContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { return $this->proxy()->fetch(); } /** * Update the RecordingInstance * * @param string $status * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): RecordingInstance { return $this->proxy()->update($status, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdOptions.php 0000644 00000010453 15021223077 0020377 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class OutgoingCallerIdOptions { /** * @param string $phoneNumber The phone number of the OutgoingCallerId resources to read. * @param string $friendlyName The string that identifies the OutgoingCallerId resources to read. * @return ReadOutgoingCallerIdOptions Options builder */ public static function read( string $phoneNumber = Values::NONE, string $friendlyName = Values::NONE ): ReadOutgoingCallerIdOptions { return new ReadOutgoingCallerIdOptions( $phoneNumber, $friendlyName ); } /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return UpdateOutgoingCallerIdOptions Options builder */ public static function update( string $friendlyName = Values::NONE ): UpdateOutgoingCallerIdOptions { return new UpdateOutgoingCallerIdOptions( $friendlyName ); } } class ReadOutgoingCallerIdOptions extends Options { /** * @param string $phoneNumber The phone number of the OutgoingCallerId resources to read. * @param string $friendlyName The string that identifies the OutgoingCallerId resources to read. */ public function __construct( string $phoneNumber = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['phoneNumber'] = $phoneNumber; $this->options['friendlyName'] = $friendlyName; } /** * The phone number of the OutgoingCallerId resources to read. * * @param string $phoneNumber The phone number of the OutgoingCallerId resources to read. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * The string that identifies the OutgoingCallerId resources to read. * * @param string $friendlyName The string that identifies the OutgoingCallerId resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadOutgoingCallerIdOptions ' . $options . ']'; } } class UpdateOutgoingCallerIdOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateOutgoingCallerIdOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php 0000644 00000015672 15021223077 0021113 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnList; /** * @property AssignedAddOnList $assignedAddOns * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnContext assignedAddOns(string $sid) */ class IncomingPhoneNumberContext extends InstanceContext { protected $_assignedAddOns; /** * Initialize the IncomingPhoneNumberContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $sid The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to delete. */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers/' . \rawurlencode($sid) .'.json'; } /** * Delete the IncomingPhoneNumberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the IncomingPhoneNumberInstance * * @return IncomingPhoneNumberInstance Fetched IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IncomingPhoneNumberInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new IncomingPhoneNumberInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the IncomingPhoneNumberInstance * * @param array|Options $options Optional Arguments * @return IncomingPhoneNumberInstance Updated IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): IncomingPhoneNumberInstance { $options = new Values($options); $data = Values::of([ 'AccountSid' => $options['accountSid'], 'ApiVersion' => $options['apiVersion'], 'FriendlyName' => $options['friendlyName'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceApplicationSid' => $options['voiceApplicationSid'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'EmergencyStatus' => $options['emergencyStatus'], 'EmergencyAddressSid' => $options['emergencyAddressSid'], 'TrunkSid' => $options['trunkSid'], 'VoiceReceiveMode' => $options['voiceReceiveMode'], 'IdentitySid' => $options['identitySid'], 'AddressSid' => $options['addressSid'], 'BundleSid' => $options['bundleSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new IncomingPhoneNumberInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the assignedAddOns */ protected function getAssignedAddOns(): AssignedAddOnList { if (!$this->_assignedAddOns) { $this->_assignedAddOns = new AssignedAddOnList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_assignedAddOns; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IncomingPhoneNumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnPage.php 0000644 00000003242 15021223077 0022774 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AssignedAddOnPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AssignedAddOnInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnInstance */ public function buildInstance(array $payload): AssignedAddOnInstance { return new AssignedAddOnInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AssignedAddOnPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobilePage.php 0000644 00000003130 15021223077 0021534 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MobilePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MobileInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\MobileInstance */ public function buildInstance(array $payload): MobileInstance { return new MobileInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MobilePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnContext.php 0000644 00000011421 15021223077 0023542 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionList; /** * @property AssignedAddOnExtensionList $extensions * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionContext extensions(string $sid) */ class AssignedAddOnContext extends InstanceContext { protected $_extensions; /** * Initialize the AssignedAddOnContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $resourceSid The SID of the Phone Number to assign the Add-on. * @param string $sid The Twilio-provided string that uniquely identifies the resource to delete. */ public function __construct( Version $version, $accountSid, $resourceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) .'/AssignedAddOns/' . \rawurlencode($sid) .'.json'; } /** * Delete the AssignedAddOnInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the AssignedAddOnInstance * * @return AssignedAddOnInstance Fetched AssignedAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssignedAddOnInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AssignedAddOnInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['sid'] ); } /** * Access the extensions */ protected function getExtensions(): AssignedAddOnExtensionList { if (!$this->_extensions) { $this->_extensions = new AssignedAddOnExtensionList( $this->version, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['sid'] ); } return $this->_extensions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AssignedAddOnContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeInstance.php 0000644 00000014116 15021223077 0022737 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Base\PhoneNumberCapabilities; /** * @property string|null $accountSid * @property string|null $addressSid * @property string $addressRequirements * @property string|null $apiVersion * @property bool|null $beta * @property PhoneNumberCapabilities|null $capabilities * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string|null $identitySid * @property string|null $phoneNumber * @property string|null $origin * @property string|null $sid * @property string|null $smsApplicationSid * @property string|null $smsFallbackMethod * @property string|null $smsFallbackUrl * @property string|null $smsMethod * @property string|null $smsUrl * @property string|null $statusCallback * @property string|null $statusCallbackMethod * @property string|null $trunkSid * @property string|null $uri * @property string $voiceReceiveMode * @property string|null $voiceApplicationSid * @property bool|null $voiceCallerIdLookup * @property string|null $voiceFallbackMethod * @property string|null $voiceFallbackUrl * @property string|null $voiceMethod * @property string|null $voiceUrl * @property string $emergencyStatus * @property string|null $emergencyAddressSid * @property string $emergencyAddressStatus * @property string|null $bundleSid * @property string|null $status */ class TollFreeInstance extends InstanceResource { /** * Initialize the TollFreeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'identitySid' => Values::array_get($payload, 'identity_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'origin' => Values::array_get($payload, 'origin'), 'sid' => Values::array_get($payload, 'sid'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'uri' => Values::array_get($payload, 'uri'), 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), 'bundleSid' => Values::array_get($payload, 'bundle_sid'), 'status' => Values::array_get($payload, 'status'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TollFreeInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeList.php 0000644 00000020420 15021223077 0022101 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class TollFreeList extends ListResource { /** * Construct the TollFreeList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers/TollFree.json'; } /** * Create the TollFreeInstance * * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * @param array|Options $options Optional Arguments * @return TollFreeInstance Created TollFreeInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumber, array $options = []): TollFreeInstance { $options = new Values($options); $data = Values::of([ 'PhoneNumber' => $phoneNumber, 'ApiVersion' => $options['apiVersion'], 'FriendlyName' => $options['friendlyName'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceApplicationSid' => $options['voiceApplicationSid'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'IdentitySid' => $options['identitySid'], 'AddressSid' => $options['addressSid'], 'EmergencyStatus' => $options['emergencyStatus'], 'EmergencyAddressSid' => $options['emergencyAddressSid'], 'TrunkSid' => $options['trunkSid'], 'VoiceReceiveMode' => $options['voiceReceiveMode'], 'BundleSid' => $options['bundleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TollFreeInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads TollFreeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TollFreeInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TollFreeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TollFreeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TollFreePage Page of TollFreeInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TollFreePage { $options = new Values($options); $params = Values::of([ 'Beta' => Serialize::booleanToString($options['beta']), 'FriendlyName' => $options['friendlyName'], 'PhoneNumber' => $options['phoneNumber'], 'Origin' => $options['origin'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TollFreePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TollFreeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TollFreePage Page of TollFreeInstance */ public function getPage(string $targetUrl): TollFreePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TollFreePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TollFreeList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileOptions.php 0000644 00000066612 15021223077 0022331 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Options; use Twilio\Values; abstract class MobileOptions { /** * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, the is a formatted version of the phone number. * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those of the application. * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @param string $emergencyStatus * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @param string $voiceReceiveMode * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * @return CreateMobileOptions Options builder */ public static function create( string $apiVersion = Values::NONE, string $friendlyName = Values::NONE, string $smsApplicationSid = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $voiceApplicationSid = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE ): CreateMobileOptions { return new CreateMobileOptions( $apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $identitySid, $addressSid, $emergencyStatus, $emergencyAddressSid, $trunkSid, $voiceReceiveMode, $bundleSid ); } /** * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $friendlyName A string that identifies the resources to read. * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * @return ReadMobileOptions Options builder */ public static function read( bool $beta = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE ): ReadMobileOptions { return new ReadMobileOptions( $beta, $friendlyName, $phoneNumber, $origin ); } } class CreateMobileOptions extends Options { /** * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, the is a formatted version of the phone number. * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those of the application. * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @param string $emergencyStatus * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @param string $voiceReceiveMode * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. */ public function __construct( string $apiVersion = Values::NONE, string $friendlyName = Values::NONE, string $smsApplicationSid = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $voiceApplicationSid = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE ) { $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, the is a formatted version of the phone number. * * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, the is a formatted version of the phone number. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those of the application. * * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those of the application. * @return $this Fluent Builder */ public function setSmsApplicationSid(string $smsApplicationSid): self { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call when the new phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @return $this Fluent Builder */ public function setVoiceApplicationSid(string $voiceApplicationSid): self { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @return $this Fluent Builder */ public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * @return $this Fluent Builder */ public function setIdentitySid(string $identitySid): self { $this->options['identitySid'] = $identitySid; return $this; } /** * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * @param string $emergencyStatus * @return $this Fluent Builder */ public function setEmergencyStatus(string $emergencyStatus): self { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The SID of the emergency address configuration to use for emergency calling from the new phone number. * * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @return $this Fluent Builder */ public function setEmergencyAddressSid(string $emergencyAddressSid): self { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @return $this Fluent Builder */ public function setTrunkSid(string $trunkSid): self { $this->options['trunkSid'] = $trunkSid; return $this; } /** * @param string $voiceReceiveMode * @return $this Fluent Builder */ public function setVoiceReceiveMode(string $voiceReceiveMode): self { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * @return $this Fluent Builder */ public function setBundleSid(string $bundleSid): self { $this->options['bundleSid'] = $bundleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateMobileOptions ' . $options . ']'; } } class ReadMobileOptions extends Options { /** * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $friendlyName A string that identifies the resources to read. * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ public function __construct( bool $beta = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE ) { $this->options['beta'] = $beta; $this->options['friendlyName'] = $friendlyName; $this->options['phoneNumber'] = $phoneNumber; $this->options['origin'] = $origin; } /** * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * A string that identifies the resources to read. * * @param string $friendlyName A string that identifies the resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * @return $this Fluent Builder */ public function setOrigin(string $origin): self { $this->options['origin'] = $origin; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadMobileOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileInstance.php 0000644 00000014110 15021223077 0022424 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Base\PhoneNumberCapabilities; /** * @property string|null $accountSid * @property string|null $addressSid * @property string $addressRequirements * @property string|null $apiVersion * @property bool|null $beta * @property PhoneNumberCapabilities|null $capabilities * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string|null $identitySid * @property string|null $phoneNumber * @property string|null $origin * @property string|null $sid * @property string|null $smsApplicationSid * @property string|null $smsFallbackMethod * @property string|null $smsFallbackUrl * @property string|null $smsMethod * @property string|null $smsUrl * @property string|null $statusCallback * @property string|null $statusCallbackMethod * @property string|null $trunkSid * @property string|null $uri * @property string $voiceReceiveMode * @property string|null $voiceApplicationSid * @property bool|null $voiceCallerIdLookup * @property string|null $voiceFallbackMethod * @property string|null $voiceFallbackUrl * @property string|null $voiceMethod * @property string|null $voiceUrl * @property string $emergencyStatus * @property string|null $emergencyAddressSid * @property string $emergencyAddressStatus * @property string|null $bundleSid * @property string|null $status */ class MobileInstance extends InstanceResource { /** * Initialize the MobileInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'identitySid' => Values::array_get($payload, 'identity_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'origin' => Values::array_get($payload, 'origin'), 'sid' => Values::array_get($payload, 'sid'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'uri' => Values::array_get($payload, 'uri'), 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), 'bundleSid' => Values::array_get($payload, 'bundle_sid'), 'status' => Values::array_get($payload, 'status'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MobileInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalInstance.php 0000644 00000014105 15021223077 0022253 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Base\PhoneNumberCapabilities; /** * @property string|null $accountSid * @property string|null $addressSid * @property string $addressRequirements * @property string|null $apiVersion * @property bool|null $beta * @property PhoneNumberCapabilities|null $capabilities * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string|null $identitySid * @property string|null $phoneNumber * @property string|null $origin * @property string|null $sid * @property string|null $smsApplicationSid * @property string|null $smsFallbackMethod * @property string|null $smsFallbackUrl * @property string|null $smsMethod * @property string|null $smsUrl * @property string|null $statusCallback * @property string|null $statusCallbackMethod * @property string|null $trunkSid * @property string|null $uri * @property string $voiceReceiveMode * @property string|null $voiceApplicationSid * @property bool|null $voiceCallerIdLookup * @property string|null $voiceFallbackMethod * @property string|null $voiceFallbackUrl * @property string|null $voiceMethod * @property string|null $voiceUrl * @property string $emergencyStatus * @property string|null $emergencyAddressSid * @property string $emergencyAddressStatus * @property string|null $bundleSid * @property string|null $status */ class LocalInstance extends InstanceResource { /** * Initialize the LocalInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'identitySid' => Values::array_get($payload, 'identity_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'origin' => Values::array_get($payload, 'origin'), 'sid' => Values::array_get($payload, 'sid'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'uri' => Values::array_get($payload, 'uri'), 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), 'bundleSid' => Values::array_get($payload, 'bundle_sid'), 'status' => Values::array_get($payload, 'status'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.LocalInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalList.php 0000644 00000020316 15021223077 0021423 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class LocalList extends ListResource { /** * Construct the LocalList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers/Local.json'; } /** * Create the LocalInstance * * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * @param array|Options $options Optional Arguments * @return LocalInstance Created LocalInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumber, array $options = []): LocalInstance { $options = new Values($options); $data = Values::of([ 'PhoneNumber' => $phoneNumber, 'ApiVersion' => $options['apiVersion'], 'FriendlyName' => $options['friendlyName'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceApplicationSid' => $options['voiceApplicationSid'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'IdentitySid' => $options['identitySid'], 'AddressSid' => $options['addressSid'], 'EmergencyStatus' => $options['emergencyStatus'], 'EmergencyAddressSid' => $options['emergencyAddressSid'], 'TrunkSid' => $options['trunkSid'], 'VoiceReceiveMode' => $options['voiceReceiveMode'], 'BundleSid' => $options['bundleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new LocalInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads LocalInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return LocalInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams LocalInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of LocalInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return LocalPage Page of LocalInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): LocalPage { $options = new Values($options); $params = Values::of([ 'Beta' => Serialize::booleanToString($options['beta']), 'FriendlyName' => $options['friendlyName'], 'PhoneNumber' => $options['phoneNumber'], 'Origin' => $options['origin'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new LocalPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of LocalInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return LocalPage Page of LocalInstance */ public function getPage(string $targetUrl): LocalPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new LocalPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.LocalList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeOptions.php 0000644 00000066574 15021223077 0022645 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Options; use Twilio\Values; abstract class TollFreeOptions { /** * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an Identity to meet local regulations. * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @param string $emergencyStatus * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @param string $voiceReceiveMode * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * @return CreateTollFreeOptions Options builder */ public static function create( string $apiVersion = Values::NONE, string $friendlyName = Values::NONE, string $smsApplicationSid = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $voiceApplicationSid = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE ): CreateTollFreeOptions { return new CreateTollFreeOptions( $apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $identitySid, $addressSid, $emergencyStatus, $emergencyAddressSid, $trunkSid, $voiceReceiveMode, $bundleSid ); } /** * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $friendlyName A string that identifies the resources to read. * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * @return ReadTollFreeOptions Options builder */ public static function read( bool $beta = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE ): ReadTollFreeOptions { return new ReadTollFreeOptions( $beta, $friendlyName, $phoneNumber, $origin ); } } class CreateTollFreeOptions extends Options { /** * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an Identity to meet local regulations. * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @param string $emergencyStatus * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @param string $voiceReceiveMode * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. */ public function __construct( string $apiVersion = Values::NONE, string $friendlyName = Values::NONE, string $smsApplicationSid = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $voiceApplicationSid = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE ) { $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. * * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. * @return $this Fluent Builder */ public function setSmsApplicationSid(string $smsApplicationSid): self { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call when the new phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @return $this Fluent Builder */ public function setVoiceApplicationSid(string $voiceApplicationSid): self { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @return $this Fluent Builder */ public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The SID of the Identity resource that we should associate with the new phone number. Some regions require an Identity to meet local regulations. * * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an Identity to meet local regulations. * @return $this Fluent Builder */ public function setIdentitySid(string $identitySid): self { $this->options['identitySid'] = $identitySid; return $this; } /** * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * @param string $emergencyStatus * @return $this Fluent Builder */ public function setEmergencyStatus(string $emergencyStatus): self { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The SID of the emergency address configuration to use for emergency calling from the new phone number. * * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @return $this Fluent Builder */ public function setEmergencyAddressSid(string $emergencyAddressSid): self { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @return $this Fluent Builder */ public function setTrunkSid(string $trunkSid): self { $this->options['trunkSid'] = $trunkSid; return $this; } /** * @param string $voiceReceiveMode * @return $this Fluent Builder */ public function setVoiceReceiveMode(string $voiceReceiveMode): self { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * @return $this Fluent Builder */ public function setBundleSid(string $bundleSid): self { $this->options['bundleSid'] = $bundleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateTollFreeOptions ' . $options . ']'; } } class ReadTollFreeOptions extends Options { /** * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $friendlyName A string that identifies the resources to read. * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ public function __construct( bool $beta = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE ) { $this->options['beta'] = $beta; $this->options['friendlyName'] = $friendlyName; $this->options['phoneNumber'] = $phoneNumber; $this->options['origin'] = $origin; } /** * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * A string that identifies the resources to read. * * @param string $friendlyName A string that identifies the resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * @return $this Fluent Builder */ public function setOrigin(string $origin): self { $this->options['origin'] = $origin; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadTollFreeOptions ' . $options . ']'; } } Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionContext.php 0000644 00000005772 15021223077 0030037 0 ustar 00 sdk/src <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class AssignedAddOnExtensionContext extends InstanceContext { /** * Initialize the AssignedAddOnExtensionContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource to fetch. * @param string $resourceSid The SID of the Phone Number to which the Add-on is assigned. * @param string $assignedAddOnSid The SID that uniquely identifies the assigned Add-on installation. * @param string $sid The Twilio-provided string that uniquely identifies the resource to fetch. */ public function __construct( Version $version, $accountSid, $resourceSid, $assignedAddOnSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'assignedAddOnSid' => $assignedAddOnSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) .'/AssignedAddOns/' . \rawurlencode($assignedAddOnSid) .'/Extensions/' . \rawurlencode($sid) .'.json'; } /** * Fetch the AssignedAddOnExtensionInstance * * @return AssignedAddOnExtensionInstance Fetched AssignedAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssignedAddOnExtensionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AssignedAddOnExtensionInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['assignedAddOnSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AssignedAddOnExtensionContext ' . \implode(' ', $context) . ']'; } } src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionList.php 0000644 00000014504 15021223077 0027317 0 ustar 00 sdk <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AssignedAddOnExtensionList extends ListResource { /** * Construct the AssignedAddOnExtensionList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource to fetch. * @param string $resourceSid The SID of the Phone Number to which the Add-on is assigned. * @param string $assignedAddOnSid The SID that uniquely identifies the assigned Add-on installation. */ public function __construct( Version $version, string $accountSid, string $resourceSid, string $assignedAddOnSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'assignedAddOnSid' => $assignedAddOnSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) .'/AssignedAddOns/' . \rawurlencode($assignedAddOnSid) .'/Extensions.json'; } /** * Reads AssignedAddOnExtensionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssignedAddOnExtensionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AssignedAddOnExtensionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AssignedAddOnExtensionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AssignedAddOnExtensionPage Page of AssignedAddOnExtensionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AssignedAddOnExtensionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AssignedAddOnExtensionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssignedAddOnExtensionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AssignedAddOnExtensionPage Page of AssignedAddOnExtensionInstance */ public function getPage(string $targetUrl): AssignedAddOnExtensionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssignedAddOnExtensionPage($this->version, $response, $this->solution); } /** * Constructs a AssignedAddOnExtensionContext * * @param string $sid The Twilio-provided string that uniquely identifies the resource to fetch. */ public function getContext( string $sid ): AssignedAddOnExtensionContext { return new AssignedAddOnExtensionContext( $this->version, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['assignedAddOnSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AssignedAddOnExtensionList]'; } } Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionInstance.php 0000644 00000011356 15021223077 0030152 0 ustar 00 sdk/src <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $resourceSid * @property string|null $assignedAddOnSid * @property string|null $friendlyName * @property string|null $productName * @property string|null $uniqueName * @property string|null $uri * @property bool|null $enabled */ class AssignedAddOnExtensionInstance extends InstanceResource { /** * Initialize the AssignedAddOnExtensionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource to fetch. * @param string $resourceSid The SID of the Phone Number to which the Add-on is assigned. * @param string $assignedAddOnSid The SID that uniquely identifies the assigned Add-on installation. * @param string $sid The Twilio-provided string that uniquely identifies the resource to fetch. */ public function __construct(Version $version, array $payload, string $accountSid, string $resourceSid, string $assignedAddOnSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'resourceSid' => Values::array_get($payload, 'resource_sid'), 'assignedAddOnSid' => Values::array_get($payload, 'assigned_add_on_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'productName' => Values::array_get($payload, 'product_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'uri' => Values::array_get($payload, 'uri'), 'enabled' => Values::array_get($payload, 'enabled'), ]; $this->solution = ['accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'assignedAddOnSid' => $assignedAddOnSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AssignedAddOnExtensionContext Context for this AssignedAddOnExtensionInstance */ protected function proxy(): AssignedAddOnExtensionContext { if (!$this->context) { $this->context = new AssignedAddOnExtensionContext( $this->version, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['assignedAddOnSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the AssignedAddOnExtensionInstance * * @return AssignedAddOnExtensionInstance Fetched AssignedAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssignedAddOnExtensionInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AssignedAddOnExtensionInstance ' . \implode(' ', $context) . ']'; } } src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionPage.php 0000644 00000003431 15021223077 0027255 0 ustar 00 sdk <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AssignedAddOnExtensionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AssignedAddOnExtensionInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionInstance */ public function buildInstance(array $payload): AssignedAddOnExtensionInstance { return new AssignedAddOnExtensionInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['assignedAddOnSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AssignedAddOnExtensionPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalPage.php 0000644 00000003122 15021223077 0021360 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class LocalPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return LocalInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\LocalInstance */ public function buildInstance(array $payload): LocalInstance { return new LocalInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.LocalPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreePage.php 0000644 00000003144 15021223077 0022046 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TollFreePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TollFreeInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\TollFreeInstance */ public function buildInstance(array $payload): TollFreeInstance { return new TollFreeInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.TollFreePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalOptions.php 0000644 00000066623 15021223077 0022156 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Options; use Twilio\Values; abstract class LocalOptions { /** * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @param string $emergencyStatus * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @param string $voiceReceiveMode * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * @return CreateLocalOptions Options builder */ public static function create( string $apiVersion = Values::NONE, string $friendlyName = Values::NONE, string $smsApplicationSid = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $voiceApplicationSid = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE ): CreateLocalOptions { return new CreateLocalOptions( $apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $identitySid, $addressSid, $emergencyStatus, $emergencyAddressSid, $trunkSid, $voiceReceiveMode, $bundleSid ); } /** * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $friendlyName A string that identifies the resources to read. * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * @return ReadLocalOptions Options builder */ public static function read( bool $beta = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE ): ReadLocalOptions { return new ReadLocalOptions( $beta, $friendlyName, $phoneNumber, $origin ); } } class CreateLocalOptions extends Options { /** * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @param string $emergencyStatus * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @param string $voiceReceiveMode * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. */ public function __construct( string $apiVersion = Values::NONE, string $friendlyName = Values::NONE, string $smsApplicationSid = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, string $voiceApplicationSid = Values::NONE, bool $voiceCallerIdLookup = Values::BOOL_NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $identitySid = Values::NONE, string $addressSid = Values::NONE, string $emergencyStatus = Values::NONE, string $emergencyAddressSid = Values::NONE, string $trunkSid = Values::NONE, string $voiceReceiveMode = Values::NONE, string $bundleSid = Values::NONE ) { $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * @return $this Fluent Builder */ public function setSmsApplicationSid(string $smsApplicationSid): self { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call when the new phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * @return $this Fluent Builder */ public function setVoiceApplicationSid(string $voiceApplicationSid): self { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * @return $this Fluent Builder */ public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * @return $this Fluent Builder */ public function setIdentitySid(string $identitySid): self { $this->options['identitySid'] = $identitySid; return $this; } /** * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * @param string $emergencyStatus * @return $this Fluent Builder */ public function setEmergencyStatus(string $emergencyStatus): self { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The SID of the emergency address configuration to use for emergency calling from the new phone number. * * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. * @return $this Fluent Builder */ public function setEmergencyAddressSid(string $emergencyAddressSid): self { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * @return $this Fluent Builder */ public function setTrunkSid(string $trunkSid): self { $this->options['trunkSid'] = $trunkSid; return $this; } /** * @param string $voiceReceiveMode * @return $this Fluent Builder */ public function setVoiceReceiveMode(string $voiceReceiveMode): self { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * @return $this Fluent Builder */ public function setBundleSid(string $bundleSid): self { $this->options['bundleSid'] = $bundleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.CreateLocalOptions ' . $options . ']'; } } class ReadLocalOptions extends Options { /** * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @param string $friendlyName A string that identifies the resources to read. * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. */ public function __construct( bool $beta = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $phoneNumber = Values::NONE, string $origin = Values::NONE ) { $this->options['beta'] = $beta; $this->options['friendlyName'] = $friendlyName; $this->options['phoneNumber'] = $phoneNumber; $this->options['origin'] = $origin; } /** * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * @return $this Fluent Builder */ public function setBeta(bool $beta): self { $this->options['beta'] = $beta; return $this; } /** * A string that identifies the resources to read. * * @param string $friendlyName A string that identifies the resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * @return $this Fluent Builder */ public function setOrigin(string $origin): self { $this->options['origin'] = $origin; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadLocalOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnInstance.php 0000644 00000012371 15021223077 0023667 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $resourceSid * @property string|null $friendlyName * @property string|null $description * @property array|null $configuration * @property string|null $uniqueName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $uri * @property array|null $subresourceUris */ class AssignedAddOnInstance extends InstanceResource { protected $_extensions; /** * Initialize the AssignedAddOnInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $resourceSid The SID of the Phone Number to assign the Add-on. * @param string $sid The Twilio-provided string that uniquely identifies the resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $resourceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'resourceSid' => Values::array_get($payload, 'resource_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'description' => Values::array_get($payload, 'description'), 'configuration' => Values::array_get($payload, 'configuration'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ]; $this->solution = ['accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AssignedAddOnContext Context for this AssignedAddOnInstance */ protected function proxy(): AssignedAddOnContext { if (!$this->context) { $this->context = new AssignedAddOnContext( $this->version, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the AssignedAddOnInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AssignedAddOnInstance * * @return AssignedAddOnInstance Fetched AssignedAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AssignedAddOnInstance { return $this->proxy()->fetch(); } /** * Access the extensions */ protected function getExtensions(): AssignedAddOnExtensionList { return $this->proxy()->extensions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AssignedAddOnInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnList.php 0000644 00000015117 15021223077 0023037 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AssignedAddOnList extends ListResource { /** * Construct the AssignedAddOnList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. * @param string $resourceSid The SID of the Phone Number to assign the Add-on. */ public function __construct( Version $version, string $accountSid, string $resourceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'resourceSid' => $resourceSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) .'/AssignedAddOns.json'; } /** * Create the AssignedAddOnInstance * * @param string $installedAddOnSid The SID that identifies the Add-on installation. * @return AssignedAddOnInstance Created AssignedAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $installedAddOnSid): AssignedAddOnInstance { $data = Values::of([ 'InstalledAddOnSid' => $installedAddOnSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AssignedAddOnInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid'] ); } /** * Reads AssignedAddOnInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssignedAddOnInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AssignedAddOnInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AssignedAddOnInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AssignedAddOnPage Page of AssignedAddOnInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AssignedAddOnPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AssignedAddOnPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssignedAddOnInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AssignedAddOnPage Page of AssignedAddOnInstance */ public function getPage(string $targetUrl): AssignedAddOnPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssignedAddOnPage($this->version, $response, $this->solution); } /** * Constructs a AssignedAddOnContext * * @param string $sid The Twilio-provided string that uniquely identifies the resource to delete. */ public function getContext( string $sid ): AssignedAddOnContext { return new AssignedAddOnContext( $this->version, $this->solution['accountSid'], $this->solution['resourceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AssignedAddOnList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileList.php 0000644 00000020344 15021223077 0021601 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class MobileList extends ListResource { /** * Construct the MobileList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/IncomingPhoneNumbers/Mobile.json'; } /** * Create the MobileInstance * * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * @param array|Options $options Optional Arguments * @return MobileInstance Created MobileInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumber, array $options = []): MobileInstance { $options = new Values($options); $data = Values::of([ 'PhoneNumber' => $phoneNumber, 'ApiVersion' => $options['apiVersion'], 'FriendlyName' => $options['friendlyName'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceApplicationSid' => $options['voiceApplicationSid'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'IdentitySid' => $options['identitySid'], 'AddressSid' => $options['addressSid'], 'EmergencyStatus' => $options['emergencyStatus'], 'EmergencyAddressSid' => $options['emergencyAddressSid'], 'TrunkSid' => $options['trunkSid'], 'VoiceReceiveMode' => $options['voiceReceiveMode'], 'BundleSid' => $options['bundleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MobileInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads MobileInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MobileInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MobileInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MobileInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MobilePage Page of MobileInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MobilePage { $options = new Values($options); $params = Values::of([ 'Beta' => Serialize::booleanToString($options['beta']), 'FriendlyName' => $options['friendlyName'], 'PhoneNumber' => $options['phoneNumber'], 'Origin' => $options['origin'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MobilePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MobileInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MobilePage Page of MobileInstance */ public function getPage(string $targetUrl): MobilePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MobilePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MobileList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdPage.php 0000644 00000003154 15021223077 0017620 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class OutgoingCallerIdPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return OutgoingCallerIdInstance \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdInstance */ public function buildInstance(array $payload): OutgoingCallerIdInstance { return new OutgoingCallerIdInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.OutgoingCallerIdPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyInstance.php 0000644 00000005243 15021223077 0016520 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $secret */ class NewKeyInstance extends InstanceResource { /** * Initialize the NewKeyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will be responsible for the new Key resource. */ public function __construct(Version $version, array $payload, string $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'secret' => Values::array_get($payload, 'secret'), ]; $this->solution = ['accountSid' => $accountSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.NewKeyInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeOptions.php 0000644 00000021463 15021223077 0017101 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class ShortCodeOptions { /** * @param string $friendlyName The string that identifies the ShortCode resources to read. * @param string $shortCode Only show the ShortCode resources that match this pattern. You can specify partial numbers and use '*' as a wildcard for any digit. * @return ReadShortCodeOptions Options builder */ public static function read( string $friendlyName = Values::NONE, string $shortCode = Values::NONE ): ReadShortCodeOptions { return new ReadShortCodeOptions( $friendlyName, $shortCode ); } /** * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the `FriendlyName` is the short code. * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. * @param string $smsUrl The URL we should call when receiving an incoming SMS message to this short code. * @param string $smsMethod The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`. * @param string $smsFallbackUrl The URL that we should call if an error occurs while retrieving or executing the TwiML from `sms_url`. * @param string $smsFallbackMethod The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or `POST`. * @return UpdateShortCodeOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $apiVersion = Values::NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE ): UpdateShortCodeOptions { return new UpdateShortCodeOptions( $friendlyName, $apiVersion, $smsUrl, $smsMethod, $smsFallbackUrl, $smsFallbackMethod ); } } class ReadShortCodeOptions extends Options { /** * @param string $friendlyName The string that identifies the ShortCode resources to read. * @param string $shortCode Only show the ShortCode resources that match this pattern. You can specify partial numbers and use '*' as a wildcard for any digit. */ public function __construct( string $friendlyName = Values::NONE, string $shortCode = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['shortCode'] = $shortCode; } /** * The string that identifies the ShortCode resources to read. * * @param string $friendlyName The string that identifies the ShortCode resources to read. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Only show the ShortCode resources that match this pattern. You can specify partial numbers and use '*' as a wildcard for any digit. * * @param string $shortCode Only show the ShortCode resources that match this pattern. You can specify partial numbers and use '*' as a wildcard for any digit. * @return $this Fluent Builder */ public function setShortCode(string $shortCode): self { $this->options['shortCode'] = $shortCode; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.ReadShortCodeOptions ' . $options . ']'; } } class UpdateShortCodeOptions extends Options { /** * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the `FriendlyName` is the short code. * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. * @param string $smsUrl The URL we should call when receiving an incoming SMS message to this short code. * @param string $smsMethod The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`. * @param string $smsFallbackUrl The URL that we should call if an error occurs while retrieving or executing the TwiML from `sms_url`. * @param string $smsFallbackMethod The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or `POST`. */ public function __construct( string $friendlyName = Values::NONE, string $apiVersion = Values::NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['apiVersion'] = $apiVersion; $this->options['smsUrl'] = $smsUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; } /** * A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the `FriendlyName` is the short code. * * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the `FriendlyName` is the short code. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. * * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. * @return $this Fluent Builder */ public function setApiVersion(string $apiVersion): self { $this->options['apiVersion'] = $apiVersion; return $this; } /** * The URL we should call when receiving an incoming SMS message to this short code. * * @param string $smsUrl The URL we should call when receiving an incoming SMS message to this short code. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`. * * @param string $smsMethod The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL that we should call if an error occurs while retrieving or executing the TwiML from `sms_url`. * * @param string $smsFallbackUrl The URL that we should call if an error occurs while retrieving or executing the TwiML from `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or `POST`. * * @param string $smsFallbackMethod The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateShortCodeOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/RecordingContext.php 0000644 00000012474 15021223077 0017116 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Api\V2010\Account\Recording\AddOnResultList; use Twilio\Rest\Api\V2010\Account\Recording\TranscriptionList; /** * @property AddOnResultList $addOnResults * @property TranscriptionList $transcriptions * @method \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultContext addOnResults(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Recording\TranscriptionContext transcriptions(string $sid) */ class RecordingContext extends InstanceContext { protected $_addOnResults; protected $_transcriptions; /** * Initialize the RecordingContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resources to delete. * @param string $sid The Twilio-provided string that uniquely identifies the Recording resource to delete. */ public function __construct( Version $version, $accountSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'sid' => $sid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Recordings/' . \rawurlencode($sid) .'.json'; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RecordingInstance * * @param array|Options $options Optional Arguments * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): RecordingInstance { $options = new Values($options); $params = Values::of([ 'IncludeSoftDeleted' => Serialize::booleanToString($options['includeSoftDeleted']), ]); $payload = $this->version->fetch('GET', $this->uri, $params, []); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the addOnResults */ protected function getAddOnResults(): AddOnResultList { if (!$this->_addOnResults) { $this->_addOnResults = new AddOnResultList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_addOnResults; } /** * Access the transcriptions */ protected function getTranscriptions(): TranscriptionList { if (!$this->_transcriptions) { $this->_transcriptions = new TranscriptionList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_transcriptions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/MessageList.php 0000644 00000021353 15021223077 0016051 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) creating the Message resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Messages.json'; } /** * Create the MessageInstance * * @param string $to The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`. * @param array|Options $options Optional Arguments * @return MessageInstance Created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $to, array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'To' => $to, 'StatusCallback' => $options['statusCallback'], 'ApplicationSid' => $options['applicationSid'], 'MaxPrice' => $options['maxPrice'], 'ProvideFeedback' => Serialize::booleanToString($options['provideFeedback']), 'Attempt' => $options['attempt'], 'ValidityPeriod' => $options['validityPeriod'], 'ForceDelivery' => Serialize::booleanToString($options['forceDelivery']), 'ContentRetention' => $options['contentRetention'], 'AddressRetention' => $options['addressRetention'], 'SmartEncoded' => Serialize::booleanToString($options['smartEncoded']), 'PersistentAction' => Serialize::map($options['persistentAction'], function ($e) { return $e; }), 'ShortenUrls' => Serialize::booleanToString($options['shortenUrls']), 'ScheduleType' => $options['scheduleType'], 'SendAt' => Serialize::iso8601DateTime($options['sendAt']), 'SendAsMms' => Serialize::booleanToString($options['sendAsMms']), 'ContentVariables' => $options['contentVariables'], 'RiskCheck' => $options['riskCheck'], 'From' => $options['from'], 'MessagingServiceSid' => $options['messagingServiceSid'], 'Body' => $options['body'], 'MediaUrl' => Serialize::map($options['mediaUrl'], function ($e) { return $e; }), 'ContentSid' => $options['contentSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MessageInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagePage Page of MessageInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagePage { $options = new Values($options); $params = Values::of([ 'To' => $options['to'], 'From' => $options['from'], 'DateSent<' => Serialize::iso8601DateTime($options['dateSentBefore']), 'DateSent' => Serialize::iso8601DateTime($options['dateSent']), 'DateSent>' => Serialize::iso8601DateTime($options['dateSentAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagePage Page of MessageInstance */ public function getPage(string $targetUrl): MessagePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid The SID of the Message resource you wish to delete */ public function getContext( string $sid ): MessageContext { return new MessageContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.MessageList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php 0000644 00000004670 15021223077 0021272 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class AuthorizedConnectAppContext extends InstanceContext { /** * Initialize the AuthorizedConnectAppContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AuthorizedConnectApp resource to fetch. * @param string $connectAppSid The SID of the Connect App to fetch. */ public function __construct( Version $version, $accountSid, $connectAppSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'connectAppSid' => $connectAppSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AuthorizedConnectApps/' . \rawurlencode($connectAppSid) .'.json'; } /** * Fetch the AuthorizedConnectAppInstance * * @return AuthorizedConnectAppInstance Fetched AuthorizedConnectAppInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthorizedConnectAppInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AuthorizedConnectAppInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['connectAppSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthorizedConnectAppContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationList.php 0000644 00000017422 15021223077 0016732 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ApplicationList extends ListResource { /** * Construct the ApplicationList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that will create the resource. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/Applications.json'; } /** * Create the ApplicationInstance * * @param array|Options $options Optional Arguments * @return ApplicationInstance Created ApplicationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ApplicationInstance { $options = new Values($options); $data = Values::of([ 'ApiVersion' => $options['apiVersion'], 'VoiceUrl' => $options['voiceUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'SmsUrl' => $options['smsUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsStatusCallback' => $options['smsStatusCallback'], 'MessageStatusCallback' => $options['messageStatusCallback'], 'FriendlyName' => $options['friendlyName'], 'PublicApplicationConnectEnabled' => Serialize::booleanToString($options['publicApplicationConnectEnabled']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ApplicationInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Reads ApplicationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ApplicationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ApplicationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ApplicationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ApplicationPage Page of ApplicationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ApplicationPage { $options = new Values($options); $params = Values::of([ 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ApplicationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ApplicationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ApplicationPage Page of ApplicationInstance */ public function getPage(string $targetUrl): ApplicationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ApplicationPage($this->version, $response, $this->solution); } /** * Constructs a ApplicationContext * * @param string $sid The Twilio-provided string that uniquely identifies the Application resource to delete. */ public function getContext( string $sid ): ApplicationContext { return new ApplicationContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.ApplicationList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php 0000644 00000016352 15021223077 0022610 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalList; /** * @property VoipList $voip * @property NationalList $national * @property MobileList $mobile * @property MachineToMachineList $machineToMachine * @property TollFreeList $tollFree * @property SharedCostList $sharedCost * @property LocalList $local */ class AvailablePhoneNumberCountryContext extends InstanceContext { protected $_voip; protected $_national; protected $_mobile; protected $_machineToMachine; protected $_tollFree; protected $_sharedCost; protected $_local; /** * Initialize the AvailablePhoneNumberCountryContext * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) requesting the available phone number Country resource. * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country to fetch available phone number information about. */ public function __construct( Version $version, $accountSid, $countryCode ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, 'countryCode' => $countryCode, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) .'.json'; } /** * Fetch the AvailablePhoneNumberCountryInstance * * @return AvailablePhoneNumberCountryInstance Fetched AvailablePhoneNumberCountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AvailablePhoneNumberCountryInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AvailablePhoneNumberCountryInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode'] ); } /** * Access the voip */ protected function getVoip(): VoipList { if (!$this->_voip) { $this->_voip = new VoipList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_voip; } /** * Access the national */ protected function getNational(): NationalList { if (!$this->_national) { $this->_national = new NationalList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_national; } /** * Access the mobile */ protected function getMobile(): MobileList { if (!$this->_mobile) { $this->_mobile = new MobileList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_mobile; } /** * Access the machineToMachine */ protected function getMachineToMachine(): MachineToMachineList { if (!$this->_machineToMachine) { $this->_machineToMachine = new MachineToMachineList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_machineToMachine; } /** * Access the tollFree */ protected function getTollFree(): TollFreeList { if (!$this->_tollFree) { $this->_tollFree = new TollFreeList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_tollFree; } /** * Access the sharedCost */ protected function getSharedCost(): SharedCostList { if (!$this->_sharedCost) { $this->_sharedCost = new SharedCostList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_sharedCost; } /** * Access the local */ protected function getLocal(): LocalList { if (!$this->_local) { $this->_local = new LocalList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_local; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AvailablePhoneNumberCountryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdList.php 0000644 00000014014 15021223077 0017654 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class OutgoingCallerIdList extends ListResource { /** * Construct the OutgoingCallerIdList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the OutgoingCallerId resources to delete. */ public function __construct( Version $version, string $accountSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'accountSid' => $accountSid, ]; $this->uri = '/Accounts/' . \rawurlencode($accountSid) .'/OutgoingCallerIds.json'; } /** * Reads OutgoingCallerIdInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return OutgoingCallerIdInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams OutgoingCallerIdInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of OutgoingCallerIdInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return OutgoingCallerIdPage Page of OutgoingCallerIdInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): OutgoingCallerIdPage { $options = new Values($options); $params = Values::of([ 'PhoneNumber' => $options['phoneNumber'], 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new OutgoingCallerIdPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of OutgoingCallerIdInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return OutgoingCallerIdPage Page of OutgoingCallerIdInstance */ public function getPage(string $targetUrl): OutgoingCallerIdPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new OutgoingCallerIdPage($this->version, $response, $this->solution); } /** * Constructs a OutgoingCallerIdContext * * @param string $sid The Twilio-provided string that uniquely identifies the OutgoingCallerId resource to delete. */ public function getContext( string $sid ): OutgoingCallerIdContext { return new OutgoingCallerIdContext( $this->version, $this->solution['accountSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.OutgoingCallerIdList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SipPage.php 0000644 00000003036 15021223077 0015157 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SipPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SipInstance \Twilio\Rest\Api\V2010\Account\SipInstance */ public function buildInstance(array $payload): SipInstance { return new SipInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.SipPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/KeyOptions.php 0000644 00000004136 15021223077 0015735 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class KeyOptions { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return UpdateKeyOptions Options builder */ public static function update( string $friendlyName = Values::NONE ): UpdateKeyOptions { return new UpdateKeyOptions( $friendlyName ); } } class UpdateKeyOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Api.V2010.UpdateKeyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/RecordingInstance.php 0000644 00000014220 15021223077 0017225 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Api\V2010\Account\Recording\AddOnResultList; use Twilio\Rest\Api\V2010\Account\Recording\TranscriptionList; /** * @property string|null $accountSid * @property string|null $apiVersion * @property string|null $callSid * @property string|null $conferenceSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property \DateTime|null $startTime * @property string|null $duration * @property string|null $sid * @property string|null $price * @property string|null $priceUnit * @property string $status * @property int|null $channels * @property string $source * @property int|null $errorCode * @property string|null $uri * @property array|null $encryptionDetails * @property array|null $subresourceUris * @property string|null $mediaUrl */ class RecordingInstance extends InstanceResource { protected $_addOnResults; protected $_transcriptions; /** * Initialize the RecordingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording resources to delete. * @param string $sid The Twilio-provided string that uniquely identifies the Recording resource to delete. */ public function __construct(Version $version, array $payload, string $accountSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callSid' => Values::array_get($payload, 'call_sid'), 'conferenceSid' => Values::array_get($payload, 'conference_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'duration' => Values::array_get($payload, 'duration'), 'sid' => Values::array_get($payload, 'sid'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'status' => Values::array_get($payload, 'status'), 'channels' => Values::array_get($payload, 'channels'), 'source' => Values::array_get($payload, 'source'), 'errorCode' => Values::array_get($payload, 'error_code'), 'uri' => Values::array_get($payload, 'uri'), 'encryptionDetails' => Values::array_get($payload, 'encryption_details'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'mediaUrl' => Values::array_get($payload, 'media_url'), ]; $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RecordingContext Context for this RecordingInstance */ protected function proxy(): RecordingContext { if (!$this->context) { $this->context = new RecordingContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RecordingInstance * * @param array|Options $options Optional Arguments * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): RecordingInstance { return $this->proxy()->fetch($options); } /** * Access the addOnResults */ protected function getAddOnResults(): AddOnResultList { return $this->proxy()->addOnResults; } /** * Access the transcriptions */ protected function getTranscriptions(): TranscriptionList { return $this->proxy()->transcriptions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/AccountInstance.php 0000644 00000023767 15021223077 0015331 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Api\V2010\Account\RecordingList; use Twilio\Rest\Api\V2010\Account\UsageList; use Twilio\Rest\Api\V2010\Account\MessageList; use Twilio\Rest\Api\V2010\Account\KeyList; use Twilio\Rest\Api\V2010\Account\NewKeyList; use Twilio\Rest\Api\V2010\Account\ApplicationList; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList; use Twilio\Rest\Api\V2010\Account\ConferenceList; use Twilio\Rest\Api\V2010\Account\CallList; use Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList; use Twilio\Rest\Api\V2010\Account\ValidationRequestList; use Twilio\Rest\Api\V2010\Account\TranscriptionList; use Twilio\Rest\Api\V2010\Account\ConnectAppList; use Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList; use Twilio\Rest\Api\V2010\Account\TokenList; use Twilio\Rest\Api\V2010\Account\BalanceList; use Twilio\Rest\Api\V2010\Account\SipList; use Twilio\Rest\Api\V2010\Account\NotificationList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList; use Twilio\Rest\Api\V2010\Account\AddressList; use Twilio\Rest\Api\V2010\Account\QueueList; use Twilio\Rest\Api\V2010\Account\ShortCodeList; use Twilio\Rest\Api\V2010\Account\SigningKeyList; use Twilio\Rest\Api\V2010\Account\NewSigningKeyList; /** * @property string|null $authToken * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string|null $ownerAccountSid * @property string|null $sid * @property string $status * @property array|null $subresourceUris * @property string $type * @property string|null $uri */ class AccountInstance extends InstanceResource { protected $_recordings; protected $_usage; protected $_messages; protected $_keys; protected $_newKeys; protected $_applications; protected $_incomingPhoneNumbers; protected $_conferences; protected $_calls; protected $_outgoingCallerIds; protected $_validationRequests; protected $_transcriptions; protected $_connectApps; protected $_authorizedConnectApps; protected $_tokens; protected $_balance; protected $_sip; protected $_notifications; protected $_availablePhoneNumbers; protected $_addresses; protected $_queues; protected $_shortCodes; protected $_signingKeys; protected $_newSigningKeys; /** * Initialize the AccountInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The Account Sid that uniquely identifies the account to fetch */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'authToken' => Values::array_get($payload, 'auth_token'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'ownerAccountSid' => Values::array_get($payload, 'owner_account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'type' => Values::array_get($payload, 'type'), 'uri' => Values::array_get($payload, 'uri'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AccountContext Context for this AccountInstance */ protected function proxy(): AccountContext { if (!$this->context) { $this->context = new AccountContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the AccountInstance * * @return AccountInstance Fetched AccountInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AccountInstance { return $this->proxy()->fetch(); } /** * Update the AccountInstance * * @param array|Options $options Optional Arguments * @return AccountInstance Updated AccountInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AccountInstance { return $this->proxy()->update($options); } /** * Access the recordings */ protected function getRecordings(): RecordingList { return $this->proxy()->recordings; } /** * Access the usage */ protected function getUsage(): UsageList { return $this->proxy()->usage; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Access the keys */ protected function getKeys(): KeyList { return $this->proxy()->keys; } /** * Access the newKeys */ protected function getNewKeys(): NewKeyList { return $this->proxy()->newKeys; } /** * Access the applications */ protected function getApplications(): ApplicationList { return $this->proxy()->applications; } /** * Access the incomingPhoneNumbers */ protected function getIncomingPhoneNumbers(): IncomingPhoneNumberList { return $this->proxy()->incomingPhoneNumbers; } /** * Access the conferences */ protected function getConferences(): ConferenceList { return $this->proxy()->conferences; } /** * Access the calls */ protected function getCalls(): CallList { return $this->proxy()->calls; } /** * Access the outgoingCallerIds */ protected function getOutgoingCallerIds(): OutgoingCallerIdList { return $this->proxy()->outgoingCallerIds; } /** * Access the validationRequests */ protected function getValidationRequests(): ValidationRequestList { return $this->proxy()->validationRequests; } /** * Access the transcriptions */ protected function getTranscriptions(): TranscriptionList { return $this->proxy()->transcriptions; } /** * Access the connectApps */ protected function getConnectApps(): ConnectAppList { return $this->proxy()->connectApps; } /** * Access the authorizedConnectApps */ protected function getAuthorizedConnectApps(): AuthorizedConnectAppList { return $this->proxy()->authorizedConnectApps; } /** * Access the tokens */ protected function getTokens(): TokenList { return $this->proxy()->tokens; } /** * Access the balance */ protected function getBalance(): BalanceList { return $this->proxy()->balance; } /** * Access the sip */ protected function getSip(): SipList { return $this->proxy()->sip; } /** * Access the notifications */ protected function getNotifications(): NotificationList { return $this->proxy()->notifications; } /** * Access the availablePhoneNumbers */ protected function getAvailablePhoneNumbers(): AvailablePhoneNumberCountryList { return $this->proxy()->availablePhoneNumbers; } /** * Access the addresses */ protected function getAddresses(): AddressList { return $this->proxy()->addresses; } /** * Access the queues */ protected function getQueues(): QueueList { return $this->proxy()->queues; } /** * Access the shortCodes */ protected function getShortCodes(): ShortCodeList { return $this->proxy()->shortCodes; } /** * Access the signingKeys */ protected function getSigningKeys(): SigningKeyList { return $this->proxy()->signingKeys; } /** * Access the newSigningKeys */ protected function getNewSigningKeys(): NewSigningKeyList { return $this->proxy()->newSigningKeys; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AccountInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/AccountList.php 0000644 00000014165 15021223077 0014470 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Api * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Api\V2010; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AccountList extends ListResource { /** * Construct the AccountList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Accounts.json'; } /** * Create the AccountInstance * * @param array|Options $options Optional Arguments * @return AccountInstance Created AccountInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): AccountInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AccountInstance( $this->version, $payload ); } /** * Reads AccountInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AccountInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams AccountInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AccountInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AccountPage Page of AccountInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AccountPage { $options = new Values($options); $params = Values::of([ 'FriendlyName' => $options['friendlyName'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AccountPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AccountInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AccountPage Page of AccountInstance */ public function getPage(string $targetUrl): AccountPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AccountPage($this->version, $response, $this->solution); } /** * Constructs a AccountContext * * @param string $sid The Account Sid that uniquely identifies the account to fetch */ public function getContext( string $sid ): AccountContext { return new AccountContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api.V2010.AccountList]'; } } sdk/src/Twilio/Rest/FlexApiBase.php 0000644 00000005201 15021223077 0013131 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\FlexApi\V1; use Twilio\Rest\FlexApi\V2; /** * @property \Twilio\Rest\FlexApi\V1 $v1 * @property \Twilio\Rest\FlexApi\V2 $v2 */ class FlexApiBase extends Domain { protected $_v1; protected $_v2; /** * Construct the FlexApi Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://flex-api.twilio.com'; } /** * @return V1 Version v1 of flex-api */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return V2 Version v2 of flex-api */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.FlexApi]'; } } sdk/src/Twilio/Rest/IpMessagingBase.php 0000644 00000005251 15021223077 0014014 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\IpMessaging\V1; use Twilio\Rest\IpMessaging\V2; /** * @property \Twilio\Rest\IpMessaging\V1 $v1 * @property \Twilio\Rest\IpMessaging\V2 $v2 */ class IpMessagingBase extends Domain { protected $_v1; protected $_v2; /** * Construct the IpMessaging Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://ip-messaging.twilio.com'; } /** * @return V1 Version v1 of ip-messaging */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return V2 Version v2 of ip-messaging */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging]'; } } sdk/src/Twilio/Rest/Taskrouter.php 0000644 00000001333 15021223077 0013153 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Taskrouter\V1; class Taskrouter extends TaskrouterBase { /** * @deprecated Use v1->workspaces instead. */ protected function getWorkspaces(): \Twilio\Rest\Taskrouter\V1\WorkspaceList { echo "workspaces is deprecated. Use v1->workspaces instead."; return $this->v1->workspaces; } /** * @deprecated Use v1->workspaces(\$sid) instead. * @param string $sid The SID of the resource to fetch */ protected function contextWorkspaces(string $sid): \Twilio\Rest\Taskrouter\V1\WorkspaceContext { echo "workspaces(\$sid) is deprecated. Use v1->workspaces(\$sid) instead."; return $this->v1->workspaces($sid); } } sdk/src/Twilio/Rest/ApiBase.php 0000644 00000004541 15021223077 0012320 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Api\V2010; /** * @property \Twilio\Rest\Api\V2010 $v2010 */ class ApiBase extends Domain { protected $_v2010; /** * Construct the Api Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://api.twilio.com'; } /** * @return V2010 Version v2010 of api */ protected function getV2010(): V2010 { if (!$this->_v2010) { $this->_v2010 = new V2010($this); } return $this->_v2010; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Api]'; } } sdk/src/Twilio/Rest/AccountsBase.php 0000644 00000004540 15021223077 0013365 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Accounts\V1; /** * @property \Twilio\Rest\Accounts\V1 $v1 */ class AccountsBase extends Domain { protected $_v1; /** * Construct the Accounts Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://accounts.twilio.com'; } /** * @return V1 Version v1 of accounts */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts]'; } } sdk/src/Twilio/Rest/Intelligence/V2/TranscriptContext.php 0000644 00000011671 15021223077 0017405 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Intelligence\V2\Transcript\OperatorResultList; use Twilio\Rest\Intelligence\V2\Transcript\SentenceList; use Twilio\Rest\Intelligence\V2\Transcript\MediaList; /** * @property OperatorResultList $operatorResults * @property SentenceList $sentences * @property MediaList $media * @method \Twilio\Rest\Intelligence\V2\Transcript\OperatorResultContext operatorResults(string $operatorSid) * @method \Twilio\Rest\Intelligence\V2\Transcript\MediaContext media() */ class TranscriptContext extends InstanceContext { protected $_operatorResults; protected $_sentences; protected $_media; /** * Initialize the TranscriptContext * * @param Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies this Transcript. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Transcripts/' . \rawurlencode($sid) .''; } /** * Delete the TranscriptInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the TranscriptInstance * * @return TranscriptInstance Fetched TranscriptInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TranscriptInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new TranscriptInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the operatorResults */ protected function getOperatorResults(): OperatorResultList { if (!$this->_operatorResults) { $this->_operatorResults = new OperatorResultList( $this->version, $this->solution['sid'] ); } return $this->_operatorResults; } /** * Access the sentences */ protected function getSentences(): SentenceList { if (!$this->_sentences) { $this->_sentences = new SentenceList( $this->version, $this->solution['sid'] ); } return $this->_sentences; } /** * Access the media */ protected function getMedia(): MediaList { if (!$this->_media) { $this->_media = new MediaList( $this->version, $this->solution['sid'] ); } return $this->_media; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.TranscriptContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/ServiceInstance.php 0000644 00000012416 15021223077 0016772 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property bool|null $autoRedaction * @property bool|null $mediaRedaction * @property bool|null $autoTranscribe * @property bool|null $dataLogging * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string|null $languageCode * @property string|null $sid * @property string|null $uniqueName * @property string|null $url * @property string|null $webhookUrl * @property string $webhookHttpMethod * @property int|null $version */ class ServiceInstance extends InstanceResource { /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies this Service. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'autoRedaction' => Values::array_get($payload, 'auto_redaction'), 'mediaRedaction' => Values::array_get($payload, 'media_redaction'), 'autoTranscribe' => Values::array_get($payload, 'auto_transcribe'), 'dataLogging' => Values::array_get($payload, 'data_logging'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'languageCode' => Values::array_get($payload, 'language_code'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'webhookHttpMethod' => Values::array_get($payload, 'webhook_http_method'), 'version' => Values::array_get($payload, 'version'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/ServiceList.php 0000644 00000015222 15021223077 0016137 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $uniqueName Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. * @param array|Options $options Optional Arguments * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $uniqueName, array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $uniqueName, 'AutoTranscribe' => Serialize::booleanToString($options['autoTranscribe']), 'DataLogging' => Serialize::booleanToString($options['dataLogging']), 'FriendlyName' => $options['friendlyName'], 'LanguageCode' => $options['languageCode'], 'AutoRedaction' => Serialize::booleanToString($options['autoRedaction']), 'MediaRedaction' => Serialize::booleanToString($options['mediaRedaction']), 'WebhookUrl' => $options['webhookUrl'], 'WebhookHttpMethod' => $options['webhookHttpMethod'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid A 34 character string that uniquely identifies this Service. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.ServiceList]'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaList.php 0000644 00000003002 15021223077 0017700 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2\Transcript; use Twilio\ListResource; use Twilio\Version; class MediaList extends ListResource { /** * Construct the MediaList * * @param Version $version Version that contains the resource * @param string $sid The unique SID identifier of the Transcript. */ public function __construct( Version $version, string $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; } /** * Constructs a MediaContext */ public function getContext( ): MediaContext { return new MediaContext( $this->version, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.MediaList]'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultOptions.php 0000644 00000007416 15021223077 0022410 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2\Transcript; use Twilio\Options; use Twilio\Values; abstract class OperatorResultOptions { /** * @param bool $redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. * @return FetchOperatorResultOptions Options builder */ public static function fetch( bool $redacted = Values::BOOL_NONE ): FetchOperatorResultOptions { return new FetchOperatorResultOptions( $redacted ); } /** * @param bool $redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. * @return ReadOperatorResultOptions Options builder */ public static function read( bool $redacted = Values::BOOL_NONE ): ReadOperatorResultOptions { return new ReadOperatorResultOptions( $redacted ); } } class FetchOperatorResultOptions extends Options { /** * @param bool $redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. */ public function __construct( bool $redacted = Values::BOOL_NONE ) { $this->options['redacted'] = $redacted; } /** * Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. * * @param bool $redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. * @return $this Fluent Builder */ public function setRedacted(bool $redacted): self { $this->options['redacted'] = $redacted; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.FetchOperatorResultOptions ' . $options . ']'; } } class ReadOperatorResultOptions extends Options { /** * @param bool $redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. */ public function __construct( bool $redacted = Values::BOOL_NONE ) { $this->options['redacted'] = $redacted; } /** * Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. * * @param bool $redacted Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True. * @return $this Fluent Builder */ public function setRedacted(bool $redacted): self { $this->options['redacted'] = $redacted; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.ReadOperatorResultOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultList.php 0000644 00000013676 15021223077 0021675 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2\Transcript; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class OperatorResultList extends ListResource { /** * Construct the OperatorResultList * * @param Version $version Version that contains the resource * @param string $transcriptSid A 34 character string that uniquely identifies this Transcript. */ public function __construct( Version $version, string $transcriptSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'transcriptSid' => $transcriptSid, ]; $this->uri = '/Transcripts/' . \rawurlencode($transcriptSid) .'/OperatorResults'; } /** * Reads OperatorResultInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return OperatorResultInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams OperatorResultInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of OperatorResultInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return OperatorResultPage Page of OperatorResultInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): OperatorResultPage { $options = new Values($options); $params = Values::of([ 'Redacted' => Serialize::booleanToString($options['redacted']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new OperatorResultPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of OperatorResultInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return OperatorResultPage Page of OperatorResultInstance */ public function getPage(string $targetUrl): OperatorResultPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new OperatorResultPage($this->version, $response, $this->solution); } /** * Constructs a OperatorResultContext * * @param string $operatorSid A 34 character string that identifies this Language Understanding operator sid. */ public function getContext( string $operatorSid ): OperatorResultContext { return new OperatorResultContext( $this->version, $this->solution['transcriptSid'], $operatorSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.OperatorResultList]'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultPage.php 0000644 00000003204 15021223077 0021620 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2\Transcript; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class OperatorResultPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return OperatorResultInstance \Twilio\Rest\Intelligence\V2\Transcript\OperatorResultInstance */ public function buildInstance(array $payload): OperatorResultInstance { return new OperatorResultInstance($this->version, $payload, $this->solution['transcriptSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.OperatorResultPage]'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaContext.php 0000644 00000004426 15021223077 0020424 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2\Transcript; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class MediaContext extends InstanceContext { /** * Initialize the MediaContext * * @param Version $version Version that contains the resource * @param string $sid The unique SID identifier of the Transcript. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Transcripts/' . \rawurlencode($sid) .'/Media'; } /** * Fetch the MediaInstance * * @param array|Options $options Optional Arguments * @return MediaInstance Fetched MediaInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): MediaInstance { $options = new Values($options); $params = Values::of([ 'Redacted' => Serialize::booleanToString($options['redacted']), ]); $payload = $this->version->fetch('GET', $this->uri, $params, []); return new MediaInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.MediaContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentencePage.php 0000644 00000003140 15021223077 0020371 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2\Transcript; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SentencePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SentenceInstance \Twilio\Rest\Intelligence\V2\Transcript\SentenceInstance */ public function buildInstance(array $payload): SentenceInstance { return new SentenceInstance($this->version, $payload, $this->solution['transcriptSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.SentencePage]'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultContext.php 0000644 00000005311 15021223077 0022371 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2\Transcript; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class OperatorResultContext extends InstanceContext { /** * Initialize the OperatorResultContext * * @param Version $version Version that contains the resource * @param string $transcriptSid A 34 character string that uniquely identifies this Transcript. * @param string $operatorSid A 34 character string that identifies this Language Understanding operator sid. */ public function __construct( Version $version, $transcriptSid, $operatorSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'transcriptSid' => $transcriptSid, 'operatorSid' => $operatorSid, ]; $this->uri = '/Transcripts/' . \rawurlencode($transcriptSid) .'/OperatorResults/' . \rawurlencode($operatorSid) .''; } /** * Fetch the OperatorResultInstance * * @param array|Options $options Optional Arguments * @return OperatorResultInstance Fetched OperatorResultInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): OperatorResultInstance { $options = new Values($options); $params = Values::of([ 'Redacted' => Serialize::booleanToString($options['redacted']), ]); $payload = $this->version->fetch('GET', $this->uri, $params, []); return new OperatorResultInstance( $this->version, $payload, $this->solution['transcriptSid'], $this->solution['operatorSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.OperatorResultContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaPage.php 0000644 00000003104 15021223077 0017644 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2\Transcript; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MediaPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MediaInstance \Twilio\Rest\Intelligence\V2\Transcript\MediaInstance */ public function buildInstance(array $payload): MediaInstance { return new MediaInstance($this->version, $payload, $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.MediaPage]'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentenceList.php 0000644 00000012613 15021223077 0020435 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2\Transcript; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class SentenceList extends ListResource { /** * Construct the SentenceList * * @param Version $version Version that contains the resource * @param string $transcriptSid The unique SID identifier of the Transcript. */ public function __construct( Version $version, string $transcriptSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'transcriptSid' => $transcriptSid, ]; $this->uri = '/Transcripts/' . \rawurlencode($transcriptSid) .'/Sentences'; } /** * Reads SentenceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SentenceInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SentenceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SentenceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SentencePage Page of SentenceInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SentencePage { $options = new Values($options); $params = Values::of([ 'Redacted' => Serialize::booleanToString($options['redacted']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SentencePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SentenceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SentencePage Page of SentenceInstance */ public function getPage(string $targetUrl): SentencePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SentencePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.SentenceList]'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentenceOptions.php 0000644 00000004304 15021223077 0021153 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2\Transcript; use Twilio\Options; use Twilio\Values; abstract class SentenceOptions { /** * @param bool $redacted Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. * @return ReadSentenceOptions Options builder */ public static function read( bool $redacted = Values::BOOL_NONE ): ReadSentenceOptions { return new ReadSentenceOptions( $redacted ); } } class ReadSentenceOptions extends Options { /** * @param bool $redacted Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. */ public function __construct( bool $redacted = Values::BOOL_NONE ) { $this->options['redacted'] = $redacted; } /** * Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. * * @param bool $redacted Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. * @return $this Fluent Builder */ public function setRedacted(bool $redacted): self { $this->options['redacted'] = $redacted; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.ReadSentenceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/OperatorResultInstance.php 0000644 00000012244 15021223077 0022514 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2\Transcript; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $operatorType * @property string|null $name * @property string|null $operatorSid * @property bool|null $extractMatch * @property string|null $matchProbability * @property string|null $normalizedResult * @property array[]|null $utteranceResults * @property bool|null $utteranceMatch * @property string|null $predictedLabel * @property string|null $predictedProbability * @property array|null $labelProbabilities * @property array|null $extractResults * @property array|null $textGenerationResults * @property string|null $transcriptSid * @property string|null $url */ class OperatorResultInstance extends InstanceResource { /** * Initialize the OperatorResultInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $transcriptSid A 34 character string that uniquely identifies this Transcript. * @param string $operatorSid A 34 character string that identifies this Language Understanding operator sid. */ public function __construct(Version $version, array $payload, string $transcriptSid, string $operatorSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'operatorType' => Values::array_get($payload, 'operator_type'), 'name' => Values::array_get($payload, 'name'), 'operatorSid' => Values::array_get($payload, 'operator_sid'), 'extractMatch' => Values::array_get($payload, 'extract_match'), 'matchProbability' => Values::array_get($payload, 'match_probability'), 'normalizedResult' => Values::array_get($payload, 'normalized_result'), 'utteranceResults' => Values::array_get($payload, 'utterance_results'), 'utteranceMatch' => Values::array_get($payload, 'utterance_match'), 'predictedLabel' => Values::array_get($payload, 'predicted_label'), 'predictedProbability' => Values::array_get($payload, 'predicted_probability'), 'labelProbabilities' => Values::array_get($payload, 'label_probabilities'), 'extractResults' => Values::array_get($payload, 'extract_results'), 'textGenerationResults' => Values::array_get($payload, 'text_generation_results'), 'transcriptSid' => Values::array_get($payload, 'transcript_sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['transcriptSid' => $transcriptSid, 'operatorSid' => $operatorSid ?: $this->properties['operatorSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return OperatorResultContext Context for this OperatorResultInstance */ protected function proxy(): OperatorResultContext { if (!$this->context) { $this->context = new OperatorResultContext( $this->version, $this->solution['transcriptSid'], $this->solution['operatorSid'] ); } return $this->context; } /** * Fetch the OperatorResultInstance * * @param array|Options $options Optional Arguments * @return OperatorResultInstance Fetched OperatorResultInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): OperatorResultInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.OperatorResultInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/SentenceInstance.php 0000644 00000005413 15021223077 0021266 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2\Transcript; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property int|null $mediaChannel * @property int|null $sentenceIndex * @property string|null $startTime * @property string|null $endTime * @property string|null $transcript * @property string|null $sid * @property string|null $confidence */ class SentenceInstance extends InstanceResource { /** * Initialize the SentenceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $transcriptSid The unique SID identifier of the Transcript. */ public function __construct(Version $version, array $payload, string $transcriptSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'mediaChannel' => Values::array_get($payload, 'media_channel'), 'sentenceIndex' => Values::array_get($payload, 'sentence_index'), 'startTime' => Values::array_get($payload, 'start_time'), 'endTime' => Values::array_get($payload, 'end_time'), 'transcript' => Values::array_get($payload, 'transcript'), 'sid' => Values::array_get($payload, 'sid'), 'confidence' => Values::array_get($payload, 'confidence'), ]; $this->solution = ['transcriptSid' => $transcriptSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.SentenceInstance]'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaOptions.php 0000644 00000004230 15021223077 0020424 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2\Transcript; use Twilio\Options; use Twilio\Values; abstract class MediaOptions { /** * @param bool $redacted Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. * @return FetchMediaOptions Options builder */ public static function fetch( bool $redacted = Values::BOOL_NONE ): FetchMediaOptions { return new FetchMediaOptions( $redacted ); } } class FetchMediaOptions extends Options { /** * @param bool $redacted Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. */ public function __construct( bool $redacted = Values::BOOL_NONE ) { $this->options['redacted'] = $redacted; } /** * Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. * * @param bool $redacted Grant access to PII Redacted/Unredacted Media. If redaction is enabled, the default is `true` to access redacted media. * @return $this Fluent Builder */ public function setRedacted(bool $redacted): self { $this->options['redacted'] = $redacted; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.FetchMediaOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/Transcript/MediaInstance.php 0000644 00000006761 15021223077 0020550 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2\Transcript; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $mediaUrl * @property string|null $serviceSid * @property string|null $sid * @property string|null $url */ class MediaInstance extends InstanceResource { /** * Initialize the MediaInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique SID identifier of the Transcript. */ public function __construct(Version $version, array $payload, string $sid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'mediaUrl' => Values::array_get($payload, 'media_url'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MediaContext Context for this MediaInstance */ protected function proxy(): MediaContext { if (!$this->context) { $this->context = new MediaContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the MediaInstance * * @param array|Options $options Optional Arguments * @return MediaInstance Fetched MediaInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): MediaInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.MediaInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/ServiceOptions.php 0000644 00000044316 15021223077 0016665 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param bool $autoTranscribe Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. * @param bool $dataLogging Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @param string $languageCode The default language code of the audio. * @param bool $autoRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. * @param bool $mediaRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. * @param string $webhookUrl The URL Twilio will request when executing the Webhook. * @param string $webhookHttpMethod * @return CreateServiceOptions Options builder */ public static function create( bool $autoTranscribe = Values::BOOL_NONE, bool $dataLogging = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $languageCode = Values::NONE, bool $autoRedaction = Values::BOOL_NONE, bool $mediaRedaction = Values::BOOL_NONE, string $webhookUrl = Values::NONE, string $webhookHttpMethod = Values::NONE ): CreateServiceOptions { return new CreateServiceOptions( $autoTranscribe, $dataLogging, $friendlyName, $languageCode, $autoRedaction, $mediaRedaction, $webhookUrl, $webhookHttpMethod ); } /** * @param bool $autoTranscribe Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. * @param bool $dataLogging Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @param string $languageCode The default language code of the audio. * @param string $uniqueName Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. * @param bool $autoRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. * @param bool $mediaRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. * @param string $webhookUrl The URL Twilio will request when executing the Webhook. * @param string $webhookHttpMethod * @param string $ifMatch The If-Match HTTP request header * @return UpdateServiceOptions Options builder */ public static function update( bool $autoTranscribe = Values::BOOL_NONE, bool $dataLogging = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $languageCode = Values::NONE, string $uniqueName = Values::NONE, bool $autoRedaction = Values::BOOL_NONE, bool $mediaRedaction = Values::BOOL_NONE, string $webhookUrl = Values::NONE, string $webhookHttpMethod = Values::NONE, string $ifMatch = Values::NONE ): UpdateServiceOptions { return new UpdateServiceOptions( $autoTranscribe, $dataLogging, $friendlyName, $languageCode, $uniqueName, $autoRedaction, $mediaRedaction, $webhookUrl, $webhookHttpMethod, $ifMatch ); } } class CreateServiceOptions extends Options { /** * @param bool $autoTranscribe Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. * @param bool $dataLogging Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @param string $languageCode The default language code of the audio. * @param bool $autoRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. * @param bool $mediaRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. * @param string $webhookUrl The URL Twilio will request when executing the Webhook. * @param string $webhookHttpMethod */ public function __construct( bool $autoTranscribe = Values::BOOL_NONE, bool $dataLogging = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $languageCode = Values::NONE, bool $autoRedaction = Values::BOOL_NONE, bool $mediaRedaction = Values::BOOL_NONE, string $webhookUrl = Values::NONE, string $webhookHttpMethod = Values::NONE ) { $this->options['autoTranscribe'] = $autoTranscribe; $this->options['dataLogging'] = $dataLogging; $this->options['friendlyName'] = $friendlyName; $this->options['languageCode'] = $languageCode; $this->options['autoRedaction'] = $autoRedaction; $this->options['mediaRedaction'] = $mediaRedaction; $this->options['webhookUrl'] = $webhookUrl; $this->options['webhookHttpMethod'] = $webhookHttpMethod; } /** * Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. * * @param bool $autoTranscribe Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. * @return $this Fluent Builder */ public function setAutoTranscribe(bool $autoTranscribe): self { $this->options['autoTranscribe'] = $autoTranscribe; return $this; } /** * Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. * * @param bool $dataLogging Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. * @return $this Fluent Builder */ public function setDataLogging(bool $dataLogging): self { $this->options['dataLogging'] = $dataLogging; return $this; } /** * A human readable description of this resource, up to 64 characters. * * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The default language code of the audio. * * @param string $languageCode The default language code of the audio. * @return $this Fluent Builder */ public function setLanguageCode(string $languageCode): self { $this->options['languageCode'] = $languageCode; return $this; } /** * Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. * * @param bool $autoRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. * @return $this Fluent Builder */ public function setAutoRedaction(bool $autoRedaction): self { $this->options['autoRedaction'] = $autoRedaction; return $this; } /** * Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. * * @param bool $mediaRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. * @return $this Fluent Builder */ public function setMediaRedaction(bool $mediaRedaction): self { $this->options['mediaRedaction'] = $mediaRedaction; return $this; } /** * The URL Twilio will request when executing the Webhook. * * @param string $webhookUrl The URL Twilio will request when executing the Webhook. * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * @param string $webhookHttpMethod * @return $this Fluent Builder */ public function setWebhookHttpMethod(string $webhookHttpMethod): self { $this->options['webhookHttpMethod'] = $webhookHttpMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.CreateServiceOptions ' . $options . ']'; } } class UpdateServiceOptions extends Options { /** * @param bool $autoTranscribe Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. * @param bool $dataLogging Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @param string $languageCode The default language code of the audio. * @param string $uniqueName Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. * @param bool $autoRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. * @param bool $mediaRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. * @param string $webhookUrl The URL Twilio will request when executing the Webhook. * @param string $webhookHttpMethod * @param string $ifMatch The If-Match HTTP request header */ public function __construct( bool $autoTranscribe = Values::BOOL_NONE, bool $dataLogging = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $languageCode = Values::NONE, string $uniqueName = Values::NONE, bool $autoRedaction = Values::BOOL_NONE, bool $mediaRedaction = Values::BOOL_NONE, string $webhookUrl = Values::NONE, string $webhookHttpMethod = Values::NONE, string $ifMatch = Values::NONE ) { $this->options['autoTranscribe'] = $autoTranscribe; $this->options['dataLogging'] = $dataLogging; $this->options['friendlyName'] = $friendlyName; $this->options['languageCode'] = $languageCode; $this->options['uniqueName'] = $uniqueName; $this->options['autoRedaction'] = $autoRedaction; $this->options['mediaRedaction'] = $mediaRedaction; $this->options['webhookUrl'] = $webhookUrl; $this->options['webhookHttpMethod'] = $webhookHttpMethod; $this->options['ifMatch'] = $ifMatch; } /** * Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. * * @param bool $autoTranscribe Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. * @return $this Fluent Builder */ public function setAutoTranscribe(bool $autoTranscribe): self { $this->options['autoTranscribe'] = $autoTranscribe; return $this; } /** * Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. * * @param bool $dataLogging Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. * @return $this Fluent Builder */ public function setDataLogging(bool $dataLogging): self { $this->options['dataLogging'] = $dataLogging; return $this; } /** * A human readable description of this resource, up to 64 characters. * * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The default language code of the audio. * * @param string $languageCode The default language code of the audio. * @return $this Fluent Builder */ public function setLanguageCode(string $languageCode): self { $this->options['languageCode'] = $languageCode; return $this; } /** * Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. * * @param bool $autoRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. * @return $this Fluent Builder */ public function setAutoRedaction(bool $autoRedaction): self { $this->options['autoRedaction'] = $autoRedaction; return $this; } /** * Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. * * @param bool $mediaRedaction Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. * @return $this Fluent Builder */ public function setMediaRedaction(bool $mediaRedaction): self { $this->options['mediaRedaction'] = $mediaRedaction; return $this; } /** * The URL Twilio will request when executing the Webhook. * * @param string $webhookUrl The URL Twilio will request when executing the Webhook. * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * @param string $webhookHttpMethod * @return $this Fluent Builder */ public function setWebhookHttpMethod(string $webhookHttpMethod): self { $this->options['webhookHttpMethod'] = $webhookHttpMethod; return $this; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/TranscriptList.php 0000644 00000016146 15021223077 0016676 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class TranscriptList extends ListResource { /** * Construct the TranscriptList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Transcripts'; } /** * Create the TranscriptInstance * * @param string $serviceSid The unique SID identifier of the Service. * @param array $channel JSON object describing Media Channel including Source and Participants * @param array|Options $options Optional Arguments * @return TranscriptInstance Created TranscriptInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $serviceSid, array $channel, array $options = []): TranscriptInstance { $options = new Values($options); $data = Values::of([ 'ServiceSid' => $serviceSid, 'Channel' => Serialize::jsonObject($channel), 'CustomerKey' => $options['customerKey'], 'MediaStartTime' => Serialize::iso8601DateTime($options['mediaStartTime']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TranscriptInstance( $this->version, $payload ); } /** * Reads TranscriptInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TranscriptInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TranscriptInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TranscriptInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TranscriptPage Page of TranscriptInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TranscriptPage { $options = new Values($options); $params = Values::of([ 'ServiceSid' => $options['serviceSid'], 'BeforeStartTime' => $options['beforeStartTime'], 'AfterStartTime' => $options['afterStartTime'], 'BeforeDateCreated' => $options['beforeDateCreated'], 'AfterDateCreated' => $options['afterDateCreated'], 'Status' => $options['status'], 'LanguageCode' => $options['languageCode'], 'SourceSid' => $options['sourceSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TranscriptPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TranscriptInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TranscriptPage Page of TranscriptInstance */ public function getPage(string $targetUrl): TranscriptPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TranscriptPage($this->version, $response, $this->solution); } /** * Constructs a TranscriptContext * * @param string $sid A 34 character string that uniquely identifies this Transcript. */ public function getContext( string $sid ): TranscriptContext { return new TranscriptContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.TranscriptList]'; } } sdk/src/Twilio/Rest/Intelligence/V2/TranscriptInstance.php 0000644 00000013126 15021223077 0017522 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Intelligence\V2\Transcript\OperatorResultList; use Twilio\Rest\Intelligence\V2\Transcript\SentenceList; use Twilio\Rest\Intelligence\V2\Transcript\MediaList; /** * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $sid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string $status * @property array|null $channel * @property bool|null $dataLogging * @property string|null $languageCode * @property string|null $customerKey * @property \DateTime|null $mediaStartTime * @property int|null $duration * @property string|null $url * @property bool|null $redaction * @property array|null $links */ class TranscriptInstance extends InstanceResource { protected $_operatorResults; protected $_sentences; protected $_media; /** * Initialize the TranscriptInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies this Transcript. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'status' => Values::array_get($payload, 'status'), 'channel' => Values::array_get($payload, 'channel'), 'dataLogging' => Values::array_get($payload, 'data_logging'), 'languageCode' => Values::array_get($payload, 'language_code'), 'customerKey' => Values::array_get($payload, 'customer_key'), 'mediaStartTime' => Deserialize::dateTime(Values::array_get($payload, 'media_start_time')), 'duration' => Values::array_get($payload, 'duration'), 'url' => Values::array_get($payload, 'url'), 'redaction' => Values::array_get($payload, 'redaction'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TranscriptContext Context for this TranscriptInstance */ protected function proxy(): TranscriptContext { if (!$this->context) { $this->context = new TranscriptContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the TranscriptInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TranscriptInstance * * @return TranscriptInstance Fetched TranscriptInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TranscriptInstance { return $this->proxy()->fetch(); } /** * Access the operatorResults */ protected function getOperatorResults(): OperatorResultList { return $this->proxy()->operatorResults; } /** * Access the sentences */ protected function getSentences(): SentenceList { return $this->proxy()->sentences; } /** * Access the media */ protected function getMedia(): MediaList { return $this->proxy()->media; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.TranscriptInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/TranscriptPage.php 0000644 00000003064 15021223077 0016632 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TranscriptPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TranscriptInstance \Twilio\Rest\Intelligence\V2\TranscriptInstance */ public function buildInstance(array $payload): TranscriptInstance { return new TranscriptInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.TranscriptPage]'; } } sdk/src/Twilio/Rest/Intelligence/V2/ServiceContext.php 0000644 00000007345 15021223077 0016657 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class ServiceContext extends InstanceContext { /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies this Service. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) .''; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'AutoTranscribe' => Serialize::booleanToString($options['autoTranscribe']), 'DataLogging' => Serialize::booleanToString($options['dataLogging']), 'FriendlyName' => $options['friendlyName'], 'LanguageCode' => $options['languageCode'], 'UniqueName' => $options['uniqueName'], 'AutoRedaction' => Serialize::booleanToString($options['autoRedaction']), 'MediaRedaction' => Serialize::booleanToString($options['mediaRedaction']), 'WebhookUrl' => $options['webhookUrl'], 'WebhookHttpMethod' => $options['webhookHttpMethod'], ]); $headers = Values::of(['If-Match' => $options['ifMatch']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Intelligence.V2.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2/ServicePage.php 0000644 00000003042 15021223077 0016075 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ServiceInstance \Twilio\Rest\Intelligence\V2\ServiceInstance */ public function buildInstance(array $payload): ServiceInstance { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2.ServicePage]'; } } sdk/src/Twilio/Rest/Intelligence/V2/TranscriptOptions.php 0000644 00000020507 15021223077 0017412 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence\V2; use Twilio\Options; use Twilio\Values; abstract class TranscriptOptions { /** * @param string $customerKey Used to store client provided metadata. Maximum of 64 double-byte UTF8 characters. * @param \DateTime $mediaStartTime The date that this Transcript's media was started, given in ISO 8601 format. * @return CreateTranscriptOptions Options builder */ public static function create( string $customerKey = Values::NONE, \DateTime $mediaStartTime = null ): CreateTranscriptOptions { return new CreateTranscriptOptions( $customerKey, $mediaStartTime ); } /** * @param string $serviceSid The unique SID identifier of the Service. * @param string $beforeStartTime Filter by before StartTime. * @param string $afterStartTime Filter by after StartTime. * @param string $beforeDateCreated Filter by before DateCreated. * @param string $afterDateCreated Filter by after DateCreated. * @param string $status Filter by status. * @param string $languageCode Filter by Language Code. * @param string $sourceSid Filter by SourceSid. * @return ReadTranscriptOptions Options builder */ public static function read( string $serviceSid = Values::NONE, string $beforeStartTime = Values::NONE, string $afterStartTime = Values::NONE, string $beforeDateCreated = Values::NONE, string $afterDateCreated = Values::NONE, string $status = Values::NONE, string $languageCode = Values::NONE, string $sourceSid = Values::NONE ): ReadTranscriptOptions { return new ReadTranscriptOptions( $serviceSid, $beforeStartTime, $afterStartTime, $beforeDateCreated, $afterDateCreated, $status, $languageCode, $sourceSid ); } } class CreateTranscriptOptions extends Options { /** * @param string $customerKey Used to store client provided metadata. Maximum of 64 double-byte UTF8 characters. * @param \DateTime $mediaStartTime The date that this Transcript's media was started, given in ISO 8601 format. */ public function __construct( string $customerKey = Values::NONE, \DateTime $mediaStartTime = null ) { $this->options['customerKey'] = $customerKey; $this->options['mediaStartTime'] = $mediaStartTime; } /** * Used to store client provided metadata. Maximum of 64 double-byte UTF8 characters. * * @param string $customerKey Used to store client provided metadata. Maximum of 64 double-byte UTF8 characters. * @return $this Fluent Builder */ public function setCustomerKey(string $customerKey): self { $this->options['customerKey'] = $customerKey; return $this; } /** * The date that this Transcript's media was started, given in ISO 8601 format. * * @param \DateTime $mediaStartTime The date that this Transcript's media was started, given in ISO 8601 format. * @return $this Fluent Builder */ public function setMediaStartTime(\DateTime $mediaStartTime): self { $this->options['mediaStartTime'] = $mediaStartTime; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.CreateTranscriptOptions ' . $options . ']'; } } class ReadTranscriptOptions extends Options { /** * @param string $serviceSid The unique SID identifier of the Service. * @param string $beforeStartTime Filter by before StartTime. * @param string $afterStartTime Filter by after StartTime. * @param string $beforeDateCreated Filter by before DateCreated. * @param string $afterDateCreated Filter by after DateCreated. * @param string $status Filter by status. * @param string $languageCode Filter by Language Code. * @param string $sourceSid Filter by SourceSid. */ public function __construct( string $serviceSid = Values::NONE, string $beforeStartTime = Values::NONE, string $afterStartTime = Values::NONE, string $beforeDateCreated = Values::NONE, string $afterDateCreated = Values::NONE, string $status = Values::NONE, string $languageCode = Values::NONE, string $sourceSid = Values::NONE ) { $this->options['serviceSid'] = $serviceSid; $this->options['beforeStartTime'] = $beforeStartTime; $this->options['afterStartTime'] = $afterStartTime; $this->options['beforeDateCreated'] = $beforeDateCreated; $this->options['afterDateCreated'] = $afterDateCreated; $this->options['status'] = $status; $this->options['languageCode'] = $languageCode; $this->options['sourceSid'] = $sourceSid; } /** * The unique SID identifier of the Service. * * @param string $serviceSid The unique SID identifier of the Service. * @return $this Fluent Builder */ public function setServiceSid(string $serviceSid): self { $this->options['serviceSid'] = $serviceSid; return $this; } /** * Filter by before StartTime. * * @param string $beforeStartTime Filter by before StartTime. * @return $this Fluent Builder */ public function setBeforeStartTime(string $beforeStartTime): self { $this->options['beforeStartTime'] = $beforeStartTime; return $this; } /** * Filter by after StartTime. * * @param string $afterStartTime Filter by after StartTime. * @return $this Fluent Builder */ public function setAfterStartTime(string $afterStartTime): self { $this->options['afterStartTime'] = $afterStartTime; return $this; } /** * Filter by before DateCreated. * * @param string $beforeDateCreated Filter by before DateCreated. * @return $this Fluent Builder */ public function setBeforeDateCreated(string $beforeDateCreated): self { $this->options['beforeDateCreated'] = $beforeDateCreated; return $this; } /** * Filter by after DateCreated. * * @param string $afterDateCreated Filter by after DateCreated. * @return $this Fluent Builder */ public function setAfterDateCreated(string $afterDateCreated): self { $this->options['afterDateCreated'] = $afterDateCreated; return $this; } /** * Filter by status. * * @param string $status Filter by status. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Filter by Language Code. * * @param string $languageCode Filter by Language Code. * @return $this Fluent Builder */ public function setLanguageCode(string $languageCode): self { $this->options['languageCode'] = $languageCode; return $this; } /** * Filter by SourceSid. * * @param string $sourceSid Filter by SourceSid. * @return $this Fluent Builder */ public function setSourceSid(string $sourceSid): self { $this->options['sourceSid'] = $sourceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Intelligence.V2.ReadTranscriptOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Intelligence/V2.php 0000644 00000005766 15021223077 0013717 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Intelligence * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Intelligence; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Intelligence\V2\ServiceList; use Twilio\Rest\Intelligence\V2\TranscriptList; use Twilio\Version; /** * @property ServiceList $services * @property TranscriptList $transcripts * @method \Twilio\Rest\Intelligence\V2\ServiceContext services(string $sid) * @method \Twilio\Rest\Intelligence\V2\TranscriptContext transcripts(string $sid) */ class V2 extends Version { protected $_services; protected $_transcripts; /** * Construct the V2 version of Intelligence * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v2'; } protected function getServices(): ServiceList { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } protected function getTranscripts(): TranscriptList { if (!$this->_transcripts) { $this->_transcripts = new TranscriptList($this); } return $this->_transcripts; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Intelligence.V2]'; } } sdk/src/Twilio/Rest/VerifyBase.php 0000644 00000004522 15021223077 0013052 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Verify\V2; /** * @property \Twilio\Rest\Verify\V2 $v2 */ class VerifyBase extends Domain { protected $_v2; /** * Construct the Verify Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://verify.twilio.com'; } /** * @return V2 Version v2 of verify */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify]'; } } sdk/src/Twilio/Rest/Accounts/V1/SafelistInstance.php 0000644 00000004120 15021223077 0016311 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string|null $phoneNumber */ class SafelistInstance extends InstanceResource { /** * Initialize the SafelistInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.SafelistInstance]'; } } sdk/src/Twilio/Rest/Accounts/V1/SafelistList.php 0000644 00000006077 15021223077 0015475 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class SafelistList extends ListResource { /** * Construct the SafelistList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/SafeList/Numbers'; } /** * Create the SafelistInstance * * @param string $phoneNumber The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @return SafelistInstance Created SafelistInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumber): SafelistInstance { $data = Values::of([ 'PhoneNumber' => $phoneNumber, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SafelistInstance( $this->version, $payload ); } /** * Delete the SafelistInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $params = Values::of([ 'PhoneNumber' => $options['phoneNumber'], ]); return $this->version->delete('DELETE', $this->uri, $params); } /** * Fetch the SafelistInstance * * @param array|Options $options Optional Arguments * @return SafelistInstance Fetched SafelistInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): SafelistInstance { $options = new Values($options); $params = Values::of([ 'PhoneNumber' => $options['phoneNumber'], ]); $payload = $this->version->fetch('GET', $this->uri, $params, []); return new SafelistInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.SafelistList]'; } } sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenPage.php 0000644 00000003124 15021223077 0017424 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SecondaryAuthTokenPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SecondaryAuthTokenInstance \Twilio\Rest\Accounts\V1\SecondaryAuthTokenInstance */ public function buildInstance(array $payload): SecondaryAuthTokenInstance { return new SecondaryAuthTokenInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.SecondaryAuthTokenPage]'; } } sdk/src/Twilio/Rest/Accounts/V1/SafelistOptions.php 0000644 00000007613 15021223077 0016212 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1; use Twilio\Options; use Twilio\Values; abstract class SafelistOptions { /** * @param string $phoneNumber The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @return DeleteSafelistOptions Options builder */ public static function delete( string $phoneNumber = Values::NONE ): DeleteSafelistOptions { return new DeleteSafelistOptions( $phoneNumber ); } /** * @param string $phoneNumber The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @return FetchSafelistOptions Options builder */ public static function fetch( string $phoneNumber = Values::NONE ): FetchSafelistOptions { return new FetchSafelistOptions( $phoneNumber ); } } class DeleteSafelistOptions extends Options { /** * @param string $phoneNumber The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). */ public function __construct( string $phoneNumber = Values::NONE ) { $this->options['phoneNumber'] = $phoneNumber; } /** * The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * * @param string $phoneNumber The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Accounts.V1.DeleteSafelistOptions ' . $options . ']'; } } class FetchSafelistOptions extends Options { /** * @param string $phoneNumber The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). */ public function __construct( string $phoneNumber = Values::NONE ) { $this->options['phoneNumber'] = $phoneNumber; } /** * The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * * @param string $phoneNumber The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Accounts.V1.FetchSafelistOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenList.php 0000644 00000002615 15021223077 0017467 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1; use Twilio\ListResource; use Twilio\Version; class SecondaryAuthTokenList extends ListResource { /** * Construct the SecondaryAuthTokenList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a SecondaryAuthTokenContext */ public function getContext( ): SecondaryAuthTokenContext { return new SecondaryAuthTokenContext( $this->version ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.SecondaryAuthTokenList]'; } } sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenInstance.php 0000644 00000007426 15021223077 0020325 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $secondaryAuthToken * @property string|null $url */ class SecondaryAuthTokenInstance extends InstanceResource { /** * Initialize the SecondaryAuthTokenInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'secondaryAuthToken' => Values::array_get($payload, 'secondary_auth_token'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = []; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SecondaryAuthTokenContext Context for this SecondaryAuthTokenInstance */ protected function proxy(): SecondaryAuthTokenContext { if (!$this->context) { $this->context = new SecondaryAuthTokenContext( $this->version ); } return $this->context; } /** * Create the SecondaryAuthTokenInstance * * @return SecondaryAuthTokenInstance Created SecondaryAuthTokenInstance * @throws TwilioException When an HTTP error occurs. */ public function create(): SecondaryAuthTokenInstance { return $this->proxy()->create(); } /** * Delete the SecondaryAuthTokenInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Accounts.V1.SecondaryAuthTokenInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionPage.php 0000644 00000003124 15021223077 0017463 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthTokenPromotionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AuthTokenPromotionInstance \Twilio\Rest\Accounts\V1\AuthTokenPromotionInstance */ public function buildInstance(array $payload): AuthTokenPromotionInstance { return new AuthTokenPromotionInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.AuthTokenPromotionPage]'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyInstance.php 0000644 00000010513 15021223077 0020503 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class PublicKeyInstance extends InstanceResource { /** * Initialize the PublicKeyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The Twilio-provided string that uniquely identifies the PublicKey resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PublicKeyContext Context for this PublicKeyInstance */ protected function proxy(): PublicKeyContext { if (!$this->context) { $this->context = new PublicKeyContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the PublicKeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the PublicKeyInstance * * @return PublicKeyInstance Fetched PublicKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PublicKeyInstance { return $this->proxy()->fetch(); } /** * Update the PublicKeyInstance * * @param array|Options $options Optional Arguments * @return PublicKeyInstance Updated PublicKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): PublicKeyInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Accounts.V1.PublicKeyInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsContext.php 0000644 00000005647 15021223077 0017242 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class AwsContext extends InstanceContext { /** * Initialize the AwsContext * * @param Version $version Version that contains the resource * @param string $sid The Twilio-provided string that uniquely identifies the AWS resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Credentials/AWS/' . \rawurlencode($sid) .''; } /** * Delete the AwsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the AwsInstance * * @return AwsInstance Fetched AwsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AwsInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AwsInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the AwsInstance * * @param array|Options $options Optional Arguments * @return AwsInstance Updated AwsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AwsInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AwsInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Accounts.V1.AwsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyPage.php 0000644 00000003064 15021223077 0017616 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PublicKeyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return PublicKeyInstance \Twilio\Rest\Accounts\V1\Credential\PublicKeyInstance */ public function buildInstance(array $payload): PublicKeyInstance { return new PublicKeyInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.PublicKeyPage]'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsPage.php 0000644 00000003020 15021223077 0016451 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AwsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AwsInstance \Twilio\Rest\Accounts\V1\Credential\AwsInstance */ public function buildInstance(array $payload): AwsInstance { return new AwsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.AwsPage]'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsInstance.php 0000644 00000010345 15021223077 0017351 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class AwsInstance extends InstanceResource { /** * Initialize the AwsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The Twilio-provided string that uniquely identifies the AWS resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AwsContext Context for this AwsInstance */ protected function proxy(): AwsContext { if (!$this->context) { $this->context = new AwsContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the AwsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AwsInstance * * @return AwsInstance Fetched AwsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AwsInstance { return $this->proxy()->fetch(); } /** * Update the AwsInstance * * @param array|Options $options Optional Arguments * @return AwsInstance Updated AwsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AwsInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Accounts.V1.AwsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsList.php 0000644 00000014067 15021223077 0016525 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AwsList extends ListResource { /** * Construct the AwsList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Credentials/AWS'; } /** * Create the AwsInstance * * @param string $credentials A string that contains the AWS access credentials in the format `<AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_KEY>`. For example, `AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY` * @param array|Options $options Optional Arguments * @return AwsInstance Created AwsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $credentials, array $options = []): AwsInstance { $options = new Values($options); $data = Values::of([ 'Credentials' => $credentials, 'FriendlyName' => $options['friendlyName'], 'AccountSid' => $options['accountSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AwsInstance( $this->version, $payload ); } /** * Reads AwsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AwsInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AwsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AwsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AwsPage Page of AwsInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AwsPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AwsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AwsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AwsPage Page of AwsInstance */ public function getPage(string $targetUrl): AwsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AwsPage($this->version, $response, $this->solution); } /** * Constructs a AwsContext * * @param string $sid The Twilio-provided string that uniquely identifies the AWS resource to delete. */ public function getContext( string $sid ): AwsContext { return new AwsContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.AwsList]'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsOptions.php 0000644 00000011140 15021223077 0017232 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Options; use Twilio\Values; abstract class AwsOptions { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $accountSid The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request. * @return CreateAwsOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $accountSid = Values::NONE ): CreateAwsOptions { return new CreateAwsOptions( $friendlyName, $accountSid ); } /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return UpdateAwsOptions Options builder */ public static function update( string $friendlyName = Values::NONE ): UpdateAwsOptions { return new UpdateAwsOptions( $friendlyName ); } } class CreateAwsOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $accountSid The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request. */ public function __construct( string $friendlyName = Values::NONE, string $accountSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['accountSid'] = $accountSid; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request. * * @param string $accountSid The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request. * @return $this Fluent Builder */ public function setAccountSid(string $accountSid): self { $this->options['accountSid'] = $accountSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Accounts.V1.CreateAwsOptions ' . $options . ']'; } } class UpdateAwsOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Accounts.V1.UpdateAwsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php 0000644 00000006010 15021223077 0020360 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class PublicKeyContext extends InstanceContext { /** * Initialize the PublicKeyContext * * @param Version $version Version that contains the resource * @param string $sid The Twilio-provided string that uniquely identifies the PublicKey resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Credentials/PublicKeys/' . \rawurlencode($sid) .''; } /** * Delete the PublicKeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the PublicKeyInstance * * @return PublicKeyInstance Fetched PublicKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PublicKeyInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new PublicKeyInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the PublicKeyInstance * * @param array|Options $options Optional Arguments * @return PublicKeyInstance Updated PublicKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): PublicKeyInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new PublicKeyInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Accounts.V1.PublicKeyContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyList.php 0000644 00000014227 15021223077 0017660 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class PublicKeyList extends ListResource { /** * Construct the PublicKeyList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Credentials/PublicKeys'; } /** * Create the PublicKeyInstance * * @param string $publicKey A URL encoded representation of the public key. For example, `-----BEGIN PUBLIC KEY-----MIIBIjANB.pa9xQIDAQAB-----END PUBLIC KEY-----` * @param array|Options $options Optional Arguments * @return PublicKeyInstance Created PublicKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $publicKey, array $options = []): PublicKeyInstance { $options = new Values($options); $data = Values::of([ 'PublicKey' => $publicKey, 'FriendlyName' => $options['friendlyName'], 'AccountSid' => $options['accountSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new PublicKeyInstance( $this->version, $payload ); } /** * Reads PublicKeyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PublicKeyInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams PublicKeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of PublicKeyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return PublicKeyPage Page of PublicKeyInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): PublicKeyPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new PublicKeyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PublicKeyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return PublicKeyPage Page of PublicKeyInstance */ public function getPage(string $targetUrl): PublicKeyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PublicKeyPage($this->version, $response, $this->solution); } /** * Constructs a PublicKeyContext * * @param string $sid The Twilio-provided string that uniquely identifies the PublicKey resource to delete. */ public function getContext( string $sid ): PublicKeyContext { return new PublicKeyContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.PublicKeyList]'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyOptions.php 0000644 00000011236 15021223077 0020375 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Options; use Twilio\Values; abstract class PublicKeyOptions { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $accountSid The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request * @return CreatePublicKeyOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $accountSid = Values::NONE ): CreatePublicKeyOptions { return new CreatePublicKeyOptions( $friendlyName, $accountSid ); } /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return UpdatePublicKeyOptions Options builder */ public static function update( string $friendlyName = Values::NONE ): UpdatePublicKeyOptions { return new UpdatePublicKeyOptions( $friendlyName ); } } class CreatePublicKeyOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $accountSid The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request */ public function __construct( string $friendlyName = Values::NONE, string $accountSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['accountSid'] = $accountSid; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request * * @param string $accountSid The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request * @return $this Fluent Builder */ public function setAccountSid(string $accountSid): self { $this->options['accountSid'] = $accountSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Accounts.V1.CreatePublicKeyOptions ' . $options . ']'; } } class UpdatePublicKeyOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Accounts.V1.UpdatePublicKeyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionList.php 0000644 00000002615 15021223077 0017526 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1; use Twilio\ListResource; use Twilio\Version; class AuthTokenPromotionList extends ListResource { /** * Construct the AuthTokenPromotionList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a AuthTokenPromotionContext */ public function getContext( ): AuthTokenPromotionContext { return new AuthTokenPromotionContext( $this->version ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.AuthTokenPromotionList]'; } } sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionInstance.php 0000644 00000006745 15021223077 0020367 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $authToken * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class AuthTokenPromotionInstance extends InstanceResource { /** * Initialize the AuthTokenPromotionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'authToken' => Values::array_get($payload, 'auth_token'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = []; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AuthTokenPromotionContext Context for this AuthTokenPromotionInstance */ protected function proxy(): AuthTokenPromotionContext { if (!$this->context) { $this->context = new AuthTokenPromotionContext( $this->version ); } return $this->context; } /** * Update the AuthTokenPromotionInstance * * @return AuthTokenPromotionInstance Updated AuthTokenPromotionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(): AuthTokenPromotionInstance { return $this->proxy()->update(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Accounts.V1.AuthTokenPromotionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/CredentialInstance.php 0000644 00000003452 15021223077 0016620 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Version; class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.CredentialInstance]'; } } sdk/src/Twilio/Rest/Accounts/V1/SecondaryAuthTokenContext.php 0000644 00000004232 15021223077 0020175 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class SecondaryAuthTokenContext extends InstanceContext { /** * Initialize the SecondaryAuthTokenContext * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/AuthTokens/Secondary'; } /** * Create the SecondaryAuthTokenInstance * * @return SecondaryAuthTokenInstance Created SecondaryAuthTokenInstance * @throws TwilioException When an HTTP error occurs. */ public function create(): SecondaryAuthTokenInstance { $payload = $this->version->create('POST', $this->uri, [], []); return new SecondaryAuthTokenInstance( $this->version, $payload ); } /** * Delete the SecondaryAuthTokenInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Accounts.V1.SecondaryAuthTokenContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/SafelistPage.php 0000644 00000003030 15021223077 0015420 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SafelistPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SafelistInstance \Twilio\Rest\Accounts\V1\SafelistInstance */ public function buildInstance(array $payload): SafelistInstance { return new SafelistInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.SafelistPage]'; } } sdk/src/Twilio/Rest/Accounts/V1/AuthTokenPromotionContext.php 0000644 00000003556 15021223077 0020244 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class AuthTokenPromotionContext extends InstanceContext { /** * Initialize the AuthTokenPromotionContext * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/AuthTokens/Promote'; } /** * Update the AuthTokenPromotionInstance * * @return AuthTokenPromotionInstance Updated AuthTokenPromotionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(): AuthTokenPromotionInstance { $payload = $this->version->update('POST', $this->uri, [], []); return new AuthTokenPromotionInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Accounts.V1.AuthTokenPromotionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/CredentialPage.php 0000644 00000003044 15021223077 0015725 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CredentialInstance \Twilio\Rest\Accounts\V1\CredentialInstance */ public function buildInstance(array $payload): CredentialInstance { return new CredentialInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.CredentialPage]'; } } sdk/src/Twilio/Rest/Accounts/V1/CredentialList.php 0000644 00000006325 15021223077 0015771 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Accounts\V1\Credential\AwsList; use Twilio\Rest\Accounts\V1\Credential\PublicKeyList; /** * @property AwsList $aws * @property PublicKeyList $publicKey * @method \Twilio\Rest\Accounts\V1\Credential\PublicKeyContext publicKey(string $sid) * @method \Twilio\Rest\Accounts\V1\Credential\AwsContext aws(string $sid) */ class CredentialList extends ListResource { protected $_aws = null; protected $_publicKey = null; /** * Construct the CredentialList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Access the aws */ protected function getAws(): AwsList { if (!$this->_aws) { $this->_aws = new AwsList( $this->version ); } return $this->_aws; } /** * Access the publicKey */ protected function getPublicKey(): PublicKeyList { if (!$this->_publicKey) { $this->_publicKey = new PublicKeyList( $this->version ); } return $this->_publicKey; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1.CredentialList]'; } } sdk/src/Twilio/Rest/Accounts/V1.php 0000644 00000007142 15021223077 0013061 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Accounts * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Accounts; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Accounts\V1\AuthTokenPromotionList; use Twilio\Rest\Accounts\V1\CredentialList; use Twilio\Rest\Accounts\V1\SafelistList; use Twilio\Rest\Accounts\V1\SecondaryAuthTokenList; use Twilio\Version; /** * @property AuthTokenPromotionList $authTokenPromotion * @property CredentialList $credentials * @property SafelistList $safelist * @property SecondaryAuthTokenList $secondaryAuthToken */ class V1 extends Version { protected $_authTokenPromotion; protected $_credentials; protected $_safelist; protected $_secondaryAuthToken; /** * Construct the V1 version of Accounts * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getAuthTokenPromotion(): AuthTokenPromotionList { if (!$this->_authTokenPromotion) { $this->_authTokenPromotion = new AuthTokenPromotionList($this); } return $this->_authTokenPromotion; } protected function getCredentials(): CredentialList { if (!$this->_credentials) { $this->_credentials = new CredentialList($this); } return $this->_credentials; } protected function getSafelist(): SafelistList { if (!$this->_safelist) { $this->_safelist = new SafelistList($this); } return $this->_safelist; } protected function getSecondaryAuthToken(): SecondaryAuthTokenList { if (!$this->_secondaryAuthToken) { $this->_secondaryAuthToken = new SecondaryAuthTokenList($this); } return $this->_secondaryAuthToken; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Accounts.V1]'; } } sdk/src/Twilio/Rest/Events.php 0000644 00000004777 15021223077 0012273 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Events\V1; class Events extends EventsBase { /** * @deprecated Use v1->eventTypes instead. */ protected function getEventTypes(): \Twilio\Rest\Events\V1\EventTypeList { echo "eventTypes is deprecated. Use v1->eventTypes instead."; return $this->v1->eventTypes; } /** * @deprecated Use v1->eventTypes(\$type) instead. * @param string $type A string that uniquely identifies this Event Type. */ protected function contextEventTypes(string $type): \Twilio\Rest\Events\V1\EventTypeContext { echo "eventTypes(\$type) is deprecated. Use v1->eventTypes(\$type) instead."; return $this->v1->eventTypes($type); } /** * @deprecated Use v1->schemas instead. */ protected function getSchemas(): \Twilio\Rest\Events\V1\SchemaList { echo "schemas is deprecated. Use v1->schemas instead."; return $this->v1->schemas; } /** * @deprecated Use v1->schemas(\$id) instead. * @param string $id The unique identifier of the schema. */ protected function contextSchemas(string $id): \Twilio\Rest\Events\V1\SchemaContext { echo "schemas(\$id) is deprecated. Use v1->schemas(\$id) instead."; return $this->v1->schemas($id); } /** * @deprecated Use v1->sinks instead. */ protected function getSinks(): \Twilio\Rest\Events\V1\SinkList { echo "sinks is deprecated. Use v1->sinks instead."; return $this->v1->sinks; } /** * @deprecated Use v1->sinks(\$sid) instead * @param string $sid A string that uniquely identifies this Sink. */ protected function contextSinks(string $sid): \Twilio\Rest\Events\V1\SinkContext { echo "sinks(\$sid) is deprecated. Use v1->sinks(\$sid) instead."; return $this->v1->sinks($sid); } /** * @deprecated Use v1->subscriptions instead. */ protected function getSubscriptions(): \Twilio\Rest\Events\V1\SubscriptionList { echo "subscriptions is deprecated. Use v1->subscriptions instead."; return $this->v1->subscriptions; } /** * @deprecated Use v1->subscriptions(\$sid) instead. * @param string $sid A string that uniquely identifies this Subscription. */ protected function contextSubscriptions(string $sid): \Twilio\Rest\Events\V1\SubscriptionContext { echo "subscriptions(\$sid) is deprecated. Use v1->subscriptions(\$sid) instead."; return $this->v1->subscriptions($sid); } } sdk/src/Twilio/Rest/Trunking/V1/TrunkContext.php 0000644 00000017031 15021223077 0015551 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListList; use Twilio\Rest\Trunking\V1\Trunk\PhoneNumberList; use Twilio\Rest\Trunking\V1\Trunk\CredentialListList; use Twilio\Rest\Trunking\V1\Trunk\OriginationUrlList; use Twilio\Rest\Trunking\V1\Trunk\RecordingList; /** * @property IpAccessControlListList $ipAccessControlLists * @property PhoneNumberList $phoneNumbers * @property CredentialListList $credentialsLists * @property OriginationUrlList $originationUrls * @property RecordingList $recordings * @method \Twilio\Rest\Trunking\V1\Trunk\RecordingContext recordings() * @method \Twilio\Rest\Trunking\V1\Trunk\CredentialListContext credentialsLists(string $sid) * @method \Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListContext ipAccessControlLists(string $sid) * @method \Twilio\Rest\Trunking\V1\Trunk\PhoneNumberContext phoneNumbers(string $sid) * @method \Twilio\Rest\Trunking\V1\Trunk\OriginationUrlContext originationUrls(string $sid) */ class TrunkContext extends InstanceContext { protected $_ipAccessControlLists; protected $_phoneNumbers; protected $_credentialsLists; protected $_originationUrls; protected $_recordings; /** * Initialize the TrunkContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that we created to identify the Trunk resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Trunks/' . \rawurlencode($sid) .''; } /** * Delete the TrunkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the TrunkInstance * * @return TrunkInstance Fetched TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrunkInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new TrunkInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the TrunkInstance * * @param array|Options $options Optional Arguments * @return TrunkInstance Updated TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TrunkInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DomainName' => $options['domainName'], 'DisasterRecoveryUrl' => $options['disasterRecoveryUrl'], 'DisasterRecoveryMethod' => $options['disasterRecoveryMethod'], 'TransferMode' => $options['transferMode'], 'Secure' => Serialize::booleanToString($options['secure']), 'CnamLookupEnabled' => Serialize::booleanToString($options['cnamLookupEnabled']), 'TransferCallerId' => $options['transferCallerId'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new TrunkInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the ipAccessControlLists */ protected function getIpAccessControlLists(): IpAccessControlListList { if (!$this->_ipAccessControlLists) { $this->_ipAccessControlLists = new IpAccessControlListList( $this->version, $this->solution['sid'] ); } return $this->_ipAccessControlLists; } /** * Access the phoneNumbers */ protected function getPhoneNumbers(): PhoneNumberList { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList( $this->version, $this->solution['sid'] ); } return $this->_phoneNumbers; } /** * Access the credentialsLists */ protected function getCredentialsLists(): CredentialListList { if (!$this->_credentialsLists) { $this->_credentialsLists = new CredentialListList( $this->version, $this->solution['sid'] ); } return $this->_credentialsLists; } /** * Access the originationUrls */ protected function getOriginationUrls(): OriginationUrlList { if (!$this->_originationUrls) { $this->_originationUrls = new OriginationUrlList( $this->version, $this->solution['sid'] ); } return $this->_originationUrls; } /** * Access the recordings */ protected function getRecordings(): RecordingList { if (!$this->_recordings) { $this->_recordings = new RecordingList( $this->version, $this->solution['sid'] ); } return $this->_recordings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.TrunkContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListContext.php 0000644 00000005115 15021223077 0020457 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class CredentialListContext extends InstanceContext { /** * Initialize the CredentialListContext * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk to associate the credential list with. * @param string $sid The unique string that we created to identify the CredentialList resource to delete. */ public function __construct( Version $version, $trunkSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trunkSid' => $trunkSid, 'sid' => $sid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/CredentialLists/' . \rawurlencode($sid) .''; } /** * Delete the CredentialListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CredentialListInstance * * @return CredentialListInstance Fetched CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialListInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialListInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.CredentialListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlPage.php 0000644 00000003145 15021223077 0017747 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class OriginationUrlPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return OriginationUrlInstance \Twilio\Rest\Trunking\V1\Trunk\OriginationUrlInstance */ public function buildInstance(array $payload): OriginationUrlInstance { return new OriginationUrlInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.OriginationUrlPage]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlOptions.php 0000644 00000014427 15021223077 0020533 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Options; use Twilio\Values; abstract class OriginationUrlOptions { /** * @param int $weight The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. * @param int $priority The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. * @param bool $enabled Whether the URL is enabled. The default is `true`. * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $sipUrl The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. `sips` is NOT supported. * @return UpdateOriginationUrlOptions Options builder */ public static function update( int $weight = Values::INT_NONE, int $priority = Values::INT_NONE, bool $enabled = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $sipUrl = Values::NONE ): UpdateOriginationUrlOptions { return new UpdateOriginationUrlOptions( $weight, $priority, $enabled, $friendlyName, $sipUrl ); } } class UpdateOriginationUrlOptions extends Options { /** * @param int $weight The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. * @param int $priority The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. * @param bool $enabled Whether the URL is enabled. The default is `true`. * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $sipUrl The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. `sips` is NOT supported. */ public function __construct( int $weight = Values::INT_NONE, int $priority = Values::INT_NONE, bool $enabled = Values::BOOL_NONE, string $friendlyName = Values::NONE, string $sipUrl = Values::NONE ) { $this->options['weight'] = $weight; $this->options['priority'] = $priority; $this->options['enabled'] = $enabled; $this->options['friendlyName'] = $friendlyName; $this->options['sipUrl'] = $sipUrl; } /** * The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. * * @param int $weight The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. * @return $this Fluent Builder */ public function setWeight(int $weight): self { $this->options['weight'] = $weight; return $this; } /** * The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. * * @param int $priority The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. * @return $this Fluent Builder */ public function setPriority(int $priority): self { $this->options['priority'] = $priority; return $this; } /** * Whether the URL is enabled. The default is `true`. * * @param bool $enabled Whether the URL is enabled. The default is `true`. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. `sips` is NOT supported. * * @param string $sipUrl The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. `sips` is NOT supported. * @return $this Fluent Builder */ public function setSipUrl(string $sipUrl): self { $this->options['sipUrl'] = $sipUrl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trunking.V1.UpdateOriginationUrlOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListPage.php 0000644 00000003203 15021223077 0020664 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class IpAccessControlListPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return IpAccessControlListInstance \Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListInstance */ public function buildInstance(array $payload): IpAccessControlListInstance { return new IpAccessControlListInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.IpAccessControlListPage]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingOptions.php 0000644 00000004020 15021223077 0017466 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Options; use Twilio\Values; abstract class RecordingOptions { /** * @param string $mode * @param string $trim * @return UpdateRecordingOptions Options builder */ public static function update( string $mode = Values::NONE, string $trim = Values::NONE ): UpdateRecordingOptions { return new UpdateRecordingOptions( $mode, $trim ); } } class UpdateRecordingOptions extends Options { /** * @param string $mode * @param string $trim */ public function __construct( string $mode = Values::NONE, string $trim = Values::NONE ) { $this->options['mode'] = $mode; $this->options['trim'] = $trim; } /** * @param string $mode * @return $this Fluent Builder */ public function setMode(string $mode): self { $this->options['mode'] = $mode; return $this; } /** * @param string $trim * @return $this Fluent Builder */ public function setTrim(string $trim): self { $this->options['trim'] = $trim; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trunking.V1.UpdateRecordingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlList.php 0000644 00000016362 15021223077 0020013 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class OriginationUrlList extends ListResource { /** * Construct the OriginationUrlList * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk to associate the resource with. */ public function __construct( Version $version, string $trunkSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trunkSid' => $trunkSid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/OriginationUrls'; } /** * Create the OriginationUrlInstance * * @param int $weight The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. * @param int $priority The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. * @param bool $enabled Whether the URL is enabled. The default is `true`. * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $sipUrl The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. * @return OriginationUrlInstance Created OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function create(int $weight, int $priority, bool $enabled, string $friendlyName, string $sipUrl): OriginationUrlInstance { $data = Values::of([ 'Weight' => $weight, 'Priority' => $priority, 'Enabled' => Serialize::booleanToString($enabled), 'FriendlyName' => $friendlyName, 'SipUrl' => $sipUrl, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new OriginationUrlInstance( $this->version, $payload, $this->solution['trunkSid'] ); } /** * Reads OriginationUrlInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return OriginationUrlInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams OriginationUrlInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of OriginationUrlInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return OriginationUrlPage Page of OriginationUrlInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): OriginationUrlPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new OriginationUrlPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of OriginationUrlInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return OriginationUrlPage Page of OriginationUrlInstance */ public function getPage(string $targetUrl): OriginationUrlPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new OriginationUrlPage($this->version, $response, $this->solution); } /** * Constructs a OriginationUrlContext * * @param string $sid The unique string that we created to identify the OriginationUrl resource to delete. */ public function getContext( string $sid ): OriginationUrlContext { return new OriginationUrlContext( $this->version, $this->solution['trunkSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.OriginationUrlList]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberInstance.php 0000644 00000014671 15021223077 0020122 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string $addressRequirements * @property string|null $apiVersion * @property bool|null $beta * @property array|null $capabilities * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property array|null $links * @property string|null $phoneNumber * @property string|null $sid * @property string|null $smsApplicationSid * @property string|null $smsFallbackMethod * @property string|null $smsFallbackUrl * @property string|null $smsMethod * @property string|null $smsUrl * @property string|null $statusCallback * @property string|null $statusCallbackMethod * @property string|null $trunkSid * @property string|null $url * @property string|null $voiceApplicationSid * @property bool|null $voiceCallerIdLookup * @property string|null $voiceFallbackMethod * @property string|null $voiceFallbackUrl * @property string|null $voiceMethod * @property string|null $voiceUrl */ class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trunkSid The SID of the Trunk to associate the phone number with. * @param string $sid The unique string that we created to identify the PhoneNumber resource to delete. */ public function __construct(Version $version, array $payload, string $trunkSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'links' => Values::array_get($payload, 'links'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'sid' => Values::array_get($payload, 'sid'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'url' => Values::array_get($payload, 'url'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), ]; $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PhoneNumberContext Context for this PhoneNumberInstance */ protected function proxy(): PhoneNumberContext { if (!$this->context) { $this->context = new PhoneNumberContext( $this->version, $this->solution['trunkSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the PhoneNumberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PhoneNumberInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListInstance.php 0000644 00000010545 15021223077 0021563 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $sid * @property string|null $trunkSid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class IpAccessControlListInstance extends InstanceResource { /** * Initialize the IpAccessControlListInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trunkSid The SID of the Trunk to associate the IP Access Control List with. * @param string $sid The unique string that we created to identify the IpAccessControlList resource to delete. */ public function __construct(Version $version, array $payload, string $trunkSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return IpAccessControlListContext Context for this IpAccessControlListInstance */ protected function proxy(): IpAccessControlListContext { if (!$this->context) { $this->context = new IpAccessControlListContext( $this->version, $this->solution['trunkSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the IpAccessControlListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the IpAccessControlListInstance * * @return IpAccessControlListInstance Fetched IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAccessControlListInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.IpAccessControlListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListList.php 0000644 00000014754 15021223077 0020740 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class IpAccessControlListList extends ListResource { /** * Construct the IpAccessControlListList * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk to associate the IP Access Control List with. */ public function __construct( Version $version, string $trunkSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trunkSid' => $trunkSid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/IpAccessControlLists'; } /** * Create the IpAccessControlListInstance * * @param string $ipAccessControlListSid The SID of the [IP Access Control List](https://www.twilio.com/docs/voice/sip/api/sip-ipaccesscontrollist-resource) that you want to associate with the trunk. * @return IpAccessControlListInstance Created IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $ipAccessControlListSid): IpAccessControlListInstance { $data = Values::of([ 'IpAccessControlListSid' => $ipAccessControlListSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IpAccessControlListInstance( $this->version, $payload, $this->solution['trunkSid'] ); } /** * Reads IpAccessControlListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpAccessControlListInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams IpAccessControlListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of IpAccessControlListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return IpAccessControlListPage Page of IpAccessControlListInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): IpAccessControlListPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new IpAccessControlListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpAccessControlListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return IpAccessControlListPage Page of IpAccessControlListInstance */ public function getPage(string $targetUrl): IpAccessControlListPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpAccessControlListPage($this->version, $response, $this->solution); } /** * Constructs a IpAccessControlListContext * * @param string $sid The unique string that we created to identify the IpAccessControlList resource to delete. */ public function getContext( string $sid ): IpAccessControlListContext { return new IpAccessControlListContext( $this->version, $this->solution['trunkSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.IpAccessControlListList]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingPage.php 0000644 00000003107 15021223077 0016714 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RecordingInstance \Twilio\Rest\Trunking\V1\Trunk\RecordingInstance */ public function buildInstance(array $payload): RecordingInstance { return new RecordingInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.RecordingPage]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberPage.php 0000644 00000003123 15021223077 0017220 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PhoneNumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return PhoneNumberInstance \Twilio\Rest\Trunking\V1\Trunk\PhoneNumberInstance */ public function buildInstance(array $payload): PhoneNumberInstance { return new PhoneNumberInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.PhoneNumberPage]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListPage.php 0000644 00000003145 15021223077 0017710 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialListPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CredentialListInstance \Twilio\Rest\Trunking\V1\Trunk\CredentialListInstance */ public function buildInstance(array $payload): CredentialListInstance { return new CredentialListInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.CredentialListPage]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlInstance.php 0000644 00000012052 15021223077 0020634 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $sid * @property string|null $trunkSid * @property int|null $weight * @property bool|null $enabled * @property string|null $sipUrl * @property string|null $friendlyName * @property int|null $priority * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class OriginationUrlInstance extends InstanceResource { /** * Initialize the OriginationUrlInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trunkSid The SID of the Trunk to associate the resource with. * @param string $sid The unique string that we created to identify the OriginationUrl resource to delete. */ public function __construct(Version $version, array $payload, string $trunkSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'weight' => Values::array_get($payload, 'weight'), 'enabled' => Values::array_get($payload, 'enabled'), 'sipUrl' => Values::array_get($payload, 'sip_url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'priority' => Values::array_get($payload, 'priority'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return OriginationUrlContext Context for this OriginationUrlInstance */ protected function proxy(): OriginationUrlContext { if (!$this->context) { $this->context = new OriginationUrlContext( $this->version, $this->solution['trunkSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the OriginationUrlInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the OriginationUrlInstance * * @return OriginationUrlInstance Fetched OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): OriginationUrlInstance { return $this->proxy()->fetch(); } /** * Update the OriginationUrlInstance * * @param array|Options $options Optional Arguments * @return OriginationUrlInstance Updated OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): OriginationUrlInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.OriginationUrlInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingList.php 0000644 00000003066 15021223077 0016757 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\ListResource; use Twilio\Version; class RecordingList extends ListResource { /** * Construct the RecordingList * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk from which to fetch the recording settings. */ public function __construct( Version $version, string $trunkSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trunkSid' => $trunkSid, ]; } /** * Constructs a RecordingContext */ public function getContext( ): RecordingContext { return new RecordingContext( $this->version, $this->solution['trunkSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.RecordingList]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberContext.php 0000644 00000005051 15021223077 0017772 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class PhoneNumberContext extends InstanceContext { /** * Initialize the PhoneNumberContext * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk to associate the phone number with. * @param string $sid The unique string that we created to identify the PhoneNumber resource to delete. */ public function __construct( Version $version, $trunkSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trunkSid' => $trunkSid, 'sid' => $sid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/PhoneNumbers/' . \rawurlencode($sid) .''; } /** * Delete the PhoneNumberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PhoneNumberInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new PhoneNumberInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberList.php 0000644 00000014361 15021223077 0017265 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class PhoneNumberList extends ListResource { /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk to associate the phone number with. */ public function __construct( Version $version, string $trunkSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trunkSid' => $trunkSid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/PhoneNumbers'; } /** * Create the PhoneNumberInstance * * @param string $phoneNumberSid The SID of the [Incoming Phone Number](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) that you want to associate with the trunk. * @return PhoneNumberInstance Created PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumberSid): PhoneNumberInstance { $data = Values::of([ 'PhoneNumberSid' => $phoneNumberSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new PhoneNumberInstance( $this->version, $payload, $this->solution['trunkSid'] ); } /** * Reads PhoneNumberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PhoneNumberInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams PhoneNumberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return PhoneNumberPage Page of PhoneNumberInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): PhoneNumberPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return PhoneNumberPage Page of PhoneNumberInstance */ public function getPage(string $targetUrl): PhoneNumberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Constructs a PhoneNumberContext * * @param string $sid The unique string that we created to identify the PhoneNumber resource to delete. */ public function getContext( string $sid ): PhoneNumberContext { return new PhoneNumberContext( $this->version, $this->solution['trunkSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListInstance.php 0000644 00000010435 15021223077 0020600 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $sid * @property string|null $trunkSid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class CredentialListInstance extends InstanceResource { /** * Initialize the CredentialListInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trunkSid The SID of the Trunk to associate the credential list with. * @param string $sid The unique string that we created to identify the CredentialList resource to delete. */ public function __construct(Version $version, array $payload, string $trunkSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialListContext Context for this CredentialListInstance */ protected function proxy(): CredentialListContext { if (!$this->context) { $this->context = new CredentialListContext( $this->version, $this->solution['trunkSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialListInstance * * @return CredentialListInstance Fetched CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialListInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.CredentialListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListContext.php 0000644 00000005213 15021223077 0021437 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class IpAccessControlListContext extends InstanceContext { /** * Initialize the IpAccessControlListContext * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk to associate the IP Access Control List with. * @param string $sid The unique string that we created to identify the IpAccessControlList resource to delete. */ public function __construct( Version $version, $trunkSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trunkSid' => $trunkSid, 'sid' => $sid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/IpAccessControlLists/' . \rawurlencode($sid) .''; } /** * Delete the IpAccessControlListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the IpAccessControlListInstance * * @return IpAccessControlListInstance Fetched IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpAccessControlListInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new IpAccessControlListInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.IpAccessControlListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlContext.php 0000644 00000007176 15021223077 0020527 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class OriginationUrlContext extends InstanceContext { /** * Initialize the OriginationUrlContext * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk to associate the resource with. * @param string $sid The unique string that we created to identify the OriginationUrl resource to delete. */ public function __construct( Version $version, $trunkSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trunkSid' => $trunkSid, 'sid' => $sid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/OriginationUrls/' . \rawurlencode($sid) .''; } /** * Delete the OriginationUrlInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the OriginationUrlInstance * * @return OriginationUrlInstance Fetched OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): OriginationUrlInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new OriginationUrlInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Update the OriginationUrlInstance * * @param array|Options $options Optional Arguments * @return OriginationUrlInstance Updated OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): OriginationUrlInstance { $options = new Values($options); $data = Values::of([ 'Weight' => $options['weight'], 'Priority' => $options['priority'], 'Enabled' => Serialize::booleanToString($options['enabled']), 'FriendlyName' => $options['friendlyName'], 'SipUrl' => $options['sipUrl'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new OriginationUrlInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.OriginationUrlContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListList.php 0000644 00000014620 15021223077 0017747 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CredentialListList extends ListResource { /** * Construct the CredentialListList * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk to associate the credential list with. */ public function __construct( Version $version, string $trunkSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trunkSid' => $trunkSid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/CredentialLists'; } /** * Create the CredentialListInstance * * @param string $credentialListSid The SID of the [Credential List](https://www.twilio.com/docs/voice/sip/api/sip-credentiallist-resource) that you want to associate with the trunk. Once associated, we will authenticate access to the trunk against this list. * @return CredentialListInstance Created CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $credentialListSid): CredentialListInstance { $data = Values::of([ 'CredentialListSid' => $credentialListSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialListInstance( $this->version, $payload, $this->solution['trunkSid'] ); } /** * Reads CredentialListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialListInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialListPage Page of CredentialListInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialListPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialListPage Page of CredentialListInstance */ public function getPage(string $targetUrl): CredentialListPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialListPage($this->version, $response, $this->solution); } /** * Constructs a CredentialListContext * * @param string $sid The unique string that we created to identify the CredentialList resource to delete. */ public function getContext( string $sid ): CredentialListContext { return new CredentialListContext( $this->version, $this->solution['trunkSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.CredentialListList]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingContext.php 0000644 00000005422 15021223077 0017466 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class RecordingContext extends InstanceContext { /** * Initialize the RecordingContext * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk from which to fetch the recording settings. */ public function __construct( Version $version, $trunkSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trunkSid' => $trunkSid, ]; $this->uri = '/Trunks/' . \rawurlencode($trunkSid) .'/Recording'; } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RecordingInstance( $this->version, $payload, $this->solution['trunkSid'] ); } /** * Update the RecordingInstance * * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): RecordingInstance { $options = new Values($options); $data = Values::of([ 'Mode' => $options['mode'], 'Trim' => $options['trim'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RecordingInstance( $this->version, $payload, $this->solution['trunkSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.RecordingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/RecordingInstance.php 0000644 00000007013 15021223077 0017604 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $mode * @property string $trim */ class RecordingInstance extends InstanceResource { /** * Initialize the RecordingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trunkSid The SID of the Trunk from which to fetch the recording settings. */ public function __construct(Version $version, array $payload, string $trunkSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'mode' => Values::array_get($payload, 'mode'), 'trim' => Values::array_get($payload, 'trim'), ]; $this->solution = ['trunkSid' => $trunkSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RecordingContext Context for this RecordingInstance */ protected function proxy(): RecordingContext { if (!$this->context) { $this->context = new RecordingContext( $this->version, $this->solution['trunkSid'] ); } return $this->context; } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { return $this->proxy()->fetch(); } /** * Update the RecordingInstance * * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): RecordingInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.RecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/TrunkInstance.php 0000644 00000015365 15021223077 0015701 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListList; use Twilio\Rest\Trunking\V1\Trunk\PhoneNumberList; use Twilio\Rest\Trunking\V1\Trunk\CredentialListList; use Twilio\Rest\Trunking\V1\Trunk\OriginationUrlList; use Twilio\Rest\Trunking\V1\Trunk\RecordingList; /** * @property string|null $accountSid * @property string|null $domainName * @property string|null $disasterRecoveryMethod * @property string|null $disasterRecoveryUrl * @property string|null $friendlyName * @property bool|null $secure * @property array|null $recording * @property string $transferMode * @property string $transferCallerId * @property bool|null $cnamLookupEnabled * @property string|null $authType * @property string[]|null $authTypeSet * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $sid * @property string|null $url * @property array|null $links */ class TrunkInstance extends InstanceResource { protected $_ipAccessControlLists; protected $_phoneNumbers; protected $_credentialsLists; protected $_originationUrls; protected $_recordings; /** * Initialize the TrunkInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that we created to identify the Trunk resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'domainName' => Values::array_get($payload, 'domain_name'), 'disasterRecoveryMethod' => Values::array_get($payload, 'disaster_recovery_method'), 'disasterRecoveryUrl' => Values::array_get($payload, 'disaster_recovery_url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'secure' => Values::array_get($payload, 'secure'), 'recording' => Values::array_get($payload, 'recording'), 'transferMode' => Values::array_get($payload, 'transfer_mode'), 'transferCallerId' => Values::array_get($payload, 'transfer_caller_id'), 'cnamLookupEnabled' => Values::array_get($payload, 'cnam_lookup_enabled'), 'authType' => Values::array_get($payload, 'auth_type'), 'authTypeSet' => Values::array_get($payload, 'auth_type_set'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TrunkContext Context for this TrunkInstance */ protected function proxy(): TrunkContext { if (!$this->context) { $this->context = new TrunkContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the TrunkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TrunkInstance * * @return TrunkInstance Fetched TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrunkInstance { return $this->proxy()->fetch(); } /** * Update the TrunkInstance * * @param array|Options $options Optional Arguments * @return TrunkInstance Updated TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TrunkInstance { return $this->proxy()->update($options); } /** * Access the ipAccessControlLists */ protected function getIpAccessControlLists(): IpAccessControlListList { return $this->proxy()->ipAccessControlLists; } /** * Access the phoneNumbers */ protected function getPhoneNumbers(): PhoneNumberList { return $this->proxy()->phoneNumbers; } /** * Access the credentialsLists */ protected function getCredentialsLists(): CredentialListList { return $this->proxy()->credentialsLists; } /** * Access the originationUrls */ protected function getOriginationUrls(): OriginationUrlList { return $this->proxy()->originationUrls; } /** * Access the recordings */ protected function getRecordings(): RecordingList { return $this->proxy()->recordings; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.TrunkInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/TrunkOptions.php 0000644 00000052206 15021223077 0015563 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1; use Twilio\Options; use Twilio\Values; abstract class TrunkOptions { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. * @param string $disasterRecoveryUrl The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. * @param string $disasterRecoveryMethod The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. * @param string $transferMode * @param bool $secure Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @param string $transferCallerId * @return CreateTrunkOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $domainName = Values::NONE, string $disasterRecoveryUrl = Values::NONE, string $disasterRecoveryMethod = Values::NONE, string $transferMode = Values::NONE, bool $secure = Values::BOOL_NONE, bool $cnamLookupEnabled = Values::BOOL_NONE, string $transferCallerId = Values::NONE ): CreateTrunkOptions { return new CreateTrunkOptions( $friendlyName, $domainName, $disasterRecoveryUrl, $disasterRecoveryMethod, $transferMode, $secure, $cnamLookupEnabled, $transferCallerId ); } /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. * @param string $disasterRecoveryUrl The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. * @param string $disasterRecoveryMethod The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. * @param string $transferMode * @param bool $secure Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @param string $transferCallerId * @return UpdateTrunkOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $domainName = Values::NONE, string $disasterRecoveryUrl = Values::NONE, string $disasterRecoveryMethod = Values::NONE, string $transferMode = Values::NONE, bool $secure = Values::BOOL_NONE, bool $cnamLookupEnabled = Values::BOOL_NONE, string $transferCallerId = Values::NONE ): UpdateTrunkOptions { return new UpdateTrunkOptions( $friendlyName, $domainName, $disasterRecoveryUrl, $disasterRecoveryMethod, $transferMode, $secure, $cnamLookupEnabled, $transferCallerId ); } } class CreateTrunkOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. * @param string $disasterRecoveryUrl The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. * @param string $disasterRecoveryMethod The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. * @param string $transferMode * @param bool $secure Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @param string $transferCallerId */ public function __construct( string $friendlyName = Values::NONE, string $domainName = Values::NONE, string $disasterRecoveryUrl = Values::NONE, string $disasterRecoveryMethod = Values::NONE, string $transferMode = Values::NONE, bool $secure = Values::BOOL_NONE, bool $cnamLookupEnabled = Values::BOOL_NONE, string $transferCallerId = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['domainName'] = $domainName; $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; $this->options['transferMode'] = $transferMode; $this->options['secure'] = $secure; $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; $this->options['transferCallerId'] = $transferCallerId; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. * * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. * @return $this Fluent Builder */ public function setDomainName(string $domainName): self { $this->options['domainName'] = $domainName; return $this; } /** * The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. * * @param string $disasterRecoveryUrl The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. * @return $this Fluent Builder */ public function setDisasterRecoveryUrl(string $disasterRecoveryUrl): self { $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; return $this; } /** * The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. * * @param string $disasterRecoveryMethod The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setDisasterRecoveryMethod(string $disasterRecoveryMethod): self { $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; return $this; } /** * @param string $transferMode * @return $this Fluent Builder */ public function setTransferMode(string $transferMode): self { $this->options['transferMode'] = $transferMode; return $this; } /** * Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. * * @param bool $secure Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. * @return $this Fluent Builder */ public function setSecure(bool $secure): self { $this->options['secure'] = $secure; return $this; } /** * Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @return $this Fluent Builder */ public function setCnamLookupEnabled(bool $cnamLookupEnabled): self { $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; return $this; } /** * @param string $transferCallerId * @return $this Fluent Builder */ public function setTransferCallerId(string $transferCallerId): self { $this->options['transferCallerId'] = $transferCallerId; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trunking.V1.CreateTrunkOptions ' . $options . ']'; } } class UpdateTrunkOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. * @param string $disasterRecoveryUrl The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. * @param string $disasterRecoveryMethod The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. * @param string $transferMode * @param bool $secure Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @param string $transferCallerId */ public function __construct( string $friendlyName = Values::NONE, string $domainName = Values::NONE, string $disasterRecoveryUrl = Values::NONE, string $disasterRecoveryMethod = Values::NONE, string $transferMode = Values::NONE, bool $secure = Values::BOOL_NONE, bool $cnamLookupEnabled = Values::BOOL_NONE, string $transferCallerId = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['domainName'] = $domainName; $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; $this->options['transferMode'] = $transferMode; $this->options['secure'] = $secure; $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; $this->options['transferCallerId'] = $transferCallerId; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. * * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. * @return $this Fluent Builder */ public function setDomainName(string $domainName): self { $this->options['domainName'] = $domainName; return $this; } /** * The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. * * @param string $disasterRecoveryUrl The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. * @return $this Fluent Builder */ public function setDisasterRecoveryUrl(string $disasterRecoveryUrl): self { $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; return $this; } /** * The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. * * @param string $disasterRecoveryMethod The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setDisasterRecoveryMethod(string $disasterRecoveryMethod): self { $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; return $this; } /** * @param string $transferMode * @return $this Fluent Builder */ public function setTransferMode(string $transferMode): self { $this->options['transferMode'] = $transferMode; return $this; } /** * Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. * * @param bool $secure Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. * @return $this Fluent Builder */ public function setSecure(bool $secure): self { $this->options['secure'] = $secure; return $this; } /** * Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @return $this Fluent Builder */ public function setCnamLookupEnabled(bool $cnamLookupEnabled): self { $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; return $this; } /** * @param string $transferCallerId * @return $this Fluent Builder */ public function setTransferCallerId(string $transferCallerId): self { $this->options['transferCallerId'] = $transferCallerId; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trunking.V1.UpdateTrunkOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/TrunkPage.php 0000644 00000003006 15021223077 0014776 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TrunkPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TrunkInstance \Twilio\Rest\Trunking\V1\TrunkInstance */ public function buildInstance(array $payload): TrunkInstance { return new TrunkInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.TrunkPage]'; } } sdk/src/Twilio/Rest/Trunking/V1/TrunkList.php 0000644 00000014507 15021223077 0015045 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class TrunkList extends ListResource { /** * Construct the TrunkList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Trunks'; } /** * Create the TrunkInstance * * @param array|Options $options Optional Arguments * @return TrunkInstance Created TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): TrunkInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DomainName' => $options['domainName'], 'DisasterRecoveryUrl' => $options['disasterRecoveryUrl'], 'DisasterRecoveryMethod' => $options['disasterRecoveryMethod'], 'TransferMode' => $options['transferMode'], 'Secure' => Serialize::booleanToString($options['secure']), 'CnamLookupEnabled' => Serialize::booleanToString($options['cnamLookupEnabled']), 'TransferCallerId' => $options['transferCallerId'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TrunkInstance( $this->version, $payload ); } /** * Reads TrunkInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TrunkInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams TrunkInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TrunkInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TrunkPage Page of TrunkInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TrunkPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TrunkPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TrunkInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TrunkPage Page of TrunkInstance */ public function getPage(string $targetUrl): TrunkPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TrunkPage($this->version, $response, $this->solution); } /** * Constructs a TrunkContext * * @param string $sid The unique string that we created to identify the Trunk resource to delete. */ public function getContext( string $sid ): TrunkContext { return new TrunkContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1.TrunkList]'; } } sdk/src/Twilio/Rest/Trunking/V1.php 0000644 00000005051 15021223077 0013100 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trunking * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trunking; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Trunking\V1\TrunkList; use Twilio\Version; /** * @property TrunkList $trunks * @method \Twilio\Rest\Trunking\V1\TrunkContext trunks(string $sid) */ class V1 extends Version { protected $_trunks; /** * Construct the V1 version of Trunking * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getTrunks(): TrunkList { if (!$this->_trunks) { $this->_trunks = new TrunkList($this); } return $this->_trunks; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking.V1]'; } } sdk/src/Twilio/Rest/Content.php 0000644 00000001303 15021223077 0012417 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Content\V1; class Content extends ContentBase { /** * @deprecated Use v1->contents instead. */ protected function getContents(): \Twilio\Rest\Content\V1\ContentList { echo "contents is deprecated. Use v1->contents instead."; return $this->v1->contents; } /** * @deprecated Use v1->contents(\$sid) instead. * @param string $sid The unique string that identifies the resource */ protected function contextContents(string $sid): \Twilio\Rest\Content\V1\ContentContext { echo "contents(\$sid) is deprecated. Use v1->contents(\$sid) instead."; return $this->v1->contents($sid); } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapList.php 0000644 00000014374 15021223077 0016031 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncMapList extends ListResource { /** * Construct the SyncMapList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the Sync Map in. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps'; } /** * Create the SyncMapInstance * * @param array|Options $options Optional Arguments * @return SyncMapInstance Created SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): SyncMapInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'Ttl' => $options['ttl'], 'CollectionTtl' => $options['collectionTtl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncMapInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads SyncMapInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncMapInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncMapInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncMapPage Page of SyncMapInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncMapPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncMapPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncMapPage Page of SyncMapInstance */ public function getPage(string $targetUrl): SyncMapPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapContext * * @param string $sid The SID of the Sync Map resource to delete. Can be the Sync Map's `sid` or its `unique_name`. */ public function getContext( string $sid ): SyncMapContext { return new SyncMapContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncMapList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/DocumentPage.php 0000644 00000003067 15021223077 0016173 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DocumentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DocumentInstance \Twilio\Rest\Sync\V1\Service\DocumentInstance */ public function buildInstance(array $payload): DocumentInstance { return new DocumentInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.DocumentPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamList.php 0000644 00000014313 15021223077 0016540 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncStreamList extends ListResource { /** * Construct the SyncStreamList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the new Stream in. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Streams'; } /** * Create the SyncStreamInstance * * @param array|Options $options Optional Arguments * @return SyncStreamInstance Created SyncStreamInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): SyncStreamInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'Ttl' => $options['ttl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncStreamInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads SyncStreamInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncStreamInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncStreamInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncStreamInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncStreamPage Page of SyncStreamInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncStreamPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncStreamPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncStreamInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncStreamPage Page of SyncStreamInstance */ public function getPage(string $targetUrl): SyncStreamPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncStreamPage($this->version, $response, $this->solution); } /** * Constructs a SyncStreamContext * * @param string $sid The SID of the Stream resource to delete. */ public function getContext( string $sid ): SyncStreamContext { return new SyncStreamContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncStreamList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageList.php 0000644 00000005107 15021223077 0021301 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncStream; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class StreamMessageList extends ListResource { /** * Construct the StreamMessageList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the new Stream Message in. * @param string $streamSid The SID of the Sync Stream to create the new Stream Message resource for. */ public function __construct( Version $version, string $serviceSid, string $streamSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'streamSid' => $streamSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Streams/' . \rawurlencode($streamSid) .'/Messages'; } /** * Create the StreamMessageInstance * * @param array $data A JSON string that represents an arbitrary, schema-less object that makes up the Stream Message body. Can be up to 4 KiB in length. * @return StreamMessageInstance Created StreamMessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $data): StreamMessageInstance { $data = Values::of([ 'Data' => Serialize::jsonObject($data), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new StreamMessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['streamSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.StreamMessageList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessagePage.php 0000644 00000003211 15021223077 0021234 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncStream; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class StreamMessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return StreamMessageInstance \Twilio\Rest\Sync\V1\Service\SyncStream\StreamMessageInstance */ public function buildInstance(array $payload): StreamMessageInstance { return new StreamMessageInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['streamSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.StreamMessagePage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageInstance.php 0000644 00000004675 15021223077 0022143 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncStream; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property array|null $data */ class StreamMessageInstance extends InstanceResource { /** * Initialize the StreamMessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the new Stream Message in. * @param string $streamSid The SID of the Sync Stream to create the new Stream Message resource for. */ public function __construct(Version $version, array $payload, string $serviceSid, string $streamSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'data' => Values::array_get($payload, 'data'), ]; $this->solution = ['serviceSid' => $serviceSid, 'streamSid' => $streamSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.StreamMessageInstance]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionPage.php 0000644 00000003245 15021223077 0022020 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\Document; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DocumentPermissionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DocumentPermissionInstance \Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionInstance */ public function buildInstance(array $payload): DocumentPermissionInstance { return new DocumentPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.DocumentPermissionPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionContext.php 0000644 00000010431 15021223077 0022563 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\Document; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class DocumentPermissionContext extends InstanceContext { /** * Initialize the DocumentPermissionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) with the Document Permission resource to delete. * @param string $documentSid The SID of the Sync Document with the Document Permission resource to delete. Can be the Document resource's `sid` or its `unique_name`. * @param string $identity The application-defined string that uniquely identifies the User's Document Permission resource to delete. */ public function __construct( Version $version, $serviceSid, $documentSid, $identity ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Documents/' . \rawurlencode($documentSid) .'/Permissions/' . \rawurlencode($identity) .''; } /** * Delete the DocumentPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the DocumentPermissionInstance * * @return DocumentPermissionInstance Fetched DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentPermissionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new DocumentPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } /** * Update the DocumentPermissionInstance * * @param bool $read Whether the identity can read the Sync Document. Default value is `false`. * @param bool $write Whether the identity can update the Sync Document. Default value is `false`. * @param bool $manage Whether the identity can delete the Sync Document. Default value is `false`. * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DocumentPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.DocumentPermissionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionList.php 0000644 00000014031 15021223077 0022052 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\Document; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DocumentPermissionList extends ListResource { /** * Construct the DocumentPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) with the Document Permission resource to delete. * @param string $documentSid The SID of the Sync Document with the Document Permission resource to delete. Can be the Document resource's `sid` or its `unique_name`. */ public function __construct( Version $version, string $serviceSid, string $documentSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'documentSid' => $documentSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Documents/' . \rawurlencode($documentSid) .'/Permissions'; } /** * Reads DocumentPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DocumentPermissionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DocumentPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DocumentPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DocumentPermissionPage Page of DocumentPermissionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DocumentPermissionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DocumentPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DocumentPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DocumentPermissionPage Page of DocumentPermissionInstance */ public function getPage(string $targetUrl): DocumentPermissionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DocumentPermissionPage($this->version, $response, $this->solution); } /** * Constructs a DocumentPermissionContext * * @param string $identity The application-defined string that uniquely identifies the User's Document Permission resource to delete. */ public function getContext( string $identity ): DocumentPermissionContext { return new DocumentPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['documentSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.DocumentPermissionList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionInstance.php 0000644 00000012572 15021223077 0022713 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\Document; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $documentSid * @property string|null $identity * @property bool|null $read * @property bool|null $write * @property bool|null $manage * @property string|null $url */ class DocumentPermissionInstance extends InstanceResource { /** * Initialize the DocumentPermissionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) with the Document Permission resource to delete. * @param string $documentSid The SID of the Sync Document with the Document Permission resource to delete. Can be the Document resource's `sid` or its `unique_name`. * @param string $identity The application-defined string that uniquely identifies the User's Document Permission resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $documentSid, string $identity = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'documentSid' => Values::array_get($payload, 'document_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity ?: $this->properties['identity'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DocumentPermissionContext Context for this DocumentPermissionInstance */ protected function proxy(): DocumentPermissionContext { if (!$this->context) { $this->context = new DocumentPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } return $this->context; } /** * Delete the DocumentPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DocumentPermissionInstance * * @return DocumentPermissionInstance Fetched DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentPermissionInstance { return $this->proxy()->fetch(); } /** * Update the DocumentPermissionInstance * * @param bool $read Whether the identity can read the Sync Document. Default value is `false`. * @param bool $write Whether the identity can update the Sync Document. Default value is `false`. * @param bool $manage Whether the identity can delete the Sync Document. Default value is `false`. * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.DocumentPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapPage.php 0000644 00000003061 15021223077 0015761 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncMapPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SyncMapInstance \Twilio\Rest\Sync\V1\Service\SyncMapInstance */ public function buildInstance(array $payload): SyncMapInstance { return new SyncMapInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncMapPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/DocumentOptions.php 0000644 00000015715 15021223077 0016755 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Options; use Twilio\Values; abstract class DocumentOptions { /** * @param string $uniqueName An application-defined string that uniquely identifies the Sync Document * @param array $data A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (the Sync Document's time-to-live). * @return CreateDocumentOptions Options builder */ public static function create( string $uniqueName = Values::NONE, array $data = Values::ARRAY_NONE, int $ttl = Values::INT_NONE ): CreateDocumentOptions { return new CreateDocumentOptions( $uniqueName, $data, $ttl ); } /** * @param array $data A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (time-to-live). * @param string $ifMatch The If-Match HTTP request header * @return UpdateDocumentOptions Options builder */ public static function update( array $data = Values::ARRAY_NONE, int $ttl = Values::INT_NONE, string $ifMatch = Values::NONE ): UpdateDocumentOptions { return new UpdateDocumentOptions( $data, $ttl, $ifMatch ); } } class CreateDocumentOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the Sync Document * @param array $data A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (the Sync Document's time-to-live). */ public function __construct( string $uniqueName = Values::NONE, array $data = Values::ARRAY_NONE, int $ttl = Values::INT_NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['data'] = $data; $this->options['ttl'] = $ttl; } /** * An application-defined string that uniquely identifies the Sync Document * * @param string $uniqueName An application-defined string that uniquely identifies the Sync Document * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. * * @param array $data A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. * @return $this Fluent Builder */ public function setData(array $data): self { $this->options['data'] = $data; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (the Sync Document's time-to-live). * * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (the Sync Document's time-to-live). * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.CreateDocumentOptions ' . $options . ']'; } } class UpdateDocumentOptions extends Options { /** * @param array $data A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (time-to-live). * @param string $ifMatch The If-Match HTTP request header */ public function __construct( array $data = Values::ARRAY_NONE, int $ttl = Values::INT_NONE, string $ifMatch = Values::NONE ) { $this->options['data'] = $data; $this->options['ttl'] = $ttl; $this->options['ifMatch'] = $ifMatch; } /** * A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. * * @param array $data A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. * @return $this Fluent Builder */ public function setData(array $data): self { $this->options['data'] = $data; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (time-to-live). * * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (time-to-live). * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.UpdateDocumentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamOptions.php 0000644 00000012421 15021223077 0017256 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Options; use Twilio\Stream; use Twilio\Values; abstract class SyncStreamOptions { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). * @return CreateSyncStreamOptions Options builder */ public static function create( string $uniqueName = Values::NONE, int $ttl = Values::INT_NONE ): CreateSyncStreamOptions { return new CreateSyncStreamOptions( $uniqueName, $ttl ); } /** * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). * @return UpdateSyncStreamOptions Options builder */ public static function update( int $ttl = Values::INT_NONE ): UpdateSyncStreamOptions { return new UpdateSyncStreamOptions( $ttl ); } } class CreateSyncStreamOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). */ public function __construct( string $uniqueName = Values::NONE, int $ttl = Values::INT_NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; } /** * An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). * * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.CreateSyncStreamOptions ' . $options . ']'; } } class UpdateSyncStreamOptions extends Options { /** * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). */ public function __construct( int $ttl = Values::INT_NONE ) { $this->options['ttl'] = $ttl; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). * * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.UpdateSyncStreamOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapOptions.php 0000644 00000014743 15021223077 0016551 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Options; use Twilio\Values; abstract class SyncMapOptions { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. * @param int $ttl An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. * @return CreateSyncMapOptions Options builder */ public static function create( string $uniqueName = Values::NONE, int $ttl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE ): CreateSyncMapOptions { return new CreateSyncMapOptions( $uniqueName, $ttl, $collectionTtl ); } /** * @param int $ttl An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. * @return UpdateSyncMapOptions Options builder */ public static function update( int $ttl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE ): UpdateSyncMapOptions { return new UpdateSyncMapOptions( $ttl, $collectionTtl ); } } class CreateSyncMapOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. * @param int $ttl An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. */ public function __construct( string $uniqueName = Values::NONE, int $ttl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.CreateSyncMapOptions ' . $options . ']'; } } class UpdateSyncMapOptions extends Options { /** * @param int $ttl An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. */ public function __construct( int $ttl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE ) { $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.UpdateSyncMapOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/DocumentList.php 0000644 00000014512 15021223077 0016227 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class DocumentList extends ListResource { /** * Construct the DocumentList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the new Document resource in. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Documents'; } /** * Create the DocumentInstance * * @param array|Options $options Optional Arguments * @return DocumentInstance Created DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): DocumentInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'Data' => Serialize::jsonObject($options['data']), 'Ttl' => $options['ttl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DocumentInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads DocumentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DocumentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DocumentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DocumentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DocumentPage Page of DocumentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DocumentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DocumentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DocumentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DocumentPage Page of DocumentInstance */ public function getPage(string $targetUrl): DocumentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DocumentPage($this->version, $response, $this->solution); } /** * Constructs a DocumentContext * * @param string $sid The SID of the Document resource to delete. Can be the Document resource's `sid` or its `unique_name`. */ public function getContext( string $sid ): DocumentContext { return new DocumentContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.DocumentList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncListInstance.php 0000644 00000013160 15021223077 0017050 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionList; use Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemList; /** * @property string|null $sid * @property string|null $uniqueName * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $url * @property array|null $links * @property string|null $revision * @property \DateTime|null $dateExpires * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy */ class SyncListInstance extends InstanceResource { protected $_syncListPermissions; protected $_syncListItems; /** * Initialize the SyncListInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the new Sync List in. * @param string $sid The SID of the Sync List resource to delete. Can be the Sync List resource's `sid` or its `unique_name`. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncListContext Context for this SyncListInstance */ protected function proxy(): SyncListContext { if (!$this->context) { $this->context = new SyncListContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the SyncListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncListInstance * * @return SyncListInstance Fetched SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListInstance { return $this->proxy()->fetch(); } /** * Update the SyncListInstance * * @param array|Options $options Optional Arguments * @return SyncListInstance Updated SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncListInstance { return $this->proxy()->update($options); } /** * Access the syncListPermissions */ protected function getSyncListPermissions(): SyncListPermissionList { return $this->proxy()->syncListPermissions; } /** * Access the syncListItems */ protected function getSyncListItems(): SyncListItemList { return $this->proxy()->syncListItems; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncListPage.php 0000644 00000003067 15021223077 0016165 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncListPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SyncListInstance \Twilio\Rest\Sync\V1\Service\SyncListInstance */ public function buildInstance(array $payload): SyncListInstance { return new SyncListInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncListPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncListList.php 0000644 00000014445 15021223077 0016226 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncListList extends ListResource { /** * Construct the SyncListList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the new Sync List in. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists'; } /** * Create the SyncListInstance * * @param array|Options $options Optional Arguments * @return SyncListInstance Created SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): SyncListInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'Ttl' => $options['ttl'], 'CollectionTtl' => $options['collectionTtl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncListInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads SyncListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncListPage Page of SyncListInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncListPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncListPage Page of SyncListInstance */ public function getPage(string $targetUrl): SyncListPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListPage($this->version, $response, $this->solution); } /** * Constructs a SyncListContext * * @param string $sid The SID of the Sync List resource to delete. Can be the Sync List resource's `sid` or its `unique_name`. */ public function getContext( string $sid ): SyncListContext { return new SyncListContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncListList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncListContext.php 0000644 00000013521 15021223077 0016731 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionList; use Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemList; /** * @property SyncListPermissionList $syncListPermissions * @property SyncListItemList $syncListItems * @method \Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionContext syncListPermissions(string $identity) * @method \Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemContext syncListItems(string $index) */ class SyncListContext extends InstanceContext { protected $_syncListPermissions; protected $_syncListItems; /** * Initialize the SyncListContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the new Sync List in. * @param string $sid The SID of the Sync List resource to delete. Can be the Sync List resource's `sid` or its `unique_name`. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($sid) .''; } /** * Delete the SyncListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SyncListInstance * * @return SyncListInstance Fetched SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncListInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the SyncListInstance * * @param array|Options $options Optional Arguments * @return SyncListInstance Updated SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncListInstance { $options = new Values($options); $data = Values::of([ 'Ttl' => $options['ttl'], 'CollectionTtl' => $options['collectionTtl'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SyncListInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the syncListPermissions */ protected function getSyncListPermissions(): SyncListPermissionList { if (!$this->_syncListPermissions) { $this->_syncListPermissions = new SyncListPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListPermissions; } /** * Access the syncListItems */ protected function getSyncListItems(): SyncListItemList { if (!$this->_syncListItems) { $this->_syncListItems = new SyncListItemList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListItems; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapInstance.php 0000644 00000013102 15021223077 0016646 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemList; use Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionList; /** * @property string|null $sid * @property string|null $uniqueName * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $url * @property array|null $links * @property string|null $revision * @property \DateTime|null $dateExpires * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy */ class SyncMapInstance extends InstanceResource { protected $_syncMapItems; protected $_syncMapPermissions; /** * Initialize the SyncMapInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the Sync Map in. * @param string $sid The SID of the Sync Map resource to delete. Can be the Sync Map's `sid` or its `unique_name`. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncMapContext Context for this SyncMapInstance */ protected function proxy(): SyncMapContext { if (!$this->context) { $this->context = new SyncMapContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the SyncMapInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncMapInstance * * @return SyncMapInstance Fetched SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapInstance { return $this->proxy()->fetch(); } /** * Update the SyncMapInstance * * @param array|Options $options Optional Arguments * @return SyncMapInstance Updated SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncMapInstance { return $this->proxy()->update($options); } /** * Access the syncMapItems */ protected function getSyncMapItems(): SyncMapItemList { return $this->proxy()->syncMapItems; } /** * Access the syncMapPermissions */ protected function getSyncMapPermissions(): SyncMapPermissionList { return $this->proxy()->syncMapPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapContext.php 0000644 00000013422 15021223077 0016533 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemList; use Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionList; /** * @property SyncMapItemList $syncMapItems * @property SyncMapPermissionList $syncMapPermissions * @method \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemContext syncMapItems(string $key) * @method \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionContext syncMapPermissions(string $identity) */ class SyncMapContext extends InstanceContext { protected $_syncMapItems; protected $_syncMapPermissions; /** * Initialize the SyncMapContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the Sync Map in. * @param string $sid The SID of the Sync Map resource to delete. Can be the Sync Map's `sid` or its `unique_name`. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($sid) .''; } /** * Delete the SyncMapInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SyncMapInstance * * @return SyncMapInstance Fetched SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncMapInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the SyncMapInstance * * @param array|Options $options Optional Arguments * @return SyncMapInstance Updated SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncMapInstance { $options = new Values($options); $data = Values::of([ 'Ttl' => $options['ttl'], 'CollectionTtl' => $options['collectionTtl'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SyncMapInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the syncMapItems */ protected function getSyncMapItems(): SyncMapItemList { if (!$this->_syncMapItems) { $this->_syncMapItems = new SyncMapItemList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncMapItems; } /** * Access the syncMapPermissions */ protected function getSyncMapPermissions(): SyncMapPermissionList { if (!$this->_syncMapPermissions) { $this->_syncMapPermissions = new SyncMapPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncMapPermissions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/DocumentInstance.php 0000644 00000012716 15021223077 0017064 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionList; /** * @property string|null $sid * @property string|null $uniqueName * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $url * @property array|null $links * @property string|null $revision * @property array|null $data * @property \DateTime|null $dateExpires * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy */ class DocumentInstance extends InstanceResource { protected $_documentPermissions; /** * Initialize the DocumentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the new Document resource in. * @param string $sid The SID of the Document resource to delete. Can be the Document resource's `sid` or its `unique_name`. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DocumentContext Context for this DocumentInstance */ protected function proxy(): DocumentContext { if (!$this->context) { $this->context = new DocumentContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the DocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DocumentInstance * * @return DocumentInstance Fetched DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentInstance { return $this->proxy()->fetch(); } /** * Update the DocumentInstance * * @param array|Options $options Optional Arguments * @return DocumentInstance Updated DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DocumentInstance { return $this->proxy()->update($options); } /** * Access the documentPermissions */ protected function getDocumentPermissions(): DocumentPermissionList { return $this->proxy()->documentPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.DocumentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemContext.php 0000644 00000010240 15021223077 0021313 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class SyncListItemContext extends InstanceContext { /** * Initialize the SyncListItemContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the new List Item in. * @param string $listSid The SID of the Sync List to add the new List Item to. Can be the Sync List resource's `sid` or its `unique_name`. * @param int $index The index of the Sync List Item resource to delete. */ public function __construct( Version $version, $serviceSid, $listSid, $index ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Items/' . \rawurlencode($index) .''; } /** * Delete the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['If-Match' => $options['ifMatch']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListItemInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } /** * Update the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return SyncListItemInstance Updated SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncListItemInstance { $options = new Values($options); $data = Values::of([ 'Data' => Serialize::jsonObject($options['data']), 'Ttl' => $options['ttl'], 'ItemTtl' => $options['itemTtl'], 'CollectionTtl' => $options['collectionTtl'], ]); $headers = Values::of(['If-Match' => $options['ifMatch']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListItemContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionPage.php 0000644 00000003241 15021223077 0022000 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncListPermissionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SyncListPermissionInstance \Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionInstance */ public function buildInstance(array $payload): SyncListPermissionInstance { return new SyncListPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncListPermissionPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemList.php 0000644 00000016511 15021223077 0020611 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class SyncListItemList extends ListResource { /** * Construct the SyncListItemList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the new List Item in. * @param string $listSid The SID of the Sync List to add the new List Item to. Can be the Sync List resource's `sid` or its `unique_name`. */ public function __construct( Version $version, string $serviceSid, string $listSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Items'; } /** * Create the SyncListItemInstance * * @param array $data A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. * @param array|Options $options Optional Arguments * @return SyncListItemInstance Created SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $data, array $options = []): SyncListItemInstance { $options = new Values($options); $data = Values::of([ 'Data' => Serialize::jsonObject($data), 'Ttl' => $options['ttl'], 'ItemTtl' => $options['itemTtl'], 'CollectionTtl' => $options['collectionTtl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'] ); } /** * Reads SyncListItemInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListItemInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SyncListItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncListItemInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncListItemPage Page of SyncListItemInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncListItemPage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'From' => $options['from'], 'Bounds' => $options['bounds'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncListItemPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListItemInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncListItemPage Page of SyncListItemInstance */ public function getPage(string $targetUrl): SyncListItemPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListItemPage($this->version, $response, $this->solution); } /** * Constructs a SyncListItemContext * * @param int $index The index of the Sync List Item resource to delete. */ public function getContext( int $index ): SyncListItemContext { return new SyncListItemContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $index ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncListItemList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionContext.php 0000644 00000010430 15021223077 0022546 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class SyncListPermissionContext extends InstanceContext { /** * Initialize the SyncListPermissionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) with the Sync List Permission resource to delete. * @param string $listSid The SID of the Sync List with the Sync List Permission resource to delete. Can be the Sync List resource's `sid` or its `unique_name`. * @param string $identity The application-defined string that uniquely identifies the User's Sync List Permission resource to delete. */ public function __construct( Version $version, $serviceSid, $listSid, $identity ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Permissions/' . \rawurlencode($identity) .''; } /** * Delete the SyncListPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SyncListPermissionInstance * * @return SyncListPermissionInstance Fetched SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListPermissionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncListPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } /** * Update the SyncListPermissionInstance * * @param bool $read Whether the identity can read the Sync List and its Items. Default value is `false`. * @param bool $write Whether the identity can create, update, and delete Items in the Sync List. Default value is `false`. * @param bool $manage Whether the identity can delete the Sync List. Default value is `false`. * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SyncListPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListPermissionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemOptions.php 0000644 00000040134 15021223077 0021327 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Options; use Twilio\Values; abstract class SyncListItemOptions { /** * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. * @return CreateSyncListItemOptions Options builder */ public static function create( int $ttl = Values::INT_NONE, int $itemTtl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE ): CreateSyncListItemOptions { return new CreateSyncListItemOptions( $ttl, $itemTtl, $collectionTtl ); } /** * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * @return DeleteSyncListItemOptions Options builder */ public static function delete( string $ifMatch = Values::NONE ): DeleteSyncListItemOptions { return new DeleteSyncListItemOptions( $ifMatch ); } /** * @param string $order How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. * @param string $from The `index` of the first Sync List Item resource to read. See also `bounds`. * @param string $bounds Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. * @return ReadSyncListItemOptions Options builder */ public static function read( string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE ): ReadSyncListItemOptions { return new ReadSyncListItemOptions( $order, $from, $bounds ); } /** * @param array $data A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. This parameter can only be used when the List Item's `data` or `ttl` is updated in the same request. * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * @return UpdateSyncListItemOptions Options builder */ public static function update( array $data = Values::ARRAY_NONE, int $ttl = Values::INT_NONE, int $itemTtl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE, string $ifMatch = Values::NONE ): UpdateSyncListItemOptions { return new UpdateSyncListItemOptions( $data, $ttl, $itemTtl, $collectionTtl, $ifMatch ); } } class CreateSyncListItemOptions extends Options { /** * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. */ public function __construct( int $ttl = Values::INT_NONE, int $itemTtl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE ) { $this->options['ttl'] = $ttl; $this->options['itemTtl'] = $itemTtl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `item_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. * * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setItemTtl(int $itemTtl): self { $this->options['itemTtl'] = $itemTtl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.CreateSyncListItemOptions ' . $options . ']'; } } class DeleteSyncListItemOptions extends Options { /** * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ public function __construct( string $ifMatch = Values::NONE ) { $this->options['ifMatch'] = $ifMatch; } /** * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.DeleteSyncListItemOptions ' . $options . ']'; } } class ReadSyncListItemOptions extends Options { /** * @param string $order How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. * @param string $from The `index` of the first Sync List Item resource to read. See also `bounds`. * @param string $bounds Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. */ public function __construct( string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE ) { $this->options['order'] = $order; $this->options['from'] = $from; $this->options['bounds'] = $bounds; } /** * How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. * * @param string $order How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * The `index` of the first Sync List Item resource to read. See also `bounds`. * * @param string $from The `index` of the first Sync List Item resource to read. See also `bounds`. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. * * @param string $bounds Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. * @return $this Fluent Builder */ public function setBounds(string $bounds): self { $this->options['bounds'] = $bounds; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.ReadSyncListItemOptions ' . $options . ']'; } } class UpdateSyncListItemOptions extends Options { /** * @param array $data A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. This parameter can only be used when the List Item's `data` or `ttl` is updated in the same request. * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ public function __construct( array $data = Values::ARRAY_NONE, int $ttl = Values::INT_NONE, int $itemTtl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE, string $ifMatch = Values::NONE ) { $this->options['data'] = $data; $this->options['ttl'] = $ttl; $this->options['itemTtl'] = $itemTtl; $this->options['collectionTtl'] = $collectionTtl; $this->options['ifMatch'] = $ifMatch; } /** * A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. * * @param array $data A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. * @return $this Fluent Builder */ public function setData(array $data): self { $this->options['data'] = $data; return $this; } /** * An alias for `item_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. * * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setItemTtl(int $itemTtl): self { $this->options['itemTtl'] = $itemTtl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. This parameter can only be used when the List Item's `data` or `ttl` is updated in the same request. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. This parameter can only be used when the List Item's `data` or `ttl` is updated in the same request. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.UpdateSyncListItemOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionList.php 0000644 00000013775 15021223077 0022054 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncListPermissionList extends ListResource { /** * Construct the SyncListPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) with the Sync List Permission resource to delete. * @param string $listSid The SID of the Sync List with the Sync List Permission resource to delete. Can be the Sync List resource's `sid` or its `unique_name`. */ public function __construct( Version $version, string $serviceSid, string $listSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Permissions'; } /** * Reads SyncListPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListPermissionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncListPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncListPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncListPermissionPage Page of SyncListPermissionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncListPermissionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncListPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncListPermissionPage Page of SyncListPermissionInstance */ public function getPage(string $targetUrl): SyncListPermissionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListPermissionPage($this->version, $response, $this->solution); } /** * Constructs a SyncListPermissionContext * * @param string $identity The application-defined string that uniquely identifies the User's Sync List Permission resource to delete. */ public function getContext( string $identity ): SyncListPermissionContext { return new SyncListPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncListPermissionList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemInstance.php 0000644 00000012621 15021223077 0021440 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property int|null $index * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $listSid * @property string|null $url * @property string|null $revision * @property array|null $data * @property \DateTime|null $dateExpires * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy */ class SyncListItemInstance extends InstanceResource { /** * Initialize the SyncListItemInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the new List Item in. * @param string $listSid The SID of the Sync List to add the new List Item to. Can be the Sync List resource's `sid` or its `unique_name`. * @param int $index The index of the Sync List Item resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $listSid, int $index = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'index' => Values::array_get($payload, 'index'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'listSid' => Values::array_get($payload, 'list_sid'), 'url' => Values::array_get($payload, 'url'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index ?: $this->properties['index'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncListItemContext Context for this SyncListItemInstance */ protected function proxy(): SyncListItemContext { if (!$this->context) { $this->context = new SyncListItemContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } return $this->context; } /** * Delete the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListItemInstance { return $this->proxy()->fetch(); } /** * Update the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return SyncListItemInstance Updated SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncListItemInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListItemInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemPage.php 0000644 00000003175 15021223077 0020554 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncListItemPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SyncListItemInstance \Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemInstance */ public function buildInstance(array $payload): SyncListItemInstance { return new SyncListItemInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncListItemPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionInstance.php 0000644 00000012571 15021223077 0022676 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $listSid * @property string|null $identity * @property bool|null $read * @property bool|null $write * @property bool|null $manage * @property string|null $url */ class SyncListPermissionInstance extends InstanceResource { /** * Initialize the SyncListPermissionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) with the Sync List Permission resource to delete. * @param string $listSid The SID of the Sync List with the Sync List Permission resource to delete. Can be the Sync List resource's `sid` or its `unique_name`. * @param string $identity The application-defined string that uniquely identifies the User's Sync List Permission resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $listSid, string $identity = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'listSid' => Values::array_get($payload, 'list_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity ?: $this->properties['identity'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncListPermissionContext Context for this SyncListPermissionInstance */ protected function proxy(): SyncListPermissionContext { if (!$this->context) { $this->context = new SyncListPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } return $this->context; } /** * Delete the SyncListPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncListPermissionInstance * * @return SyncListPermissionInstance Fetched SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListPermissionInstance { return $this->proxy()->fetch(); } /** * Update the SyncListPermissionInstance * * @param bool $read Whether the identity can read the Sync List and its Items. Default value is `false`. * @param bool $write Whether the identity can create, update, and delete Items in the Sync List. Default value is `false`. * @param bool $manage Whether the identity can delete the Sync List. Default value is `false`. * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamPage.php 0000644 00000003103 15021223077 0016474 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncStreamPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SyncStreamInstance \Twilio\Rest\Sync\V1\Service\SyncStreamInstance */ public function buildInstance(array $payload): SyncStreamInstance { return new SyncStreamInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncStreamPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemList.php 0000644 00000016707 15021223077 0020224 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class SyncMapItemList extends ListResource { /** * Construct the SyncMapItemList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the Map Item in. * @param string $mapSid The SID of the Sync Map to add the new Map Item to. Can be the Sync Map resource's `sid` or its `unique_name`. */ public function __construct( Version $version, string $serviceSid, string $mapSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Items'; } /** * Create the SyncMapItemInstance * * @param string $key The unique, user-defined key for the Map Item. Can be up to 320 characters long. * @param array $data A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Created SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $key, array $data, array $options = []): SyncMapItemInstance { $options = new Values($options); $data = Values::of([ 'Key' => $key, 'Data' => Serialize::jsonObject($data), 'Ttl' => $options['ttl'], 'ItemTtl' => $options['itemTtl'], 'CollectionTtl' => $options['collectionTtl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'] ); } /** * Reads SyncMapItemInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapItemInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SyncMapItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncMapItemInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncMapItemPage Page of SyncMapItemInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncMapItemPage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'From' => $options['from'], 'Bounds' => $options['bounds'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncMapItemPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapItemInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncMapItemPage Page of SyncMapItemInstance */ public function getPage(string $targetUrl): SyncMapItemPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapItemPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapItemContext * * @param string $key The `key` value of the Sync Map Item resource to delete. */ public function getContext( string $key ): SyncMapItemContext { return new SyncMapItemContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $key ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncMapItemList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionInstance.php 0000644 00000012607 15021223077 0022302 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $mapSid * @property string|null $identity * @property bool|null $read * @property bool|null $write * @property bool|null $manage * @property string|null $url */ class SyncMapPermissionInstance extends InstanceResource { /** * Initialize the SyncMapPermissionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) with the Sync Map Permission resource to delete. Can be the Service's `sid` value or `default`. * @param string $mapSid The SID of the Sync Map with the Sync Map Permission resource to delete. Can be the Sync Map resource's `sid` or its `unique_name`. * @param string $identity The application-defined string that uniquely identifies the User's Sync Map Permission resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $mapSid, string $identity = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'mapSid' => Values::array_get($payload, 'map_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity ?: $this->properties['identity'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncMapPermissionContext Context for this SyncMapPermissionInstance */ protected function proxy(): SyncMapPermissionContext { if (!$this->context) { $this->context = new SyncMapPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } return $this->context; } /** * Delete the SyncMapPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncMapPermissionInstance * * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapPermissionInstance { return $this->proxy()->fetch(); } /** * Update the SyncMapPermissionInstance * * @param bool $read Whether the identity can read the Sync Map and its Items. Default value is `false`. * @param bool $write Whether the identity can create, update, and delete Items in the Sync Map. Default value is `false`. * @param bool $manage Whether the identity can delete the Sync Map. Default value is `false`. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemOptions.php 0000644 00000040662 15021223077 0020741 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Options; use Twilio\Values; abstract class SyncMapItemOptions { /** * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. * @return CreateSyncMapItemOptions Options builder */ public static function create( int $ttl = Values::INT_NONE, int $itemTtl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE ): CreateSyncMapItemOptions { return new CreateSyncMapItemOptions( $ttl, $itemTtl, $collectionTtl ); } /** * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * @return DeleteSyncMapItemOptions Options builder */ public static function delete( string $ifMatch = Values::NONE ): DeleteSyncMapItemOptions { return new DeleteSyncMapItemOptions( $ifMatch ); } /** * @param string $order How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. * @param string $from The `key` of the first Sync Map Item resource to read. See also `bounds`. * @param string $bounds Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. * @return ReadSyncMapItemOptions Options builder */ public static function read( string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE ): ReadSyncMapItemOptions { return new ReadSyncMapItemOptions( $order, $from, $bounds ); } /** * @param array $data A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. This parameter can only be used when the Map Item's `data` or `ttl` is updated in the same request. * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * @return UpdateSyncMapItemOptions Options builder */ public static function update( array $data = Values::ARRAY_NONE, int $ttl = Values::INT_NONE, int $itemTtl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE, string $ifMatch = Values::NONE ): UpdateSyncMapItemOptions { return new UpdateSyncMapItemOptions( $data, $ttl, $itemTtl, $collectionTtl, $ifMatch ); } } class CreateSyncMapItemOptions extends Options { /** * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. */ public function __construct( int $ttl = Values::INT_NONE, int $itemTtl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE ) { $this->options['ttl'] = $ttl; $this->options['itemTtl'] = $itemTtl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `item_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. * * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setItemTtl(int $itemTtl): self { $this->options['itemTtl'] = $itemTtl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.CreateSyncMapItemOptions ' . $options . ']'; } } class DeleteSyncMapItemOptions extends Options { /** * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ public function __construct( string $ifMatch = Values::NONE ) { $this->options['ifMatch'] = $ifMatch; } /** * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.DeleteSyncMapItemOptions ' . $options . ']'; } } class ReadSyncMapItemOptions extends Options { /** * @param string $order How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. * @param string $from The `key` of the first Sync Map Item resource to read. See also `bounds`. * @param string $bounds Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. */ public function __construct( string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE ) { $this->options['order'] = $order; $this->options['from'] = $from; $this->options['bounds'] = $bounds; } /** * How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. * * @param string $order How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * The `key` of the first Sync Map Item resource to read. See also `bounds`. * * @param string $from The `key` of the first Sync Map Item resource to read. See also `bounds`. * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. * * @param string $bounds Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. * @return $this Fluent Builder */ public function setBounds(string $bounds): self { $this->options['bounds'] = $bounds; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.ReadSyncMapItemOptions ' . $options . ']'; } } class UpdateSyncMapItemOptions extends Options { /** * @param array $data A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. This parameter can only be used when the Map Item's `data` or `ttl` is updated in the same request. * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). */ public function __construct( array $data = Values::ARRAY_NONE, int $ttl = Values::INT_NONE, int $itemTtl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE, string $ifMatch = Values::NONE ) { $this->options['data'] = $data; $this->options['ttl'] = $ttl; $this->options['itemTtl'] = $itemTtl; $this->options['collectionTtl'] = $collectionTtl; $this->options['ifMatch'] = $ifMatch; } /** * A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. * * @param array $data A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. * @return $this Fluent Builder */ public function setData(array $data): self { $this->options['data'] = $data; return $this; } /** * An alias for `item_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. * * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setItemTtl(int $itemTtl): self { $this->options['itemTtl'] = $itemTtl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. This parameter can only be used when the Map Item's `data` or `ttl` is updated in the same request. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. This parameter can only be used when the Map Item's `data` or `ttl` is updated in the same request. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.UpdateSyncMapItemOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionContext.php 0000644 00000010450 15021223077 0022154 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class SyncMapPermissionContext extends InstanceContext { /** * Initialize the SyncMapPermissionContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) with the Sync Map Permission resource to delete. Can be the Service's `sid` value or `default`. * @param string $mapSid The SID of the Sync Map with the Sync Map Permission resource to delete. Can be the Sync Map resource's `sid` or its `unique_name`. * @param string $identity The application-defined string that uniquely identifies the User's Sync Map Permission resource to delete. */ public function __construct( Version $version, $serviceSid, $mapSid, $identity ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Permissions/' . \rawurlencode($identity) .''; } /** * Delete the SyncMapPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SyncMapPermissionInstance * * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapPermissionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } /** * Update the SyncMapPermissionInstance * * @param bool $read Whether the identity can read the Sync Map and its Items. Default value is `false`. * @param bool $write Whether the identity can create, update, and delete Items in the Sync Map. Default value is `false`. * @param bool $manage Whether the identity can delete the Sync Map. Default value is `false`. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapPermissionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionList.php 0000644 00000014014 15021223077 0021443 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncMapPermissionList extends ListResource { /** * Construct the SyncMapPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) with the Sync Map Permission resource to delete. Can be the Service's `sid` value or `default`. * @param string $mapSid The SID of the Sync Map with the Sync Map Permission resource to delete. Can be the Sync Map resource's `sid` or its `unique_name`. */ public function __construct( Version $version, string $serviceSid, string $mapSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Permissions'; } /** * Reads SyncMapPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapPermissionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncMapPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncMapPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncMapPermissionPage Page of SyncMapPermissionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncMapPermissionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncMapPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncMapPermissionPage Page of SyncMapPermissionInstance */ public function getPage(string $targetUrl): SyncMapPermissionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapPermissionPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapPermissionContext * * @param string $identity The application-defined string that uniquely identifies the User's Sync Map Permission resource to delete. */ public function getContext( string $identity ): SyncMapPermissionContext { return new SyncMapPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncMapPermissionList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemInstance.php 0000644 00000012554 15021223077 0021051 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $key * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $mapSid * @property string|null $url * @property string|null $revision * @property array|null $data * @property \DateTime|null $dateExpires * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy */ class SyncMapItemInstance extends InstanceResource { /** * Initialize the SyncMapItemInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the Map Item in. * @param string $mapSid The SID of the Sync Map to add the new Map Item to. Can be the Sync Map resource's `sid` or its `unique_name`. * @param string $key The `key` value of the Sync Map Item resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $mapSid, string $key = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'key' => Values::array_get($payload, 'key'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'mapSid' => Values::array_get($payload, 'map_sid'), 'url' => Values::array_get($payload, 'url'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key ?: $this->properties['key'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncMapItemContext Context for this SyncMapItemInstance */ protected function proxy(): SyncMapItemContext { if (!$this->context) { $this->context = new SyncMapItemContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } return $this->context; } /** * Delete the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapItemInstance { return $this->proxy()->fetch(); } /** * Update the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Updated SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncMapItemInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapItemInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemContext.php 0000644 00000010173 15021223077 0020724 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class SyncMapItemContext extends InstanceContext { /** * Initialize the SyncMapItemContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the Map Item in. * @param string $mapSid The SID of the Sync Map to add the new Map Item to. Can be the Sync Map resource's `sid` or its `unique_name`. * @param string $key The `key` value of the Sync Map Item resource to delete. */ public function __construct( Version $version, $serviceSid, $mapSid, $key ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Items/' . \rawurlencode($key) .''; } /** * Delete the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['If-Match' => $options['ifMatch']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapItemInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } /** * Update the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Updated SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncMapItemInstance { $options = new Values($options); $data = Values::of([ 'Data' => Serialize::jsonObject($options['data']), 'Ttl' => $options['ttl'], 'ItemTtl' => $options['itemTtl'], 'CollectionTtl' => $options['collectionTtl'], ]); $headers = Values::of(['If-Match' => $options['ifMatch']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapItemContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemPage.php 0000644 00000003164 15021223077 0020156 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncMapItemPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SyncMapItemInstance \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemInstance */ public function buildInstance(array $payload): SyncMapItemInstance { return new SyncMapItemInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncMapItemPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionPage.php 0000644 00000003230 15021223077 0021402 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncMapPermissionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SyncMapPermissionInstance \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionInstance */ public function buildInstance(array $payload): SyncMapPermissionInstance { return new SyncMapPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.SyncMapPermissionPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/DocumentContext.php 0000644 00000012515 15021223077 0016741 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionList; /** * @property DocumentPermissionList $documentPermissions * @method \Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionContext documentPermissions(string $identity) */ class DocumentContext extends InstanceContext { protected $_documentPermissions; /** * Initialize the DocumentContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the new Document resource in. * @param string $sid The SID of the Document resource to delete. Can be the Document resource's `sid` or its `unique_name`. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Documents/' . \rawurlencode($sid) .''; } /** * Delete the DocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the DocumentInstance * * @return DocumentInstance Fetched DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new DocumentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the DocumentInstance * * @param array|Options $options Optional Arguments * @return DocumentInstance Updated DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DocumentInstance { $options = new Values($options); $data = Values::of([ 'Data' => Serialize::jsonObject($options['data']), 'Ttl' => $options['ttl'], ]); $headers = Values::of(['If-Match' => $options['ifMatch']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new DocumentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the documentPermissions */ protected function getDocumentPermissions(): DocumentPermissionList { if (!$this->_documentPermissions) { $this->_documentPermissions = new DocumentPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_documentPermissions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.DocumentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncListOptions.php 0000644 00000015466 15021223077 0016752 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Options; use Twilio\Values; abstract class SyncListOptions { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * @param int $ttl Alias for collection_ttl. If both are provided, this value is ignored. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. * @return CreateSyncListOptions Options builder */ public static function create( string $uniqueName = Values::NONE, int $ttl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE ): CreateSyncListOptions { return new CreateSyncListOptions( $uniqueName, $ttl, $collectionTtl ); } /** * @param int $ttl An alias for `collection_ttl`. If both are provided, this value is ignored. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. * @return UpdateSyncListOptions Options builder */ public static function update( int $ttl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE ): UpdateSyncListOptions { return new UpdateSyncListOptions( $ttl, $collectionTtl ); } } class CreateSyncListOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * @param int $ttl Alias for collection_ttl. If both are provided, this value is ignored. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. */ public function __construct( string $uniqueName = Values::NONE, int $ttl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Alias for collection_ttl. If both are provided, this value is ignored. * * @param int $ttl Alias for collection_ttl. If both are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.CreateSyncListOptions ' . $options . ']'; } } class UpdateSyncListOptions extends Options { /** * @param int $ttl An alias for `collection_ttl`. If both are provided, this value is ignored. * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. */ public function __construct( int $ttl = Values::INT_NONE, int $collectionTtl = Values::INT_NONE ) { $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `collection_ttl`. If both are provided, this value is ignored. * * @param int $ttl An alias for `collection_ttl`. If both are provided, this value is ignored. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. * * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. * @return $this Fluent Builder */ public function setCollectionTtl(int $collectionTtl): self { $this->options['collectionTtl'] = $collectionTtl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.UpdateSyncListOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamContext.php 0000644 00000011730 15021223077 0017251 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Sync\V1\Service\SyncStream\StreamMessageList; /** * @property StreamMessageList $streamMessages */ class SyncStreamContext extends InstanceContext { protected $_streamMessages; /** * Initialize the SyncStreamContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the new Stream in. * @param string $sid The SID of the Stream resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Streams/' . \rawurlencode($sid) .''; } /** * Delete the SyncStreamInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SyncStreamInstance * * @return SyncStreamInstance Fetched SyncStreamInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncStreamInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncStreamInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the SyncStreamInstance * * @param array|Options $options Optional Arguments * @return SyncStreamInstance Updated SyncStreamInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncStreamInstance { $options = new Values($options); $data = Values::of([ 'Ttl' => $options['ttl'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SyncStreamInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the streamMessages */ protected function getStreamMessages(): StreamMessageList { if (!$this->_streamMessages) { $this->_streamMessages = new StreamMessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_streamMessages; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncStreamContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamInstance.php 0000644 00000012336 15021223077 0017374 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Sync\V1\Service\SyncStream\StreamMessageList; /** * @property string|null $sid * @property string|null $uniqueName * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $url * @property array|null $links * @property \DateTime|null $dateExpires * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy */ class SyncStreamInstance extends InstanceResource { protected $_streamMessages; /** * Initialize the SyncStreamInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) to create the new Stream in. * @param string $sid The SID of the Stream resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncStreamContext Context for this SyncStreamInstance */ protected function proxy(): SyncStreamContext { if (!$this->context) { $this->context = new SyncStreamContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the SyncStreamInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncStreamInstance * * @return SyncStreamInstance Fetched SyncStreamInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncStreamInstance { return $this->proxy()->fetch(); } /** * Update the SyncStreamInstance * * @param array|Options $options Optional Arguments * @return SyncStreamInstance Updated SyncStreamInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SyncStreamInstance { return $this->proxy()->update($options); } /** * Access the streamMessages */ protected function getStreamMessages(): StreamMessageList { return $this->proxy()->streamMessages; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncStreamInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/ServiceInstance.php 0000644 00000014212 15021223077 0015277 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Sync\V1\Service\SyncListList; use Twilio\Rest\Sync\V1\Service\SyncStreamList; use Twilio\Rest\Sync\V1\Service\DocumentList; use Twilio\Rest\Sync\V1\Service\SyncMapList; /** * @property string|null $sid * @property string|null $uniqueName * @property string|null $accountSid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property string|null $webhookUrl * @property bool|null $webhooksFromRestEnabled * @property bool|null $reachabilityWebhooksEnabled * @property bool|null $aclEnabled * @property bool|null $reachabilityDebouncingEnabled * @property int|null $reachabilityDebouncingWindow * @property array|null $links */ class ServiceInstance extends InstanceResource { protected $_syncLists; protected $_syncStreams; protected $_documents; protected $_syncMaps; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Service resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'webhooksFromRestEnabled' => Values::array_get($payload, 'webhooks_from_rest_enabled'), 'reachabilityWebhooksEnabled' => Values::array_get($payload, 'reachability_webhooks_enabled'), 'aclEnabled' => Values::array_get($payload, 'acl_enabled'), 'reachabilityDebouncingEnabled' => Values::array_get($payload, 'reachability_debouncing_enabled'), 'reachabilityDebouncingWindow' => Values::array_get($payload, 'reachability_debouncing_window'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the syncLists */ protected function getSyncLists(): SyncListList { return $this->proxy()->syncLists; } /** * Access the syncStreams */ protected function getSyncStreams(): SyncStreamList { return $this->proxy()->syncStreams; } /** * Access the documents */ protected function getDocuments(): DocumentList { return $this->proxy()->documents; } /** * Access the syncMaps */ protected function getSyncMaps(): SyncMapList { return $this->proxy()->syncMaps; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/ServiceList.php 0000644 00000014606 15021223077 0014455 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'WebhookUrl' => $options['webhookUrl'], 'ReachabilityWebhooksEnabled' => Serialize::booleanToString($options['reachabilityWebhooksEnabled']), 'AclEnabled' => Serialize::booleanToString($options['aclEnabled']), 'ReachabilityDebouncingEnabled' => Serialize::booleanToString($options['reachabilityDebouncingEnabled']), 'ReachabilityDebouncingWindow' => $options['reachabilityDebouncingWindow'], 'WebhooksFromRestEnabled' => Serialize::booleanToString($options['webhooksFromRestEnabled']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The SID of the Service resource to delete. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Sync/V1/ServiceOptions.php 0000644 00000047302 15021223077 0015174 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param string $friendlyName A string that you assign to describe the resource. * @param string $webhookUrl The URL we should call when Sync objects are manipulated. * @param bool $reachabilityWebhooksEnabled Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. * @param bool $aclEnabled Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. * @param bool $reachabilityDebouncingEnabled Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. * @param int $reachabilityDebouncingWindow The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the `webhook_url` is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the call to `webhook_url`. * @param bool $webhooksFromRestEnabled Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. * @return CreateServiceOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $webhookUrl = Values::NONE, bool $reachabilityWebhooksEnabled = Values::BOOL_NONE, bool $aclEnabled = Values::BOOL_NONE, bool $reachabilityDebouncingEnabled = Values::BOOL_NONE, int $reachabilityDebouncingWindow = Values::INT_NONE, bool $webhooksFromRestEnabled = Values::BOOL_NONE ): CreateServiceOptions { return new CreateServiceOptions( $friendlyName, $webhookUrl, $reachabilityWebhooksEnabled, $aclEnabled, $reachabilityDebouncingEnabled, $reachabilityDebouncingWindow, $webhooksFromRestEnabled ); } /** * @param string $webhookUrl The URL we should call when Sync objects are manipulated. * @param string $friendlyName A string that you assign to describe the resource. * @param bool $reachabilityWebhooksEnabled Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. * @param bool $aclEnabled Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. * @param bool $reachabilityDebouncingEnabled Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. * @param int $reachabilityDebouncingWindow The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. * @param bool $webhooksFromRestEnabled Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. * @return UpdateServiceOptions Options builder */ public static function update( string $webhookUrl = Values::NONE, string $friendlyName = Values::NONE, bool $reachabilityWebhooksEnabled = Values::BOOL_NONE, bool $aclEnabled = Values::BOOL_NONE, bool $reachabilityDebouncingEnabled = Values::BOOL_NONE, int $reachabilityDebouncingWindow = Values::INT_NONE, bool $webhooksFromRestEnabled = Values::BOOL_NONE ): UpdateServiceOptions { return new UpdateServiceOptions( $webhookUrl, $friendlyName, $reachabilityWebhooksEnabled, $aclEnabled, $reachabilityDebouncingEnabled, $reachabilityDebouncingWindow, $webhooksFromRestEnabled ); } } class CreateServiceOptions extends Options { /** * @param string $friendlyName A string that you assign to describe the resource. * @param string $webhookUrl The URL we should call when Sync objects are manipulated. * @param bool $reachabilityWebhooksEnabled Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. * @param bool $aclEnabled Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. * @param bool $reachabilityDebouncingEnabled Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. * @param int $reachabilityDebouncingWindow The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the `webhook_url` is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the call to `webhook_url`. * @param bool $webhooksFromRestEnabled Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. */ public function __construct( string $friendlyName = Values::NONE, string $webhookUrl = Values::NONE, bool $reachabilityWebhooksEnabled = Values::BOOL_NONE, bool $aclEnabled = Values::BOOL_NONE, bool $reachabilityDebouncingEnabled = Values::BOOL_NONE, int $reachabilityDebouncingWindow = Values::INT_NONE, bool $webhooksFromRestEnabled = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['webhookUrl'] = $webhookUrl; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; } /** * A string that you assign to describe the resource. * * @param string $friendlyName A string that you assign to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The URL we should call when Sync objects are manipulated. * * @param string $webhookUrl The URL we should call when Sync objects are manipulated. * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. * * @param bool $reachabilityWebhooksEnabled Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. * * @param bool $aclEnabled Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. * @return $this Fluent Builder */ public function setAclEnabled(bool $aclEnabled): self { $this->options['aclEnabled'] = $aclEnabled; return $this; } /** * Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. * * @param bool $reachabilityDebouncingEnabled Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. * @return $this Fluent Builder */ public function setReachabilityDebouncingEnabled(bool $reachabilityDebouncingEnabled): self { $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; return $this; } /** * The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the `webhook_url` is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the call to `webhook_url`. * * @param int $reachabilityDebouncingWindow The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the `webhook_url` is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the call to `webhook_url`. * @return $this Fluent Builder */ public function setReachabilityDebouncingWindow(int $reachabilityDebouncingWindow): self { $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; return $this; } /** * Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. * * @param bool $webhooksFromRestEnabled Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. * @return $this Fluent Builder */ public function setWebhooksFromRestEnabled(bool $webhooksFromRestEnabled): self { $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.CreateServiceOptions ' . $options . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $webhookUrl The URL we should call when Sync objects are manipulated. * @param string $friendlyName A string that you assign to describe the resource. * @param bool $reachabilityWebhooksEnabled Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. * @param bool $aclEnabled Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. * @param bool $reachabilityDebouncingEnabled Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. * @param int $reachabilityDebouncingWindow The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. * @param bool $webhooksFromRestEnabled Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. */ public function __construct( string $webhookUrl = Values::NONE, string $friendlyName = Values::NONE, bool $reachabilityWebhooksEnabled = Values::BOOL_NONE, bool $aclEnabled = Values::BOOL_NONE, bool $reachabilityDebouncingEnabled = Values::BOOL_NONE, int $reachabilityDebouncingWindow = Values::INT_NONE, bool $webhooksFromRestEnabled = Values::BOOL_NONE ) { $this->options['webhookUrl'] = $webhookUrl; $this->options['friendlyName'] = $friendlyName; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; } /** * The URL we should call when Sync objects are manipulated. * * @param string $webhookUrl The URL we should call when Sync objects are manipulated. * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * A string that you assign to describe the resource. * * @param string $friendlyName A string that you assign to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. * * @param bool $reachabilityWebhooksEnabled Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. * * @param bool $aclEnabled Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. * @return $this Fluent Builder */ public function setAclEnabled(bool $aclEnabled): self { $this->options['aclEnabled'] = $aclEnabled; return $this; } /** * Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. * * @param bool $reachabilityDebouncingEnabled Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. * @return $this Fluent Builder */ public function setReachabilityDebouncingEnabled(bool $reachabilityDebouncingEnabled): self { $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; return $this; } /** * The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. * * @param int $reachabilityDebouncingWindow The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. * @return $this Fluent Builder */ public function setReachabilityDebouncingWindow(int $reachabilityDebouncingWindow): self { $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; return $this; } /** * Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. * * @param bool $webhooksFromRestEnabled Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. * @return $this Fluent Builder */ public function setWebhooksFromRestEnabled(bool $webhooksFromRestEnabled): self { $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Sync.V1.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Sync/V1/ServiceContext.php 0000644 00000015340 15021223077 0015162 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Sync\V1\Service\SyncListList; use Twilio\Rest\Sync\V1\Service\SyncStreamList; use Twilio\Rest\Sync\V1\Service\DocumentList; use Twilio\Rest\Sync\V1\Service\SyncMapList; /** * @property SyncListList $syncLists * @property SyncStreamList $syncStreams * @property DocumentList $documents * @property SyncMapList $syncMaps * @method \Twilio\Rest\Sync\V1\Service\SyncStreamContext syncStreams(string $sid) * @method \Twilio\Rest\Sync\V1\Service\SyncListContext syncLists(string $sid) * @method \Twilio\Rest\Sync\V1\Service\SyncMapContext syncMaps(string $sid) * @method \Twilio\Rest\Sync\V1\Service\DocumentContext documents(string $sid) */ class ServiceContext extends InstanceContext { protected $_syncLists; protected $_syncStreams; protected $_documents; protected $_syncMaps; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Service resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) .''; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'WebhookUrl' => $options['webhookUrl'], 'FriendlyName' => $options['friendlyName'], 'ReachabilityWebhooksEnabled' => Serialize::booleanToString($options['reachabilityWebhooksEnabled']), 'AclEnabled' => Serialize::booleanToString($options['aclEnabled']), 'ReachabilityDebouncingEnabled' => Serialize::booleanToString($options['reachabilityDebouncingEnabled']), 'ReachabilityDebouncingWindow' => $options['reachabilityDebouncingWindow'], 'WebhooksFromRestEnabled' => Serialize::booleanToString($options['webhooksFromRestEnabled']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the syncLists */ protected function getSyncLists(): SyncListList { if (!$this->_syncLists) { $this->_syncLists = new SyncListList( $this->version, $this->solution['sid'] ); } return $this->_syncLists; } /** * Access the syncStreams */ protected function getSyncStreams(): SyncStreamList { if (!$this->_syncStreams) { $this->_syncStreams = new SyncStreamList( $this->version, $this->solution['sid'] ); } return $this->_syncStreams; } /** * Access the documents */ protected function getDocuments(): DocumentList { if (!$this->_documents) { $this->_documents = new DocumentList( $this->version, $this->solution['sid'] ); } return $this->_documents; } /** * Access the syncMaps */ protected function getSyncMaps(): SyncMapList { if (!$this->_syncMaps) { $this->_syncMaps = new SyncMapList( $this->version, $this->solution['sid'] ); } return $this->_syncMaps; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/ServicePage.php 0000644 00000003002 15021223077 0014402 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ServiceInstance \Twilio\Rest\Sync\V1\ServiceInstance */ public function buildInstance(array $payload): ServiceInstance { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1.ServicePage]'; } } sdk/src/Twilio/Rest/Sync/V1.php 0000644 00000005051 15021223077 0012213 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Sync * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Sync; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Sync\V1\ServiceList; use Twilio\Version; /** * @property ServiceList $services * @method \Twilio\Rest\Sync\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_services; /** * Construct the V1 version of Sync * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getServices(): ServiceList { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Sync.V1]'; } } sdk/src/Twilio/Rest/FrontlineApi.php 0000644 00000001257 15021223077 0013407 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\FrontlineApi\V1; class FrontlineApi extends FrontlineApiBase { /** * @deprecated Use v1->users instead. */ protected function getUsers(): \Twilio\Rest\FrontlineApi\V1\UserList { echo "users is deprecated. Use v1->users instead."; return $this->v1->users; } /** * @deprecated Use v1->users(\$sid) instead. * @param string $sid The SID of the User resource to fetch */ protected function contextUsers(string $sid): \Twilio\Rest\FrontlineApi\V1\UserContext { echo "users(\$sid) is deprecated. Use v1->users(\$sid) instead."; return $this->v1->users($sid); } } sdk/src/Twilio/Rest/Routes/V2/PhoneNumberInstance.php 0000644 00000010447 15021223077 0016475 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $phoneNumber * @property string|null $url * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string|null $voiceRegion * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $phoneNumber The phone number in E.164 format */ public function __construct(Version $version, array $payload, string $phoneNumber = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'url' => Values::array_get($payload, 'url'), 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'voiceRegion' => Values::array_get($payload, 'voice_region'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['phoneNumber' => $phoneNumber ?: $this->properties['phoneNumber'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PhoneNumberContext Context for this PhoneNumberInstance */ protected function proxy(): PhoneNumberContext { if (!$this->context) { $this->context = new PhoneNumberContext( $this->version, $this->solution['phoneNumber'] ); } return $this->context; } /** * Fetch the PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PhoneNumberInstance { return $this->proxy()->fetch(); } /** * Update the PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Updated PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): PhoneNumberInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Routes.V2.PhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Routes/V2/TrunkContext.php 0000644 00000005361 15021223077 0015235 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes\V2; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class TrunkContext extends InstanceContext { /** * Initialize the TrunkContext * * @param Version $version Version that contains the resource * @param string $sipTrunkDomain The absolute URL of the SIP Trunk */ public function __construct( Version $version, $sipTrunkDomain ) { parent::__construct($version); // Path Solution $this->solution = [ 'sipTrunkDomain' => $sipTrunkDomain, ]; $this->uri = '/Trunks/' . \rawurlencode($sipTrunkDomain) .''; } /** * Fetch the TrunkInstance * * @return TrunkInstance Fetched TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrunkInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new TrunkInstance( $this->version, $payload, $this->solution['sipTrunkDomain'] ); } /** * Update the TrunkInstance * * @param array|Options $options Optional Arguments * @return TrunkInstance Updated TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TrunkInstance { $options = new Values($options); $data = Values::of([ 'VoiceRegion' => $options['voiceRegion'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new TrunkInstance( $this->version, $payload, $this->solution['sipTrunkDomain'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Routes.V2.TrunkContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Routes/V2/SipDomainOptions.php 0000644 00000004334 15021223077 0016023 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes\V2; use Twilio\Options; use Twilio\Values; abstract class SipDomainOptions { /** * @param string $voiceRegion * @param string $friendlyName * @return UpdateSipDomainOptions Options builder */ public static function update( string $voiceRegion = Values::NONE, string $friendlyName = Values::NONE ): UpdateSipDomainOptions { return new UpdateSipDomainOptions( $voiceRegion, $friendlyName ); } } class UpdateSipDomainOptions extends Options { /** * @param string $voiceRegion * @param string $friendlyName */ public function __construct( string $voiceRegion = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['voiceRegion'] = $voiceRegion; $this->options['friendlyName'] = $friendlyName; } /** * * * @param string $voiceRegion * @return $this Fluent Builder */ public function setVoiceRegion(string $voiceRegion): self { $this->options['voiceRegion'] = $voiceRegion; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Routes.V2.UpdateSipDomainOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Routes/V2/PhoneNumberPage.php 0000644 00000003042 15021223077 0015576 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PhoneNumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return PhoneNumberInstance \Twilio\Rest\Routes\V2\PhoneNumberInstance */ public function buildInstance(array $payload): PhoneNumberInstance { return new PhoneNumberInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Routes.V2.PhoneNumberPage]'; } } sdk/src/Twilio/Rest/Routes/V2/SipDomainInstance.php 0000644 00000010327 15021223077 0016133 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sipDomain * @property string|null $url * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string|null $voiceRegion * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class SipDomainInstance extends InstanceResource { /** * Initialize the SipDomainInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sipDomain */ public function __construct(Version $version, array $payload, string $sipDomain = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sipDomain' => Values::array_get($payload, 'sip_domain'), 'url' => Values::array_get($payload, 'url'), 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'voiceRegion' => Values::array_get($payload, 'voice_region'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['sipDomain' => $sipDomain ?: $this->properties['sipDomain'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SipDomainContext Context for this SipDomainInstance */ protected function proxy(): SipDomainContext { if (!$this->context) { $this->context = new SipDomainContext( $this->version, $this->solution['sipDomain'] ); } return $this->context; } /** * Fetch the SipDomainInstance * * @return SipDomainInstance Fetched SipDomainInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SipDomainInstance { return $this->proxy()->fetch(); } /** * Update the SipDomainInstance * * @param array|Options $options Optional Arguments * @return SipDomainInstance Updated SipDomainInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SipDomainInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Routes.V2.SipDomainInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Routes/V2/PhoneNumberOptions.php 0000644 00000005374 15021223077 0016367 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes\V2; use Twilio\Options; use Twilio\Values; abstract class PhoneNumberOptions { /** * @param string $voiceRegion The Inbound Processing Region used for this phone number for voice * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @return UpdatePhoneNumberOptions Options builder */ public static function update( string $voiceRegion = Values::NONE, string $friendlyName = Values::NONE ): UpdatePhoneNumberOptions { return new UpdatePhoneNumberOptions( $voiceRegion, $friendlyName ); } } class UpdatePhoneNumberOptions extends Options { /** * @param string $voiceRegion The Inbound Processing Region used for this phone number for voice * @param string $friendlyName A human readable description of this resource, up to 64 characters. */ public function __construct( string $voiceRegion = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['voiceRegion'] = $voiceRegion; $this->options['friendlyName'] = $friendlyName; } /** * The Inbound Processing Region used for this phone number for voice * * @param string $voiceRegion The Inbound Processing Region used for this phone number for voice * @return $this Fluent Builder */ public function setVoiceRegion(string $voiceRegion): self { $this->options['voiceRegion'] = $voiceRegion; return $this; } /** * A human readable description of this resource, up to 64 characters. * * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Routes.V2.UpdatePhoneNumberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Routes/V2/PhoneNumberContext.php 0000644 00000005457 15021223077 0016362 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes\V2; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class PhoneNumberContext extends InstanceContext { /** * Initialize the PhoneNumberContext * * @param Version $version Version that contains the resource * @param string $phoneNumber The phone number in E.164 format */ public function __construct( Version $version, $phoneNumber ) { parent::__construct($version); // Path Solution $this->solution = [ 'phoneNumber' => $phoneNumber, ]; $this->uri = '/PhoneNumbers/' . \rawurlencode($phoneNumber) .''; } /** * Fetch the PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PhoneNumberInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new PhoneNumberInstance( $this->version, $payload, $this->solution['phoneNumber'] ); } /** * Update the PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Updated PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): PhoneNumberInstance { $options = new Values($options); $data = Values::of([ 'VoiceRegion' => $options['voiceRegion'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new PhoneNumberInstance( $this->version, $payload, $this->solution['phoneNumber'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Routes.V2.PhoneNumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Routes/V2/PhoneNumberList.php 0000644 00000002735 15021223077 0015645 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes\V2; use Twilio\ListResource; use Twilio\Version; class PhoneNumberList extends ListResource { /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a PhoneNumberContext * * @param string $phoneNumber The phone number in E.164 format */ public function getContext( string $phoneNumber ): PhoneNumberContext { return new PhoneNumberContext( $this->version, $phoneNumber ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Routes.V2.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Routes/V2/SipDomainList.php 0000644 00000002653 15021223077 0015305 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes\V2; use Twilio\ListResource; use Twilio\Version; class SipDomainList extends ListResource { /** * Construct the SipDomainList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a SipDomainContext * * @param string $sipDomain */ public function getContext( string $sipDomain ): SipDomainContext { return new SipDomainContext( $this->version, $sipDomain ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Routes.V2.SipDomainList]'; } } sdk/src/Twilio/Rest/Routes/V2/SipDomainPage.php 0000644 00000003026 15021223077 0015241 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SipDomainPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SipDomainInstance \Twilio\Rest\Routes\V2\SipDomainInstance */ public function buildInstance(array $payload): SipDomainInstance { return new SipDomainInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Routes.V2.SipDomainPage]'; } } sdk/src/Twilio/Rest/Routes/V2/SipDomainContext.php 0000644 00000005345 15021223077 0016017 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes\V2; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class SipDomainContext extends InstanceContext { /** * Initialize the SipDomainContext * * @param Version $version Version that contains the resource * @param string $sipDomain */ public function __construct( Version $version, $sipDomain ) { parent::__construct($version); // Path Solution $this->solution = [ 'sipDomain' => $sipDomain, ]; $this->uri = '/SipDomains/' . \rawurlencode($sipDomain) .''; } /** * Fetch the SipDomainInstance * * @return SipDomainInstance Fetched SipDomainInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SipDomainInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SipDomainInstance( $this->version, $payload, $this->solution['sipDomain'] ); } /** * Update the SipDomainInstance * * @param array|Options $options Optional Arguments * @return SipDomainInstance Updated SipDomainInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SipDomainInstance { $options = new Values($options); $data = Values::of([ 'VoiceRegion' => $options['voiceRegion'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SipDomainInstance( $this->version, $payload, $this->solution['sipDomain'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Routes.V2.SipDomainContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Routes/V2/TrunkInstance.php 0000644 00000010352 15021223077 0015351 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sipTrunkDomain * @property string|null $url * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string|null $voiceRegion * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class TrunkInstance extends InstanceResource { /** * Initialize the TrunkInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sipTrunkDomain The absolute URL of the SIP Trunk */ public function __construct(Version $version, array $payload, string $sipTrunkDomain = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sipTrunkDomain' => Values::array_get($payload, 'sip_trunk_domain'), 'url' => Values::array_get($payload, 'url'), 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'voiceRegion' => Values::array_get($payload, 'voice_region'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['sipTrunkDomain' => $sipTrunkDomain ?: $this->properties['sipTrunkDomain'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TrunkContext Context for this TrunkInstance */ protected function proxy(): TrunkContext { if (!$this->context) { $this->context = new TrunkContext( $this->version, $this->solution['sipTrunkDomain'] ); } return $this->context; } /** * Fetch the TrunkInstance * * @return TrunkInstance Fetched TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrunkInstance { return $this->proxy()->fetch(); } /** * Update the TrunkInstance * * @param array|Options $options Optional Arguments * @return TrunkInstance Updated TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TrunkInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Routes.V2.TrunkInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Routes/V2/TrunkOptions.php 0000644 00000005314 15021223077 0015242 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes\V2; use Twilio\Options; use Twilio\Values; abstract class TrunkOptions { /** * @param string $voiceRegion The Inbound Processing Region used for this SIP Trunk for voice * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @return UpdateTrunkOptions Options builder */ public static function update( string $voiceRegion = Values::NONE, string $friendlyName = Values::NONE ): UpdateTrunkOptions { return new UpdateTrunkOptions( $voiceRegion, $friendlyName ); } } class UpdateTrunkOptions extends Options { /** * @param string $voiceRegion The Inbound Processing Region used for this SIP Trunk for voice * @param string $friendlyName A human readable description of this resource, up to 64 characters. */ public function __construct( string $voiceRegion = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['voiceRegion'] = $voiceRegion; $this->options['friendlyName'] = $friendlyName; } /** * The Inbound Processing Region used for this SIP Trunk for voice * * @param string $voiceRegion The Inbound Processing Region used for this SIP Trunk for voice * @return $this Fluent Builder */ public function setVoiceRegion(string $voiceRegion): self { $this->options['voiceRegion'] = $voiceRegion; return $this; } /** * A human readable description of this resource, up to 64 characters. * * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Routes.V2.UpdateTrunkOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Routes/V2/TrunkPage.php 0000644 00000002776 15021223077 0014474 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TrunkPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TrunkInstance \Twilio\Rest\Routes\V2\TrunkInstance */ public function buildInstance(array $payload): TrunkInstance { return new TrunkInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Routes.V2.TrunkPage]'; } } sdk/src/Twilio/Rest/Routes/V2/TrunkList.php 0000644 00000002703 15021223077 0014521 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes\V2; use Twilio\ListResource; use Twilio\Version; class TrunkList extends ListResource { /** * Construct the TrunkList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a TrunkContext * * @param string $sipTrunkDomain The absolute URL of the SIP Trunk */ public function getContext( string $sipTrunkDomain ): TrunkContext { return new TrunkContext( $this->version, $sipTrunkDomain ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Routes.V2.TrunkList]'; } } sdk/src/Twilio/Rest/Routes/V2.php 0000644 00000006530 15021223077 0012564 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Routes * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Routes; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Routes\V2\PhoneNumberList; use Twilio\Rest\Routes\V2\SipDomainList; use Twilio\Rest\Routes\V2\TrunkList; use Twilio\Version; /** * @property PhoneNumberList $phoneNumbers * @property SipDomainList $sipDomains * @property TrunkList $trunks * @method \Twilio\Rest\Routes\V2\PhoneNumberContext phoneNumbers(string $phoneNumber) * @method \Twilio\Rest\Routes\V2\SipDomainContext sipDomains(string $sipDomain) * @method \Twilio\Rest\Routes\V2\TrunkContext trunks(string $sipTrunkDomain) */ class V2 extends Version { protected $_phoneNumbers; protected $_sipDomains; protected $_trunks; /** * Construct the V2 version of Routes * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v2'; } protected function getPhoneNumbers(): PhoneNumberList { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList($this); } return $this->_phoneNumbers; } protected function getSipDomains(): SipDomainList { if (!$this->_sipDomains) { $this->_sipDomains = new SipDomainList($this); } return $this->_sipDomains; } protected function getTrunks(): TrunkList { if (!$this->_trunks) { $this->_trunks = new TrunkList($this); } return $this->_trunks; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Routes.V2]'; } } sdk/src/Twilio/Rest/Bulkexports.php 0000644 00000003252 15021223077 0013334 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Bulkexports\V1; class Bulkexports extends BulkexportsBase { /** * @deprecated Use v1->exports instead. */ protected function getExports(): \Twilio\Rest\Bulkexports\V1\ExportList { echo "exports is deprecated. Use v1->exports instead."; return $this->v1->exports; } /** * @deprecated Use v1->exports(\$resourceType) instead. * @param string $resourceType The type of communication – Messages, Calls, * Conferences, and Participants */ protected function contextExports(string $resourceType): \Twilio\Rest\Bulkexports\V1\ExportContext { echo "exports(\$resourceType) is deprecated. Use v1->exports(\$resourceType) instead."; return $this->v1->exports($resourceType); } /** * @deprecated Use v1->exportConfiguration instead. */ protected function getExportConfiguration(): \Twilio\Rest\Bulkexports\V1\ExportConfigurationList { echo "exportConfiguration is deprecated. Use v1->exportConfiguration instead."; return $this->v1->exportConfiguration; } /** * @deprecated Use v1->exportConfiguration(\$resourceType) instead. * @param string $resourceType The type of communication – Messages, Calls, * Conferences, and Participants */ protected function contextExportConfiguration(string $resourceType): \Twilio\Rest\Bulkexports\V1\ExportConfigurationContext { echo "rexportConfiguration(\$resourceType) is deprecated. Use v1->exportConfiguration(\$resourceType) instead."; return $this->v1->exportConfiguration($resourceType); } } sdk/src/Twilio/Rest/Video/V1/RecordingSettingsInstance.php 0000644 00000010540 15021223077 0017466 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $friendlyName * @property string|null $awsCredentialsSid * @property string|null $awsS3Url * @property bool|null $awsStorageEnabled * @property string|null $encryptionKeySid * @property bool|null $encryptionEnabled * @property string|null $url */ class RecordingSettingsInstance extends InstanceResource { /** * Initialize the RecordingSettingsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'awsCredentialsSid' => Values::array_get($payload, 'aws_credentials_sid'), 'awsS3Url' => Values::array_get($payload, 'aws_s3_url'), 'awsStorageEnabled' => Values::array_get($payload, 'aws_storage_enabled'), 'encryptionKeySid' => Values::array_get($payload, 'encryption_key_sid'), 'encryptionEnabled' => Values::array_get($payload, 'encryption_enabled'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = []; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RecordingSettingsContext Context for this RecordingSettingsInstance */ protected function proxy(): RecordingSettingsContext { if (!$this->context) { $this->context = new RecordingSettingsContext( $this->version ); } return $this->context; } /** * Create the RecordingSettingsInstance * * @param string $friendlyName A descriptive string that you create to describe the resource and be shown to users in the console * @param array|Options $options Optional Arguments * @return RecordingSettingsInstance Created RecordingSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): RecordingSettingsInstance { return $this->proxy()->create($friendlyName, $options); } /** * Fetch the RecordingSettingsInstance * * @return RecordingSettingsInstance Fetched RecordingSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingSettingsInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RecordingSettingsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingOptions.php 0000644 00000015302 15021223077 0015635 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; abstract class RecordingOptions { /** * @param string $status Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. * @param string $sourceSid Read only the recordings that have this `source_sid`. * @param string[] $groupingSid Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. * @param \DateTime $dateCreatedAfter Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. * @param \DateTime $dateCreatedBefore Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. * @param string $mediaType Read only recordings that have this media type. Can be either `audio` or `video`. * @return ReadRecordingOptions Options builder */ public static function read( string $status = Values::NONE, string $sourceSid = Values::NONE, array $groupingSid = Values::ARRAY_NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null, string $mediaType = Values::NONE ): ReadRecordingOptions { return new ReadRecordingOptions( $status, $sourceSid, $groupingSid, $dateCreatedAfter, $dateCreatedBefore, $mediaType ); } } class ReadRecordingOptions extends Options { /** * @param string $status Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. * @param string $sourceSid Read only the recordings that have this `source_sid`. * @param string[] $groupingSid Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. * @param \DateTime $dateCreatedAfter Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. * @param \DateTime $dateCreatedBefore Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. * @param string $mediaType Read only recordings that have this media type. Can be either `audio` or `video`. */ public function __construct( string $status = Values::NONE, string $sourceSid = Values::NONE, array $groupingSid = Values::ARRAY_NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null, string $mediaType = Values::NONE ) { $this->options['status'] = $status; $this->options['sourceSid'] = $sourceSid; $this->options['groupingSid'] = $groupingSid; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['mediaType'] = $mediaType; } /** * Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. * * @param string $status Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Read only the recordings that have this `source_sid`. * * @param string $sourceSid Read only the recordings that have this `source_sid`. * @return $this Fluent Builder */ public function setSourceSid(string $sourceSid): self { $this->options['sourceSid'] = $sourceSid; return $this; } /** * Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. * * @param string[] $groupingSid Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. * @return $this Fluent Builder */ public function setGroupingSid(array $groupingSid): self { $this->options['groupingSid'] = $groupingSid; return $this; } /** * Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. * * @param \DateTime $dateCreatedAfter Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. * * @param \DateTime $dateCreatedBefore Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Read only recordings that have this media type. Can be either `audio` or `video`. * * @param string $mediaType Read only recordings that have this media type. Can be either `audio` or `video`. * @return $this Fluent Builder */ public function setMediaType(string $mediaType): self { $this->options['mediaType'] = $mediaType; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.ReadRecordingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingSettingsContext.php 0000644 00000006227 15021223077 0017355 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class RecordingSettingsContext extends InstanceContext { /** * Initialize the RecordingSettingsContext * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/RecordingSettings/Default'; } /** * Create the RecordingSettingsInstance * * @param string $friendlyName A descriptive string that you create to describe the resource and be shown to users in the console * @param array|Options $options Optional Arguments * @return RecordingSettingsInstance Created RecordingSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): RecordingSettingsInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'AwsCredentialsSid' => $options['awsCredentialsSid'], 'EncryptionKeySid' => $options['encryptionKeySid'], 'AwsS3Url' => $options['awsS3Url'], 'AwsStorageEnabled' => Serialize::booleanToString($options['awsStorageEnabled']), 'EncryptionEnabled' => Serialize::booleanToString($options['encryptionEnabled']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RecordingSettingsInstance( $this->version, $payload ); } /** * Fetch the RecordingSettingsInstance * * @return RecordingSettingsInstance Fetched RecordingSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingSettingsInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RecordingSettingsInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RecordingSettingsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RoomList.php 0000644 00000016653 15021223077 0014127 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class RoomList extends ListResource { /** * Construct the RoomList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Rooms'; } /** * Create the RoomInstance * * @param array|Options $options Optional Arguments * @return RoomInstance Created RoomInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): RoomInstance { $options = new Values($options); $data = Values::of([ 'EnableTurn' => Serialize::booleanToString($options['enableTurn']), 'Type' => $options['type'], 'UniqueName' => $options['uniqueName'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'MaxParticipants' => $options['maxParticipants'], 'RecordParticipantsOnConnect' => Serialize::booleanToString($options['recordParticipantsOnConnect']), 'VideoCodecs' => $options['videoCodecs'], 'MediaRegion' => $options['mediaRegion'], 'RecordingRules' => Serialize::jsonObject($options['recordingRules']), 'AudioOnly' => Serialize::booleanToString($options['audioOnly']), 'MaxParticipantDuration' => $options['maxParticipantDuration'], 'EmptyRoomTimeout' => $options['emptyRoomTimeout'], 'UnusedRoomTimeout' => $options['unusedRoomTimeout'], 'LargeRoom' => Serialize::booleanToString($options['largeRoom']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoomInstance( $this->version, $payload ); } /** * Reads RoomInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoomInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RoomInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoomInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RoomPage Page of RoomInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RoomPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'UniqueName' => $options['uniqueName'], 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RoomPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoomInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RoomPage Page of RoomInstance */ public function getPage(string $targetUrl): RoomPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RoomPage($this->version, $response, $this->solution); } /** * Constructs a RoomContext * * @param string $sid The SID of the Room resource to fetch. */ public function getContext( string $sid ): RoomContext { return new RoomContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.RoomList]'; } } sdk/src/Twilio/Rest/Video/V1/RecordingPage.php 0000644 00000003022 15021223077 0015052 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RecordingInstance \Twilio\Rest\Video\V1\RecordingInstance */ public function buildInstance(array $payload): RecordingInstance { return new RecordingInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.RecordingPage]'; } } sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesPage.php 0000644 00000003126 15021223077 0017006 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordingRulesPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RecordingRulesInstance \Twilio\Rest\Video\V1\Room\RecordingRulesInstance */ public function buildInstance(array $payload): RecordingRulesInstance { return new RecordingRulesInstance($this->version, $payload, $this->solution['roomSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.RecordingRulesPage]'; } } sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesInstance.php 0000644 00000005023 15021223077 0017674 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $roomSid * @property string[]|null $rules * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class RecordingRulesInstance extends InstanceResource { /** * Initialize the RecordingRulesInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the Room resource where the recording rules to fetch apply. */ public function __construct(Version $version, array $payload, string $roomSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'roomSid' => Values::array_get($payload, 'room_sid'), 'rules' => Values::array_get($payload, 'rules'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['roomSid' => $roomSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.RecordingRulesInstance]'; } } sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesList.php 0000644 00000005243 15021223077 0017047 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class RecordingRulesList extends ListResource { /** * Construct the RecordingRulesList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource where the recording rules to fetch apply. */ public function __construct( Version $version, string $roomSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'roomSid' => $roomSid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/RecordingRules'; } /** * Fetch the RecordingRulesInstance * * @return RecordingRulesInstance Fetched RecordingRulesInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingRulesInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RecordingRulesInstance( $this->version, $payload, $this->solution['roomSid'] ); } /** * Update the RecordingRulesInstance * * @param array|Options $options Optional Arguments * @return RecordingRulesInstance Updated RecordingRulesInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): RecordingRulesInstance { $options = new Values($options); $data = Values::of([ 'Rules' => Serialize::jsonObject($options['rules']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RecordingRulesInstance( $this->version, $payload, $this->solution['roomSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.RecordingRulesList]'; } } sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingInstance.php 0000644 00000012250 15021223077 0017516 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string $status * @property \DateTime|null $dateCreated * @property string|null $sid * @property string|null $sourceSid * @property int|null $size * @property string|null $url * @property string $type * @property int|null $duration * @property string $containerFormat * @property string $codec * @property array|null $groupingSids * @property string|null $trackName * @property int|null $offset * @property string|null $mediaExternalLocation * @property string|null $roomSid * @property array|null $links */ class RoomRecordingInstance extends InstanceResource { /** * Initialize the RoomRecordingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the room with the RoomRecording resource to delete. * @param string $sid The SID of the RoomRecording resource to delete. */ public function __construct(Version $version, array $payload, string $roomSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'sid' => Values::array_get($payload, 'sid'), 'sourceSid' => Values::array_get($payload, 'source_sid'), 'size' => Values::array_get($payload, 'size'), 'url' => Values::array_get($payload, 'url'), 'type' => Values::array_get($payload, 'type'), 'duration' => Values::array_get($payload, 'duration'), 'containerFormat' => Values::array_get($payload, 'container_format'), 'codec' => Values::array_get($payload, 'codec'), 'groupingSids' => Values::array_get($payload, 'grouping_sids'), 'trackName' => Values::array_get($payload, 'track_name'), 'offset' => Values::array_get($payload, 'offset'), 'mediaExternalLocation' => Values::array_get($payload, 'media_external_location'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['roomSid' => $roomSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoomRecordingContext Context for this RoomRecordingInstance */ protected function proxy(): RoomRecordingContext { if (!$this->context) { $this->context = new RoomRecordingContext( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RoomRecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RoomRecordingInstance * * @return RoomRecordingInstance Fetched RoomRecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoomRecordingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RoomRecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/ParticipantOptions.php 0000644 00000014712 15021223077 0017117 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Options; use Twilio\Values; abstract class ParticipantOptions { /** * @param string $status Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. * @param string $identity Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. * @param \DateTime $dateCreatedAfter Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. * @param \DateTime $dateCreatedBefore Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. * @return ReadParticipantOptions Options builder */ public static function read( string $status = Values::NONE, string $identity = Values::NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null ): ReadParticipantOptions { return new ReadParticipantOptions( $status, $identity, $dateCreatedAfter, $dateCreatedBefore ); } /** * @param string $status * @return UpdateParticipantOptions Options builder */ public static function update( string $status = Values::NONE ): UpdateParticipantOptions { return new UpdateParticipantOptions( $status ); } } class ReadParticipantOptions extends Options { /** * @param string $status Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. * @param string $identity Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. * @param \DateTime $dateCreatedAfter Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. * @param \DateTime $dateCreatedBefore Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. */ public function __construct( string $status = Values::NONE, string $identity = Values::NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null ) { $this->options['status'] = $status; $this->options['identity'] = $identity; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; } /** * Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. * * @param string $status Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. * * @param string $identity Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. * * @param \DateTime $dateCreatedAfter Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. * * @param \DateTime $dateCreatedBefore Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.ReadParticipantOptions ' . $options . ']'; } } class UpdateParticipantOptions extends Options { /** * @param string $status */ public function __construct( string $status = Values::NONE ) { $this->options['status'] = $status; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.UpdateParticipantOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/ParticipantInstance.php 0000644 00000013544 15021223077 0017232 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Video\V1\Room\Participant\SubscribeRulesList; use Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackList; use Twilio\Rest\Video\V1\Room\Participant\PublishedTrackList; use Twilio\Rest\Video\V1\Room\Participant\AnonymizeList; /** * @property string|null $sid * @property string|null $roomSid * @property string|null $accountSid * @property string $status * @property string|null $identity * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property \DateTime|null $startTime * @property \DateTime|null $endTime * @property int|null $duration * @property string|null $url * @property array|null $links */ class ParticipantInstance extends InstanceResource { protected $_subscribeRules; protected $_subscribedTracks; protected $_publishedTracks; protected $_anonymize; /** * Initialize the ParticipantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the room with the Participant resource to fetch. * @param string $sid The SID of the RoomParticipant resource to fetch. */ public function __construct(Version $version, array $payload, string $roomSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'duration' => Values::array_get($payload, 'duration'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['roomSid' => $roomSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ParticipantContext Context for this ParticipantInstance */ protected function proxy(): ParticipantContext { if (!$this->context) { $this->context = new ParticipantContext( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { return $this->proxy()->fetch(); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ParticipantInstance { return $this->proxy()->update($options); } /** * Access the subscribeRules */ protected function getSubscribeRules(): SubscribeRulesList { return $this->proxy()->subscribeRules; } /** * Access the subscribedTracks */ protected function getSubscribedTracks(): SubscribedTrackList { return $this->proxy()->subscribedTracks; } /** * Access the publishedTracks */ protected function getPublishedTracks(): PublishedTrackList { return $this->proxy()->publishedTracks; } /** * Access the anonymize */ protected function getAnonymize(): AnonymizeList { return $this->proxy()->anonymize; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingList.php 0000644 00000014045 15021223077 0016671 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class RoomRecordingList extends ListResource { /** * Construct the RoomRecordingList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the room with the RoomRecording resource to delete. */ public function __construct( Version $version, string $roomSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'roomSid' => $roomSid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/Recordings'; } /** * Reads RoomRecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoomRecordingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RoomRecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoomRecordingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RoomRecordingPage Page of RoomRecordingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RoomRecordingPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'SourceSid' => $options['sourceSid'], 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RoomRecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoomRecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RoomRecordingPage Page of RoomRecordingInstance */ public function getPage(string $targetUrl): RoomRecordingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RoomRecordingPage($this->version, $response, $this->solution); } /** * Constructs a RoomRecordingContext * * @param string $sid The SID of the RoomRecording resource to delete. */ public function getContext( string $sid ): RoomRecordingContext { return new RoomRecordingContext( $this->version, $this->solution['roomSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.RoomRecordingList]'; } } sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingOptions.php 0000644 00000011406 15021223077 0017407 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Options; use Twilio\Values; abstract class RoomRecordingOptions { /** * @param string $status Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. * @param string $sourceSid Read only the recordings that have this `source_sid`. * @param \DateTime $dateCreatedAfter Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @param \DateTime $dateCreatedBefore Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @return ReadRoomRecordingOptions Options builder */ public static function read( string $status = Values::NONE, string $sourceSid = Values::NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null ): ReadRoomRecordingOptions { return new ReadRoomRecordingOptions( $status, $sourceSid, $dateCreatedAfter, $dateCreatedBefore ); } } class ReadRoomRecordingOptions extends Options { /** * @param string $status Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. * @param string $sourceSid Read only the recordings that have this `source_sid`. * @param \DateTime $dateCreatedAfter Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @param \DateTime $dateCreatedBefore Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. */ public function __construct( string $status = Values::NONE, string $sourceSid = Values::NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null ) { $this->options['status'] = $status; $this->options['sourceSid'] = $sourceSid; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; } /** * Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. * * @param string $status Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Read only the recordings that have this `source_sid`. * * @param string $sourceSid Read only the recordings that have this `source_sid`. * @return $this Fluent Builder */ public function setSourceSid(string $sourceSid): self { $this->options['sourceSid'] = $sourceSid; return $this; } /** * Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * * @param \DateTime $dateCreatedAfter Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * * @param \DateTime $dateCreatedBefore Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.ReadRoomRecordingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/ParticipantContext.php 0000644 00000014744 15021223077 0017115 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Video\V1\Room\Participant\SubscribeRulesList; use Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackList; use Twilio\Rest\Video\V1\Room\Participant\PublishedTrackList; use Twilio\Rest\Video\V1\Room\Participant\AnonymizeList; /** * @property SubscribeRulesList $subscribeRules * @property SubscribedTrackList $subscribedTracks * @property PublishedTrackList $publishedTracks * @property AnonymizeList $anonymize * @method \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackContext subscribedTracks(string $sid) * @method \Twilio\Rest\Video\V1\Room\Participant\AnonymizeContext anonymize() * @method \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackContext publishedTracks(string $sid) */ class ParticipantContext extends InstanceContext { protected $_subscribeRules; protected $_subscribedTracks; protected $_publishedTracks; protected $_anonymize; /** * Initialize the ParticipantContext * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the room with the Participant resource to fetch. * @param string $sid The SID of the RoomParticipant resource to fetch. */ public function __construct( Version $version, $roomSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'roomSid' => $roomSid, 'sid' => $sid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/Participants/' . \rawurlencode($sid) .''; } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ParticipantInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['sid'] ); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ParticipantInstance { $options = new Values($options); $data = Values::of([ 'Status' => $options['status'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ParticipantInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['sid'] ); } /** * Access the subscribeRules */ protected function getSubscribeRules(): SubscribeRulesList { if (!$this->_subscribeRules) { $this->_subscribeRules = new SubscribeRulesList( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->_subscribeRules; } /** * Access the subscribedTracks */ protected function getSubscribedTracks(): SubscribedTrackList { if (!$this->_subscribedTracks) { $this->_subscribedTracks = new SubscribedTrackList( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->_subscribedTracks; } /** * Access the publishedTracks */ protected function getPublishedTracks(): PublishedTrackList { if (!$this->_publishedTracks) { $this->_publishedTracks = new PublishedTrackList( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->_publishedTracks; } /** * Access the anonymize */ protected function getAnonymize(): AnonymizeList { if (!$this->_anonymize) { $this->_anonymize = new AnonymizeList( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->_anonymize; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.ParticipantContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/ParticipantPage.php 0000644 00000003104 15021223077 0016331 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ParticipantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ParticipantInstance \Twilio\Rest\Video\V1\Room\ParticipantInstance */ public function buildInstance(array $payload): ParticipantInstance { return new ParticipantInstance($this->version, $payload, $this->solution['roomSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.ParticipantPage]'; } } sdk/src/Twilio/Rest/Video/V1/Room/RecordingRulesOptions.php 0000644 00000003543 15021223077 0017570 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Options; use Twilio\Values; abstract class RecordingRulesOptions { /** * @param array $rules A JSON-encoded array of recording rules. * @return UpdateRecordingRulesOptions Options builder */ public static function update( array $rules = Values::ARRAY_NONE ): UpdateRecordingRulesOptions { return new UpdateRecordingRulesOptions( $rules ); } } class UpdateRecordingRulesOptions extends Options { /** * @param array $rules A JSON-encoded array of recording rules. */ public function __construct( array $rules = Values::ARRAY_NONE ) { $this->options['rules'] = $rules; } /** * A JSON-encoded array of recording rules. * * @param array $rules A JSON-encoded array of recording rules. * @return $this Fluent Builder */ public function setRules(array $rules): self { $this->options['rules'] = $rules; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.UpdateRecordingRulesOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingPage.php 0000644 00000003120 15021223077 0016622 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RoomRecordingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RoomRecordingInstance \Twilio\Rest\Video\V1\Room\RoomRecordingInstance */ public function buildInstance(array $payload): RoomRecordingInstance { return new RoomRecordingInstance($this->version, $payload, $this->solution['roomSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.RoomRecordingPage]'; } } sdk/src/Twilio/Rest/Video/V1/Room/ParticipantList.php 0000644 00000013775 15021223077 0016407 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the room with the Participant resource to fetch. */ public function __construct( Version $version, string $roomSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'roomSid' => $roomSid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/Participants'; } /** * Reads ParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ParticipantPage Page of ParticipantInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ParticipantPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'Identity' => $options['identity'], 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ParticipantPage Page of ParticipantInstance */ public function getPage(string $targetUrl): ParticipantPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Constructs a ParticipantContext * * @param string $sid The SID of the RoomParticipant resource to fetch. */ public function getContext( string $sid ): ParticipantContext { return new ParticipantContext( $this->version, $this->solution['roomSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.ParticipantList]'; } } sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingContext.php 0000644 00000005015 15021223077 0017377 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class RoomRecordingContext extends InstanceContext { /** * Initialize the RoomRecordingContext * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the room with the RoomRecording resource to delete. * @param string $sid The SID of the RoomRecording resource to delete. */ public function __construct( Version $version, $roomSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'roomSid' => $roomSid, 'sid' => $sid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/Recordings/' . \rawurlencode($sid) .''; } /** * Delete the RoomRecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RoomRecordingInstance * * @return RoomRecordingInstance Fetched RoomRecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoomRecordingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoomRecordingInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RoomRecordingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackList.php 0000644 00000013471 15021223077 0021452 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SubscribedTrackList extends ListResource { /** * Construct the SubscribedTrackList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room where the Track resource to fetch is subscribed. * @param string $participantSid The SID of the participant that subscribes to the Track resource to fetch. */ public function __construct( Version $version, string $roomSid, string $participantSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'roomSid' => $roomSid, 'participantSid' => $participantSid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/Participants/' . \rawurlencode($participantSid) .'/SubscribedTracks'; } /** * Reads SubscribedTrackInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SubscribedTrackInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SubscribedTrackInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SubscribedTrackInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SubscribedTrackPage Page of SubscribedTrackInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SubscribedTrackPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SubscribedTrackPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SubscribedTrackInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SubscribedTrackPage Page of SubscribedTrackInstance */ public function getPage(string $targetUrl): SubscribedTrackPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SubscribedTrackPage($this->version, $response, $this->solution); } /** * Constructs a SubscribedTrackContext * * @param string $sid The SID of the RoomParticipantSubscribedTrack resource to fetch. */ public function getContext( string $sid ): SubscribedTrackContext { return new SubscribedTrackContext( $this->version, $this->solution['roomSid'], $this->solution['participantSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.SubscribedTrackList]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackPage.php 0000644 00000003221 15021223077 0021235 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PublishedTrackPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return PublishedTrackInstance \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackInstance */ public function buildInstance(array $payload): PublishedTrackInstance { return new PublishedTrackInstance($this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.PublishedTrackPage]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackContext.php 0000644 00000005114 15021223077 0022156 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class SubscribedTrackContext extends InstanceContext { /** * Initialize the SubscribedTrackContext * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room where the Track resource to fetch is subscribed. * @param string $participantSid The SID of the participant that subscribes to the Track resource to fetch. * @param string $sid The SID of the RoomParticipantSubscribedTrack resource to fetch. */ public function __construct( Version $version, $roomSid, $participantSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'roomSid' => $roomSid, 'participantSid' => $participantSid, 'sid' => $sid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/Participants/' . \rawurlencode($participantSid) .'/SubscribedTracks/' . \rawurlencode($sid) .''; } /** * Fetch the SubscribedTrackInstance * * @return SubscribedTrackInstance Fetched SubscribedTrackInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SubscribedTrackInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SubscribedTrackInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.SubscribedTrackContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackInstance.php 0000644 00000011002 15021223077 0022267 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $participantSid * @property string|null $publisherSid * @property string|null $roomSid * @property string|null $name * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property bool|null $enabled * @property string $kind * @property string|null $url */ class SubscribedTrackInstance extends InstanceResource { /** * Initialize the SubscribedTrackInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the Room where the Track resource to fetch is subscribed. * @param string $participantSid The SID of the participant that subscribes to the Track resource to fetch. * @param string $sid The SID of the RoomParticipantSubscribedTrack resource to fetch. */ public function __construct(Version $version, array $payload, string $roomSid, string $participantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'publisherSid' => Values::array_get($payload, 'publisher_sid'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'name' => Values::array_get($payload, 'name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'enabled' => Values::array_get($payload, 'enabled'), 'kind' => Values::array_get($payload, 'kind'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['roomSid' => $roomSid, 'participantSid' => $participantSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SubscribedTrackContext Context for this SubscribedTrackInstance */ protected function proxy(): SubscribedTrackContext { if (!$this->context) { $this->context = new SubscribedTrackContext( $this->version, $this->solution['roomSid'], $this->solution['participantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the SubscribedTrackInstance * * @return SubscribedTrackInstance Fetched SubscribedTrackInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SubscribedTrackInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.SubscribedTrackInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesInstance.php 0000644 00000005501 15021223077 0022160 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $participantSid * @property string|null $roomSid * @property string[]|null $rules * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class SubscribeRulesInstance extends InstanceResource { /** * Initialize the SubscribeRulesInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the Room resource where the subscribe rules to fetch apply. * @param string $participantSid The SID of the Participant resource with the subscribe rules to fetch. */ public function __construct(Version $version, array $payload, string $roomSid, string $participantSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'participantSid' => Values::array_get($payload, 'participant_sid'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'rules' => Values::array_get($payload, 'rules'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['roomSid' => $roomSid, 'participantSid' => $participantSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.SubscribeRulesInstance]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizePage.php 0000644 00000003150 15021223077 0020303 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AnonymizePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AnonymizeInstance \Twilio\Rest\Video\V1\Room\Participant\AnonymizeInstance */ public function buildInstance(array $payload): AnonymizeInstance { return new AnonymizeInstance($this->version, $payload, $this->solution['roomSid'], $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.AnonymizePage]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesPage.php 0000644 00000003221 15021223077 0021265 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SubscribeRulesPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SubscribeRulesInstance \Twilio\Rest\Video\V1\Room\Participant\SubscribeRulesInstance */ public function buildInstance(array $payload): SubscribeRulesInstance { return new SubscribeRulesInstance($this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.SubscribeRulesPage]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackContext.php 0000644 00000005106 15021223077 0022011 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class PublishedTrackContext extends InstanceContext { /** * Initialize the PublishedTrackContext * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource where the Track resource to fetch is published. * @param string $participantSid The SID of the Participant resource with the published track to fetch. * @param string $sid The SID of the RoomParticipantPublishedTrack resource to fetch. */ public function __construct( Version $version, $roomSid, $participantSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'roomSid' => $roomSid, 'participantSid' => $participantSid, 'sid' => $sid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/Participants/' . \rawurlencode($participantSid) .'/PublishedTracks/' . \rawurlencode($sid) .''; } /** * Fetch the PublishedTrackInstance * * @return PublishedTrackInstance Fetched PublishedTrackInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PublishedTrackInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new PublishedTrackInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.PublishedTrackContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesOptions.php 0000644 00000004653 15021223077 0022056 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Options; use Twilio\Values; abstract class SubscribeRulesOptions { /** * @param array $rules A JSON-encoded array of subscribe rules. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information. * @return UpdateSubscribeRulesOptions Options builder */ public static function update( array $rules = Values::ARRAY_NONE ): UpdateSubscribeRulesOptions { return new UpdateSubscribeRulesOptions( $rules ); } } class UpdateSubscribeRulesOptions extends Options { /** * @param array $rules A JSON-encoded array of subscribe rules. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information. */ public function __construct( array $rules = Values::ARRAY_NONE ) { $this->options['rules'] = $rules; } /** * A JSON-encoded array of subscribe rules. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information. * * @param array $rules A JSON-encoded array of subscribe rules. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information. * @return $this Fluent Builder */ public function setRules(array $rules): self { $this->options['rules'] = $rules; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.UpdateSubscribeRulesOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackList.php 0000644 00000013450 15021223077 0021301 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class PublishedTrackList extends ListResource { /** * Construct the PublishedTrackList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource where the Track resource to fetch is published. * @param string $participantSid The SID of the Participant resource with the published track to fetch. */ public function __construct( Version $version, string $roomSid, string $participantSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'roomSid' => $roomSid, 'participantSid' => $participantSid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/Participants/' . \rawurlencode($participantSid) .'/PublishedTracks'; } /** * Reads PublishedTrackInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PublishedTrackInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams PublishedTrackInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of PublishedTrackInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return PublishedTrackPage Page of PublishedTrackInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): PublishedTrackPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new PublishedTrackPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PublishedTrackInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return PublishedTrackPage Page of PublishedTrackInstance */ public function getPage(string $targetUrl): PublishedTrackPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PublishedTrackPage($this->version, $response, $this->solution); } /** * Constructs a PublishedTrackContext * * @param string $sid The SID of the RoomParticipantPublishedTrack resource to fetch. */ public function getContext( string $sid ): PublishedTrackContext { return new PublishedTrackContext( $this->version, $this->solution['roomSid'], $this->solution['participantSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.PublishedTrackList]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeList.php 0000644 00000003330 15021223077 0020342 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\ListResource; use Twilio\Version; class AnonymizeList extends ListResource { /** * Construct the AnonymizeList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the room with the participant to update. * @param string $sid The SID of the RoomParticipant resource to update. */ public function __construct( Version $version, string $roomSid, string $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'roomSid' => $roomSid, 'sid' => $sid, ]; } /** * Constructs a AnonymizeContext */ public function getContext( ): AnonymizeContext { return new AnonymizeContext( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.AnonymizeList]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesList.php 0000644 00000006026 15021223077 0021332 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class SubscribeRulesList extends ListResource { /** * Construct the SubscribeRulesList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource where the subscribe rules to fetch apply. * @param string $participantSid The SID of the Participant resource with the subscribe rules to fetch. */ public function __construct( Version $version, string $roomSid, string $participantSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'roomSid' => $roomSid, 'participantSid' => $participantSid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/Participants/' . \rawurlencode($participantSid) .'/SubscribeRules'; } /** * Fetch the SubscribeRulesInstance * * @return SubscribeRulesInstance Fetched SubscribeRulesInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SubscribeRulesInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SubscribeRulesInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid'] ); } /** * Update the SubscribeRulesInstance * * @param array|Options $options Optional Arguments * @return SubscribeRulesInstance Updated SubscribeRulesInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SubscribeRulesInstance { $options = new Values($options); $data = Values::of([ 'Rules' => Serialize::jsonObject($options['rules']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SubscribeRulesInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.SubscribeRulesList]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeContext.php 0000644 00000004333 15021223077 0021057 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class AnonymizeContext extends InstanceContext { /** * Initialize the AnonymizeContext * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the room with the participant to update. * @param string $sid The SID of the RoomParticipant resource to update. */ public function __construct( Version $version, $roomSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'roomSid' => $roomSid, 'sid' => $sid, ]; $this->uri = '/Rooms/' . \rawurlencode($roomSid) .'/Participants/' . \rawurlencode($sid) .'/Anonymize'; } /** * Update the AnonymizeInstance * * @return AnonymizeInstance Updated AnonymizeInstance * @throws TwilioException When an HTTP error occurs. */ public function update(): AnonymizeInstance { $payload = $this->version->update('POST', $this->uri, [], []); return new AnonymizeInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.AnonymizeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/AnonymizeInstance.php 0000644 00000010470 15021223077 0021176 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $roomSid * @property string|null $accountSid * @property string $status * @property string|null $identity * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property \DateTime|null $startTime * @property \DateTime|null $endTime * @property int|null $duration * @property string|null $url */ class AnonymizeInstance extends InstanceResource { /** * Initialize the AnonymizeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the room with the participant to update. * @param string $sid The SID of the RoomParticipant resource to update. */ public function __construct(Version $version, array $payload, string $roomSid, string $sid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'duration' => Values::array_get($payload, 'duration'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['roomSid' => $roomSid, 'sid' => $sid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AnonymizeContext Context for this AnonymizeInstance */ protected function proxy(): AnonymizeContext { if (!$this->context) { $this->context = new AnonymizeContext( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the AnonymizeInstance * * @return AnonymizeInstance Updated AnonymizeInstance * @throws TwilioException When an HTTP error occurs. */ public function update(): AnonymizeInstance { return $this->proxy()->update(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.AnonymizeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackPage.php 0000644 00000003227 15021223077 0021411 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SubscribedTrackPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SubscribedTrackInstance \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackInstance */ public function buildInstance(array $payload): SubscribedTrackInstance { return new SubscribedTrackInstance($this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.SubscribedTrackPage]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackInstance.php 0000644 00000010607 15021223077 0022133 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $participantSid * @property string|null $roomSid * @property string|null $name * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property bool|null $enabled * @property string $kind * @property string|null $url */ class PublishedTrackInstance extends InstanceResource { /** * Initialize the PublishedTrackInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the Room resource where the Track resource to fetch is published. * @param string $participantSid The SID of the Participant resource with the published track to fetch. * @param string $sid The SID of the RoomParticipantPublishedTrack resource to fetch. */ public function __construct(Version $version, array $payload, string $roomSid, string $participantSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'name' => Values::array_get($payload, 'name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'enabled' => Values::array_get($payload, 'enabled'), 'kind' => Values::array_get($payload, 'kind'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['roomSid' => $roomSid, 'participantSid' => $participantSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PublishedTrackContext Context for this PublishedTrackInstance */ protected function proxy(): PublishedTrackContext { if (!$this->context) { $this->context = new PublishedTrackContext( $this->version, $this->solution['roomSid'], $this->solution['participantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the PublishedTrackInstance * * @return PublishedTrackInstance Fetched PublishedTrackInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PublishedTrackInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.PublishedTrackInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionContext.php 0000644 00000004407 15021223077 0016221 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class CompositionContext extends InstanceContext { /** * Initialize the CompositionContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Composition resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Compositions/' . \rawurlencode($sid) .''; } /** * Delete the CompositionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CompositionInstance * * @return CompositionInstance Fetched CompositionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CompositionInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionSettingsOptions.php 0000644 00000015122 15021223077 0017745 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; abstract class CompositionSettingsOptions { /** * @param string $awsCredentialsSid The SID of the stored Credential resource. * @param string $encryptionKeySid The SID of the Public Key resource to use for encryption. * @param string $awsS3Url The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). * @param bool $awsStorageEnabled Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. * @param bool $encryptionEnabled Whether all compositions should be stored in an encrypted form. The default is `false`. * @return CreateCompositionSettingsOptions Options builder */ public static function create( string $awsCredentialsSid = Values::NONE, string $encryptionKeySid = Values::NONE, string $awsS3Url = Values::NONE, bool $awsStorageEnabled = Values::BOOL_NONE, bool $encryptionEnabled = Values::BOOL_NONE ): CreateCompositionSettingsOptions { return new CreateCompositionSettingsOptions( $awsCredentialsSid, $encryptionKeySid, $awsS3Url, $awsStorageEnabled, $encryptionEnabled ); } } class CreateCompositionSettingsOptions extends Options { /** * @param string $awsCredentialsSid The SID of the stored Credential resource. * @param string $encryptionKeySid The SID of the Public Key resource to use for encryption. * @param string $awsS3Url The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). * @param bool $awsStorageEnabled Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. * @param bool $encryptionEnabled Whether all compositions should be stored in an encrypted form. The default is `false`. */ public function __construct( string $awsCredentialsSid = Values::NONE, string $encryptionKeySid = Values::NONE, string $awsS3Url = Values::NONE, bool $awsStorageEnabled = Values::BOOL_NONE, bool $encryptionEnabled = Values::BOOL_NONE ) { $this->options['awsCredentialsSid'] = $awsCredentialsSid; $this->options['encryptionKeySid'] = $encryptionKeySid; $this->options['awsS3Url'] = $awsS3Url; $this->options['awsStorageEnabled'] = $awsStorageEnabled; $this->options['encryptionEnabled'] = $encryptionEnabled; } /** * The SID of the stored Credential resource. * * @param string $awsCredentialsSid The SID of the stored Credential resource. * @return $this Fluent Builder */ public function setAwsCredentialsSid(string $awsCredentialsSid): self { $this->options['awsCredentialsSid'] = $awsCredentialsSid; return $this; } /** * The SID of the Public Key resource to use for encryption. * * @param string $encryptionKeySid The SID of the Public Key resource to use for encryption. * @return $this Fluent Builder */ public function setEncryptionKeySid(string $encryptionKeySid): self { $this->options['encryptionKeySid'] = $encryptionKeySid; return $this; } /** * The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). * * @param string $awsS3Url The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). * @return $this Fluent Builder */ public function setAwsS3Url(string $awsS3Url): self { $this->options['awsS3Url'] = $awsS3Url; return $this; } /** * Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. * * @param bool $awsStorageEnabled Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. * @return $this Fluent Builder */ public function setAwsStorageEnabled(bool $awsStorageEnabled): self { $this->options['awsStorageEnabled'] = $awsStorageEnabled; return $this; } /** * Whether all compositions should be stored in an encrypted form. The default is `false`. * * @param bool $encryptionEnabled Whether all compositions should be stored in an encrypted form. The default is `false`. * @return $this Fluent Builder */ public function setEncryptionEnabled(bool $encryptionEnabled): self { $this->options['encryptionEnabled'] = $encryptionEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.CreateCompositionSettingsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingSettingsOptions.php 0000644 00000015016 15021223077 0017360 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; abstract class RecordingSettingsOptions { /** * @param string $awsCredentialsSid The SID of the stored Credential resource. * @param string $encryptionKeySid The SID of the Public Key resource to use for encryption. * @param string $awsS3Url The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). * @param bool $awsStorageEnabled Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. * @param bool $encryptionEnabled Whether all recordings should be stored in an encrypted form. The default is `false`. * @return CreateRecordingSettingsOptions Options builder */ public static function create( string $awsCredentialsSid = Values::NONE, string $encryptionKeySid = Values::NONE, string $awsS3Url = Values::NONE, bool $awsStorageEnabled = Values::BOOL_NONE, bool $encryptionEnabled = Values::BOOL_NONE ): CreateRecordingSettingsOptions { return new CreateRecordingSettingsOptions( $awsCredentialsSid, $encryptionKeySid, $awsS3Url, $awsStorageEnabled, $encryptionEnabled ); } } class CreateRecordingSettingsOptions extends Options { /** * @param string $awsCredentialsSid The SID of the stored Credential resource. * @param string $encryptionKeySid The SID of the Public Key resource to use for encryption. * @param string $awsS3Url The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). * @param bool $awsStorageEnabled Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. * @param bool $encryptionEnabled Whether all recordings should be stored in an encrypted form. The default is `false`. */ public function __construct( string $awsCredentialsSid = Values::NONE, string $encryptionKeySid = Values::NONE, string $awsS3Url = Values::NONE, bool $awsStorageEnabled = Values::BOOL_NONE, bool $encryptionEnabled = Values::BOOL_NONE ) { $this->options['awsCredentialsSid'] = $awsCredentialsSid; $this->options['encryptionKeySid'] = $encryptionKeySid; $this->options['awsS3Url'] = $awsS3Url; $this->options['awsStorageEnabled'] = $awsStorageEnabled; $this->options['encryptionEnabled'] = $encryptionEnabled; } /** * The SID of the stored Credential resource. * * @param string $awsCredentialsSid The SID of the stored Credential resource. * @return $this Fluent Builder */ public function setAwsCredentialsSid(string $awsCredentialsSid): self { $this->options['awsCredentialsSid'] = $awsCredentialsSid; return $this; } /** * The SID of the Public Key resource to use for encryption. * * @param string $encryptionKeySid The SID of the Public Key resource to use for encryption. * @return $this Fluent Builder */ public function setEncryptionKeySid(string $encryptionKeySid): self { $this->options['encryptionKeySid'] = $encryptionKeySid; return $this; } /** * The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). * * @param string $awsS3Url The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). * @return $this Fluent Builder */ public function setAwsS3Url(string $awsS3Url): self { $this->options['awsS3Url'] = $awsS3Url; return $this; } /** * Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. * * @param bool $awsStorageEnabled Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. * @return $this Fluent Builder */ public function setAwsStorageEnabled(bool $awsStorageEnabled): self { $this->options['awsStorageEnabled'] = $awsStorageEnabled; return $this; } /** * Whether all recordings should be stored in an encrypted form. The default is `false`. * * @param bool $encryptionEnabled Whether all recordings should be stored in an encrypted form. The default is `false`. * @return $this Fluent Builder */ public function setEncryptionEnabled(bool $encryptionEnabled): self { $this->options['encryptionEnabled'] = $encryptionEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.CreateRecordingSettingsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionHookPage.php 0000644 00000003066 15021223077 0016272 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CompositionHookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CompositionHookInstance \Twilio\Rest\Video\V1\CompositionHookInstance */ public function buildInstance(array $payload): CompositionHookInstance { return new CompositionHookInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.CompositionHookPage]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionHookList.php 0000644 00000017042 15021223077 0016330 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class CompositionHookList extends ListResource { /** * Construct the CompositionHookList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/CompositionHooks'; } /** * Create the CompositionHookInstance * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. * @param array|Options $options Optional Arguments * @return CompositionHookInstance Created CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): CompositionHookInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Enabled' => Serialize::booleanToString($options['enabled']), 'VideoLayout' => Serialize::jsonObject($options['videoLayout']), 'AudioSources' => Serialize::map($options['audioSources'], function ($e) { return $e; }), 'AudioSourcesExcluded' => Serialize::map($options['audioSourcesExcluded'], function ($e) { return $e; }), 'Resolution' => $options['resolution'], 'Format' => $options['format'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'Trim' => Serialize::booleanToString($options['trim']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CompositionHookInstance( $this->version, $payload ); } /** * Reads CompositionHookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CompositionHookInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CompositionHookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CompositionHookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CompositionHookPage Page of CompositionHookInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CompositionHookPage { $options = new Values($options); $params = Values::of([ 'Enabled' => Serialize::booleanToString($options['enabled']), 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CompositionHookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CompositionHookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CompositionHookPage Page of CompositionHookInstance */ public function getPage(string $targetUrl): CompositionHookPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CompositionHookPage($this->version, $response, $this->solution); } /** * Constructs a CompositionHookContext * * @param string $sid The SID of the CompositionHook resource to delete. */ public function getContext( string $sid ): CompositionHookContext { return new CompositionHookContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.CompositionHookList]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionList.php 0000644 00000016351 15021223077 0015511 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class CompositionList extends ListResource { /** * Construct the CompositionList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Compositions'; } /** * Create the CompositionInstance * * @param string $roomSid The SID of the Group Room with the media tracks to be used as composition sources. * @param array|Options $options Optional Arguments * @return CompositionInstance Created CompositionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $roomSid, array $options = []): CompositionInstance { $options = new Values($options); $data = Values::of([ 'RoomSid' => $roomSid, 'VideoLayout' => Serialize::jsonObject($options['videoLayout']), 'AudioSources' => Serialize::map($options['audioSources'], function ($e) { return $e; }), 'AudioSourcesExcluded' => Serialize::map($options['audioSourcesExcluded'], function ($e) { return $e; }), 'Resolution' => $options['resolution'], 'Format' => $options['format'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'Trim' => Serialize::booleanToString($options['trim']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CompositionInstance( $this->version, $payload ); } /** * Reads CompositionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CompositionInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CompositionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CompositionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CompositionPage Page of CompositionInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CompositionPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'RoomSid' => $options['roomSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CompositionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CompositionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CompositionPage Page of CompositionInstance */ public function getPage(string $targetUrl): CompositionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CompositionPage($this->version, $response, $this->solution); } /** * Constructs a CompositionContext * * @param string $sid The SID of the Composition resource to delete. */ public function getContext( string $sid ): CompositionContext { return new CompositionContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.CompositionList]'; } } sdk/src/Twilio/Rest/Video/V1/RoomContext.php 0000644 00000012231 15021223077 0014624 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Video\V1\Room\RecordingRulesList; use Twilio\Rest\Video\V1\Room\ParticipantList; use Twilio\Rest\Video\V1\Room\RoomRecordingList; /** * @property RecordingRulesList $recordingRules * @property ParticipantList $participants * @property RoomRecordingList $recordings * @method \Twilio\Rest\Video\V1\Room\ParticipantContext participants(string $sid) * @method \Twilio\Rest\Video\V1\Room\RoomRecordingContext recordings(string $sid) */ class RoomContext extends InstanceContext { protected $_recordingRules; protected $_participants; protected $_recordings; /** * Initialize the RoomContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Room resource to fetch. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Rooms/' . \rawurlencode($sid) .''; } /** * Fetch the RoomInstance * * @return RoomInstance Fetched RoomInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoomInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoomInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the RoomInstance * * @param string $status * @return RoomInstance Updated RoomInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): RoomInstance { $data = Values::of([ 'Status' => $status, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RoomInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the recordingRules */ protected function getRecordingRules(): RecordingRulesList { if (!$this->_recordingRules) { $this->_recordingRules = new RecordingRulesList( $this->version, $this->solution['sid'] ); } return $this->_recordingRules; } /** * Access the participants */ protected function getParticipants(): ParticipantList { if (!$this->_participants) { $this->_participants = new ParticipantList( $this->version, $this->solution['sid'] ); } return $this->_participants; } /** * Access the recordings */ protected function getRecordings(): RoomRecordingList { if (!$this->_recordings) { $this->_recordings = new RoomRecordingList( $this->version, $this->solution['sid'] ); } return $this->_recordings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RoomContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingSettingsList.php 0000644 00000002576 15021223077 0016647 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\ListResource; use Twilio\Version; class RecordingSettingsList extends ListResource { /** * Construct the RecordingSettingsList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a RecordingSettingsContext */ public function getContext( ): RecordingSettingsContext { return new RecordingSettingsContext( $this->version ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.RecordingSettingsList]'; } } sdk/src/Twilio/Rest/Video/V1/RecordingList.php 0000644 00000013607 15021223077 0015123 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class RecordingList extends ListResource { /** * Construct the RecordingList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Recordings'; } /** * Reads RecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RecordingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RecordingPage Page of RecordingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RecordingPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'SourceSid' => $options['sourceSid'], 'GroupingSid' => Serialize::map($options['groupingSid'], function ($e) { return $e; }), 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'MediaType' => $options['mediaType'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RecordingPage Page of RecordingInstance */ public function getPage(string $targetUrl): RecordingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RecordingPage($this->version, $response, $this->solution); } /** * Constructs a RecordingContext * * @param string $sid The SID of the Recording resource to delete. */ public function getContext( string $sid ): RecordingContext { return new RecordingContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.RecordingList]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionInstance.php 0000644 00000013041 15021223077 0016333 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string $status * @property \DateTime|null $dateCreated * @property \DateTime|null $dateCompleted * @property \DateTime|null $dateDeleted * @property string|null $sid * @property string|null $roomSid * @property string[]|null $audioSources * @property string[]|null $audioSourcesExcluded * @property array|null $videoLayout * @property string|null $resolution * @property bool|null $trim * @property string $format * @property int|null $bitrate * @property int|null $size * @property int|null $duration * @property string|null $mediaExternalLocation * @property string|null $statusCallback * @property string|null $statusCallbackMethod * @property string|null $url * @property array|null $links */ class CompositionInstance extends InstanceResource { /** * Initialize the CompositionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Composition resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), 'dateDeleted' => Deserialize::dateTime(Values::array_get($payload, 'date_deleted')), 'sid' => Values::array_get($payload, 'sid'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'audioSources' => Values::array_get($payload, 'audio_sources'), 'audioSourcesExcluded' => Values::array_get($payload, 'audio_sources_excluded'), 'videoLayout' => Values::array_get($payload, 'video_layout'), 'resolution' => Values::array_get($payload, 'resolution'), 'trim' => Values::array_get($payload, 'trim'), 'format' => Values::array_get($payload, 'format'), 'bitrate' => Values::array_get($payload, 'bitrate'), 'size' => Values::array_get($payload, 'size'), 'duration' => Values::array_get($payload, 'duration'), 'mediaExternalLocation' => Values::array_get($payload, 'media_external_location'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CompositionContext Context for this CompositionInstance */ protected function proxy(): CompositionContext { if (!$this->context) { $this->context = new CompositionContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CompositionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CompositionInstance * * @return CompositionInstance Fetched CompositionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionOptions.php 0000644 00000047752 15021223077 0016242 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; abstract class CompositionOptions { /** * @param array $videoLayout An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request * @param string[] $audioSources An array of track names from the same group room to merge into the new composition. Can include zero or more track names. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` includes `student` as well as `studentTeam`. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request * @param string[] $audioSourcesExcluded An array of track names to exclude. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @param string $format * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * @param bool $trim Whether to clip the intervals where there is no active media in the composition. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return CreateCompositionOptions Options builder */ public static function create( array $videoLayout = Values::ARRAY_NONE, array $audioSources = Values::ARRAY_NONE, array $audioSourcesExcluded = Values::ARRAY_NONE, string $resolution = Values::NONE, string $format = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $trim = Values::BOOL_NONE ): CreateCompositionOptions { return new CreateCompositionOptions( $videoLayout, $audioSources, $audioSourcesExcluded, $resolution, $format, $statusCallback, $statusCallbackMethod, $trim ); } /** * @param string $status Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. * @param \DateTime $dateCreatedAfter Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. * @param \DateTime $dateCreatedBefore Read only Composition resources created before this ISO 8601 date-time with time zone. * @param string $roomSid Read only Composition resources with this Room SID. * @return ReadCompositionOptions Options builder */ public static function read( string $status = Values::NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null, string $roomSid = Values::NONE ): ReadCompositionOptions { return new ReadCompositionOptions( $status, $dateCreatedAfter, $dateCreatedBefore, $roomSid ); } } class CreateCompositionOptions extends Options { /** * @param array $videoLayout An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request * @param string[] $audioSources An array of track names from the same group room to merge into the new composition. Can include zero or more track names. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` includes `student` as well as `studentTeam`. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request * @param string[] $audioSourcesExcluded An array of track names to exclude. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @param string $format * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * @param bool $trim Whether to clip the intervals where there is no active media in the composition. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */ public function __construct( array $videoLayout = Values::ARRAY_NONE, array $audioSources = Values::ARRAY_NONE, array $audioSourcesExcluded = Values::ARRAY_NONE, string $resolution = Values::NONE, string $format = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $trim = Values::BOOL_NONE ) { $this->options['videoLayout'] = $videoLayout; $this->options['audioSources'] = $audioSources; $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; $this->options['resolution'] = $resolution; $this->options['format'] = $format; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['trim'] = $trim; } /** * An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request * * @param array $videoLayout An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request * @return $this Fluent Builder */ public function setVideoLayout(array $videoLayout): self { $this->options['videoLayout'] = $videoLayout; return $this; } /** * An array of track names from the same group room to merge into the new composition. Can include zero or more track names. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` includes `student` as well as `studentTeam`. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request * * @param string[] $audioSources An array of track names from the same group room to merge into the new composition. Can include zero or more track names. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` includes `student` as well as `studentTeam`. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request * @return $this Fluent Builder */ public function setAudioSources(array $audioSources): self { $this->options['audioSources'] = $audioSources; return $this; } /** * An array of track names to exclude. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * * @param string[] $audioSourcesExcluded An array of track names to exclude. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * @return $this Fluent Builder */ public function setAudioSourcesExcluded(array $audioSourcesExcluded): self { $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; return $this; } /** * A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setResolution(string $resolution): self { $this->options['resolution'] = $resolution; return $this; } /** * @param string $format * @return $this Fluent Builder */ public function setFormat(string $format): self { $this->options['format'] = $format; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether to clip the intervals where there is no active media in the composition. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param bool $trim Whether to clip the intervals where there is no active media in the composition. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setTrim(bool $trim): self { $this->options['trim'] = $trim; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.CreateCompositionOptions ' . $options . ']'; } } class ReadCompositionOptions extends Options { /** * @param string $status Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. * @param \DateTime $dateCreatedAfter Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. * @param \DateTime $dateCreatedBefore Read only Composition resources created before this ISO 8601 date-time with time zone. * @param string $roomSid Read only Composition resources with this Room SID. */ public function __construct( string $status = Values::NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null, string $roomSid = Values::NONE ) { $this->options['status'] = $status; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['roomSid'] = $roomSid; } /** * Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. * * @param string $status Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. * * @param \DateTime $dateCreatedAfter Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only Composition resources created before this ISO 8601 date-time with time zone. * * @param \DateTime $dateCreatedBefore Read only Composition resources created before this ISO 8601 date-time with time zone. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Read only Composition resources with this Room SID. * * @param string $roomSid Read only Composition resources with this Room SID. * @return $this Fluent Builder */ public function setRoomSid(string $roomSid): self { $this->options['roomSid'] = $roomSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.ReadCompositionOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionHookInstance.php 0000644 00000013101 15021223077 0017151 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $friendlyName * @property bool|null $enabled * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $sid * @property string[]|null $audioSources * @property string[]|null $audioSourcesExcluded * @property array|null $videoLayout * @property string|null $resolution * @property bool|null $trim * @property string $format * @property string|null $statusCallback * @property string|null $statusCallbackMethod * @property string|null $url */ class CompositionHookInstance extends InstanceResource { /** * Initialize the CompositionHookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the CompositionHook resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'enabled' => Values::array_get($payload, 'enabled'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sid' => Values::array_get($payload, 'sid'), 'audioSources' => Values::array_get($payload, 'audio_sources'), 'audioSourcesExcluded' => Values::array_get($payload, 'audio_sources_excluded'), 'videoLayout' => Values::array_get($payload, 'video_layout'), 'resolution' => Values::array_get($payload, 'resolution'), 'trim' => Values::array_get($payload, 'trim'), 'format' => Values::array_get($payload, 'format'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CompositionHookContext Context for this CompositionHookInstance */ protected function proxy(): CompositionHookContext { if (!$this->context) { $this->context = new CompositionHookContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CompositionHookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CompositionHookInstance * * @return CompositionHookInstance Fetched CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionHookInstance { return $this->proxy()->fetch(); } /** * Update the CompositionHookInstance * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. * @param array|Options $options Optional Arguments * @return CompositionHookInstance Updated CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName, array $options = []): CompositionHookInstance { return $this->proxy()->update($friendlyName, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionHookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionSettingsInstance.php 0000644 00000010575 15021223077 0020065 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $friendlyName * @property string|null $awsCredentialsSid * @property string|null $awsS3Url * @property bool|null $awsStorageEnabled * @property string|null $encryptionKeySid * @property bool|null $encryptionEnabled * @property string|null $url */ class CompositionSettingsInstance extends InstanceResource { /** * Initialize the CompositionSettingsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'awsCredentialsSid' => Values::array_get($payload, 'aws_credentials_sid'), 'awsS3Url' => Values::array_get($payload, 'aws_s3_url'), 'awsStorageEnabled' => Values::array_get($payload, 'aws_storage_enabled'), 'encryptionKeySid' => Values::array_get($payload, 'encryption_key_sid'), 'encryptionEnabled' => Values::array_get($payload, 'encryption_enabled'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = []; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CompositionSettingsContext Context for this CompositionSettingsInstance */ protected function proxy(): CompositionSettingsContext { if (!$this->context) { $this->context = new CompositionSettingsContext( $this->version ); } return $this->context; } /** * Create the CompositionSettingsInstance * * @param string $friendlyName A descriptive string that you create to describe the resource and show to the user in the console * @param array|Options $options Optional Arguments * @return CompositionSettingsInstance Created CompositionSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): CompositionSettingsInstance { return $this->proxy()->create($friendlyName, $options); } /** * Fetch the CompositionSettingsInstance * * @return CompositionSettingsInstance Fetched CompositionSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionSettingsInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionSettingsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionSettingsPage.php 0000644 00000003116 15021223077 0017166 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CompositionSettingsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CompositionSettingsInstance \Twilio\Rest\Video\V1\CompositionSettingsInstance */ public function buildInstance(array $payload): CompositionSettingsInstance { return new CompositionSettingsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.CompositionSettingsPage]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionHookContext.php 0000644 00000010034 15021223077 0017033 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class CompositionHookContext extends InstanceContext { /** * Initialize the CompositionHookContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the CompositionHook resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/CompositionHooks/' . \rawurlencode($sid) .''; } /** * Delete the CompositionHookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CompositionHookInstance * * @return CompositionHookInstance Fetched CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionHookInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CompositionHookInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the CompositionHookInstance * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. * @param array|Options $options Optional Arguments * @return CompositionHookInstance Updated CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName, array $options = []): CompositionHookInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Enabled' => Serialize::booleanToString($options['enabled']), 'VideoLayout' => Serialize::jsonObject($options['videoLayout']), 'AudioSources' => Serialize::map($options['audioSources'], function ($e) { return $e; }), 'AudioSourcesExcluded' => Serialize::map($options['audioSourcesExcluded'], function ($e) { return $e; }), 'Trim' => Serialize::booleanToString($options['trim']), 'Format' => $options['format'], 'Resolution' => $options['resolution'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CompositionHookInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionHookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionSettingsList.php 0000644 00000002612 15021223077 0017225 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\ListResource; use Twilio\Version; class CompositionSettingsList extends ListResource { /** * Construct the CompositionSettingsList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a CompositionSettingsContext */ public function getContext( ): CompositionSettingsContext { return new CompositionSettingsContext( $this->version ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.CompositionSettingsList]'; } } sdk/src/Twilio/Rest/Video/V1/RoomInstance.php 0000644 00000015247 15021223077 0014756 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Video\V1\Room\RecordingRulesList; use Twilio\Rest\Video\V1\Room\ParticipantList; use Twilio\Rest\Video\V1\Room\RoomRecordingList; /** * @property string|null $sid * @property string $status * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $accountSid * @property bool|null $enableTurn * @property string|null $uniqueName * @property string|null $statusCallback * @property string|null $statusCallbackMethod * @property \DateTime|null $endTime * @property int|null $duration * @property string $type * @property int|null $maxParticipants * @property int|null $maxParticipantDuration * @property int|null $maxConcurrentPublishedTracks * @property bool|null $recordParticipantsOnConnect * @property string[]|null $videoCodecs * @property string|null $mediaRegion * @property bool|null $audioOnly * @property int|null $emptyRoomTimeout * @property int|null $unusedRoomTimeout * @property bool|null $largeRoom * @property string|null $url * @property array|null $links */ class RoomInstance extends InstanceResource { protected $_recordingRules; protected $_participants; protected $_recordings; /** * Initialize the RoomInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Room resource to fetch. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'accountSid' => Values::array_get($payload, 'account_sid'), 'enableTurn' => Values::array_get($payload, 'enable_turn'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'duration' => Values::array_get($payload, 'duration'), 'type' => Values::array_get($payload, 'type'), 'maxParticipants' => Values::array_get($payload, 'max_participants'), 'maxParticipantDuration' => Values::array_get($payload, 'max_participant_duration'), 'maxConcurrentPublishedTracks' => Values::array_get($payload, 'max_concurrent_published_tracks'), 'recordParticipantsOnConnect' => Values::array_get($payload, 'record_participants_on_connect'), 'videoCodecs' => Values::array_get($payload, 'video_codecs'), 'mediaRegion' => Values::array_get($payload, 'media_region'), 'audioOnly' => Values::array_get($payload, 'audio_only'), 'emptyRoomTimeout' => Values::array_get($payload, 'empty_room_timeout'), 'unusedRoomTimeout' => Values::array_get($payload, 'unused_room_timeout'), 'largeRoom' => Values::array_get($payload, 'large_room'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoomContext Context for this RoomInstance */ protected function proxy(): RoomContext { if (!$this->context) { $this->context = new RoomContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the RoomInstance * * @return RoomInstance Fetched RoomInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoomInstance { return $this->proxy()->fetch(); } /** * Update the RoomInstance * * @param string $status * @return RoomInstance Updated RoomInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): RoomInstance { return $this->proxy()->update($status); } /** * Access the recordingRules */ protected function getRecordingRules(): RecordingRulesList { return $this->proxy()->recordingRules; } /** * Access the participants */ protected function getParticipants(): ParticipantList { return $this->proxy()->participants; } /** * Access the recordings */ protected function getRecordings(): RoomRecordingList { return $this->proxy()->recordings; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RoomInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingSettingsPage.php 0000644 00000003102 15021223077 0016572 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RecordingSettingsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RecordingSettingsInstance \Twilio\Rest\Video\V1\RecordingSettingsInstance */ public function buildInstance(array $payload): RecordingSettingsInstance { return new RecordingSettingsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.RecordingSettingsPage]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionHookOptions.php 0000644 00000113073 15021223077 0017051 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; abstract class CompositionHookOptions { /** * @param bool $enabled Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook will never be triggered. * @param array $videoLayout An object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @param string[] $audioSources An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. * @param string[] $audioSourcesExcluded An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @param string $format * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * @param bool $trim Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return CreateCompositionHookOptions Options builder */ public static function create( bool $enabled = Values::BOOL_NONE, array $videoLayout = Values::ARRAY_NONE, array $audioSources = Values::ARRAY_NONE, array $audioSourcesExcluded = Values::ARRAY_NONE, string $resolution = Values::NONE, string $format = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $trim = Values::BOOL_NONE ): CreateCompositionHookOptions { return new CreateCompositionHookOptions( $enabled, $videoLayout, $audioSources, $audioSourcesExcluded, $resolution, $format, $statusCallback, $statusCallbackMethod, $trim ); } /** * @param bool $enabled Read only CompositionHook resources with an `enabled` value that matches this parameter. * @param \DateTime $dateCreatedAfter Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @param \DateTime $dateCreatedBefore Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @param string $friendlyName Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. * @return ReadCompositionHookOptions Options builder */ public static function read( bool $enabled = Values::BOOL_NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null, string $friendlyName = Values::NONE ): ReadCompositionHookOptions { return new ReadCompositionHookOptions( $enabled, $dateCreatedAfter, $dateCreatedBefore, $friendlyName ); } /** * @param bool $enabled Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. * @param array $videoLayout A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @param string[] $audioSources An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. * @param string[] $audioSourcesExcluded An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * @param bool $trim Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @param string $format * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * @return UpdateCompositionHookOptions Options builder */ public static function update( bool $enabled = Values::BOOL_NONE, array $videoLayout = Values::ARRAY_NONE, array $audioSources = Values::ARRAY_NONE, array $audioSourcesExcluded = Values::ARRAY_NONE, bool $trim = Values::BOOL_NONE, string $format = Values::NONE, string $resolution = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE ): UpdateCompositionHookOptions { return new UpdateCompositionHookOptions( $enabled, $videoLayout, $audioSources, $audioSourcesExcluded, $trim, $format, $resolution, $statusCallback, $statusCallbackMethod ); } } class CreateCompositionHookOptions extends Options { /** * @param bool $enabled Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook will never be triggered. * @param array $videoLayout An object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @param string[] $audioSources An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. * @param string[] $audioSourcesExcluded An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @param string $format * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * @param bool $trim Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. */ public function __construct( bool $enabled = Values::BOOL_NONE, array $videoLayout = Values::ARRAY_NONE, array $audioSources = Values::ARRAY_NONE, array $audioSourcesExcluded = Values::ARRAY_NONE, string $resolution = Values::NONE, string $format = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $trim = Values::BOOL_NONE ) { $this->options['enabled'] = $enabled; $this->options['videoLayout'] = $videoLayout; $this->options['audioSources'] = $audioSources; $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; $this->options['resolution'] = $resolution; $this->options['format'] = $format; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['trim'] = $trim; } /** * Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook will never be triggered. * * @param bool $enabled Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook will never be triggered. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * An object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param array $videoLayout An object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setVideoLayout(array $videoLayout): self { $this->options['videoLayout'] = $videoLayout; return $this; } /** * An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. * * @param string[] $audioSources An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. * @return $this Fluent Builder */ public function setAudioSources(array $audioSources): self { $this->options['audioSources'] = $audioSources; return $this; } /** * An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * * @param string[] $audioSourcesExcluded An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * @return $this Fluent Builder */ public function setAudioSourcesExcluded(array $audioSourcesExcluded): self { $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; return $this; } /** * A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setResolution(string $resolution): self { $this->options['resolution'] = $resolution; return $this; } /** * @param string $format * @return $this Fluent Builder */ public function setFormat(string $format): self { $this->options['format'] = $format; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param bool $trim Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setTrim(bool $trim): self { $this->options['trim'] = $trim; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.CreateCompositionHookOptions ' . $options . ']'; } } class ReadCompositionHookOptions extends Options { /** * @param bool $enabled Read only CompositionHook resources with an `enabled` value that matches this parameter. * @param \DateTime $dateCreatedAfter Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @param \DateTime $dateCreatedBefore Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @param string $friendlyName Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. */ public function __construct( bool $enabled = Values::BOOL_NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null, string $friendlyName = Values::NONE ) { $this->options['enabled'] = $enabled; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['friendlyName'] = $friendlyName; } /** * Read only CompositionHook resources with an `enabled` value that matches this parameter. * * @param bool $enabled Read only CompositionHook resources with an `enabled` value that matches this parameter. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * * @param \DateTime $dateCreatedAfter Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * * @param \DateTime $dateCreatedBefore Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. * * @param string $friendlyName Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.ReadCompositionHookOptions ' . $options . ']'; } } class UpdateCompositionHookOptions extends Options { /** * @param bool $enabled Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. * @param array $videoLayout A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @param string[] $audioSources An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. * @param string[] $audioSourcesExcluded An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * @param bool $trim Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @param string $format * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. */ public function __construct( bool $enabled = Values::BOOL_NONE, array $videoLayout = Values::ARRAY_NONE, array $audioSources = Values::ARRAY_NONE, array $audioSourcesExcluded = Values::ARRAY_NONE, bool $trim = Values::BOOL_NONE, string $format = Values::NONE, string $resolution = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE ) { $this->options['enabled'] = $enabled; $this->options['videoLayout'] = $videoLayout; $this->options['audioSources'] = $audioSources; $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; $this->options['trim'] = $trim; $this->options['format'] = $format; $this->options['resolution'] = $resolution; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; } /** * Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. * * @param bool $enabled Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param array $videoLayout A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setVideoLayout(array $videoLayout): self { $this->options['videoLayout'] = $videoLayout; return $this; } /** * An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. * * @param string[] $audioSources An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. * @return $this Fluent Builder */ public function setAudioSources(array $audioSources): self { $this->options['audioSources'] = $audioSources; return $this; } /** * An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * * @param string[] $audioSourcesExcluded An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * @return $this Fluent Builder */ public function setAudioSourcesExcluded(array $audioSourcesExcluded): self { $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; return $this; } /** * Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param bool $trim Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setTrim(bool $trim): self { $this->options['trim'] = $trim; return $this; } /** * @param string $format * @return $this Fluent Builder */ public function setFormat(string $format): self { $this->options['format'] = $format; return $this; } /** * A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * @return $this Fluent Builder */ public function setResolution(string $resolution): self { $this->options['resolution'] = $resolution; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.UpdateCompositionHookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingContext.php 0000644 00000004361 15021223077 0015631 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class RecordingContext extends InstanceContext { /** * Initialize the RecordingContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Recording resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Recordings/' . \rawurlencode($sid) .''; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RecordingInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RecordingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionPage.php 0000644 00000003036 15021223077 0015446 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CompositionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CompositionInstance \Twilio\Rest\Video\V1\CompositionInstance */ public function buildInstance(array $payload): CompositionInstance { return new CompositionInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.CompositionPage]'; } } sdk/src/Twilio/Rest/Video/V1/RoomPage.php 0000644 00000002764 15021223077 0014066 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RoomPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RoomInstance \Twilio\Rest\Video\V1\RoomInstance */ public function buildInstance(array $payload): RoomInstance { return new RoomInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1.RoomPage]'; } } sdk/src/Twilio/Rest/Video/V1/RoomOptions.php 0000644 00000053237 15021223077 0014646 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; abstract class RoomOptions { /** * @param bool $enableTurn Deprecated, now always considered to be true. * @param string $type * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource's `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be `POST` or `GET`. * @param int $maxParticipants The maximum number of concurrent Participants allowed in the room. Peer-to-peer rooms can have up to 10 Participants. Small Group rooms can have up to 4 Participants. Group rooms can have up to 50 Participants. * @param bool $recordParticipantsOnConnect Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** * @param string $videoCodecs An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** * @param string $mediaRegion The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.*** * @param array $recordingRules A collection of Recording Rules that describe how to include or exclude matching tracks for recording * @param bool $audioOnly When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. Group rooms only. * @param int $maxParticipantDuration The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). * @param int $emptyRoomTimeout Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). * @param int $unusedRoomTimeout Configures how long (in minutes) a room will remain active if no one joins. Valid values range from 1 to 60 minutes (no fractions). * @param bool $largeRoom When set to true, indicated that this is the large room. * @return CreateRoomOptions Options builder */ public static function create( bool $enableTurn = Values::BOOL_NONE, string $type = Values::NONE, string $uniqueName = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, int $maxParticipants = Values::INT_NONE, bool $recordParticipantsOnConnect = Values::BOOL_NONE, array $videoCodecs = Values::ARRAY_NONE, string $mediaRegion = Values::NONE, array $recordingRules = Values::ARRAY_NONE, bool $audioOnly = Values::BOOL_NONE, int $maxParticipantDuration = Values::INT_NONE, int $emptyRoomTimeout = Values::INT_NONE, int $unusedRoomTimeout = Values::INT_NONE, bool $largeRoom = Values::BOOL_NONE ): CreateRoomOptions { return new CreateRoomOptions( $enableTurn, $type, $uniqueName, $statusCallback, $statusCallbackMethod, $maxParticipants, $recordParticipantsOnConnect, $videoCodecs, $mediaRegion, $recordingRules, $audioOnly, $maxParticipantDuration, $emptyRoomTimeout, $unusedRoomTimeout, $largeRoom ); } /** * @param string $status Read only the rooms with this status. Can be: `in-progress` (default) or `completed` * @param string $uniqueName Read only rooms with the this `unique_name`. * @param \DateTime $dateCreatedAfter Read only rooms that started on or after this date, given as `YYYY-MM-DD`. * @param \DateTime $dateCreatedBefore Read only rooms that started before this date, given as `YYYY-MM-DD`. * @return ReadRoomOptions Options builder */ public static function read( string $status = Values::NONE, string $uniqueName = Values::NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null ): ReadRoomOptions { return new ReadRoomOptions( $status, $uniqueName, $dateCreatedAfter, $dateCreatedBefore ); } } class CreateRoomOptions extends Options { /** * @param bool $enableTurn Deprecated, now always considered to be true. * @param string $type * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource's `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be `POST` or `GET`. * @param int $maxParticipants The maximum number of concurrent Participants allowed in the room. Peer-to-peer rooms can have up to 10 Participants. Small Group rooms can have up to 4 Participants. Group rooms can have up to 50 Participants. * @param bool $recordParticipantsOnConnect Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** * @param string $videoCodecs An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** * @param string $mediaRegion The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.*** * @param array $recordingRules A collection of Recording Rules that describe how to include or exclude matching tracks for recording * @param bool $audioOnly When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. Group rooms only. * @param int $maxParticipantDuration The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). * @param int $emptyRoomTimeout Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). * @param int $unusedRoomTimeout Configures how long (in minutes) a room will remain active if no one joins. Valid values range from 1 to 60 minutes (no fractions). * @param bool $largeRoom When set to true, indicated that this is the large room. */ public function __construct( bool $enableTurn = Values::BOOL_NONE, string $type = Values::NONE, string $uniqueName = Values::NONE, string $statusCallback = Values::NONE, string $statusCallbackMethod = Values::NONE, int $maxParticipants = Values::INT_NONE, bool $recordParticipantsOnConnect = Values::BOOL_NONE, array $videoCodecs = Values::ARRAY_NONE, string $mediaRegion = Values::NONE, array $recordingRules = Values::ARRAY_NONE, bool $audioOnly = Values::BOOL_NONE, int $maxParticipantDuration = Values::INT_NONE, int $emptyRoomTimeout = Values::INT_NONE, int $unusedRoomTimeout = Values::INT_NONE, bool $largeRoom = Values::BOOL_NONE ) { $this->options['enableTurn'] = $enableTurn; $this->options['type'] = $type; $this->options['uniqueName'] = $uniqueName; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['maxParticipants'] = $maxParticipants; $this->options['recordParticipantsOnConnect'] = $recordParticipantsOnConnect; $this->options['videoCodecs'] = $videoCodecs; $this->options['mediaRegion'] = $mediaRegion; $this->options['recordingRules'] = $recordingRules; $this->options['audioOnly'] = $audioOnly; $this->options['maxParticipantDuration'] = $maxParticipantDuration; $this->options['emptyRoomTimeout'] = $emptyRoomTimeout; $this->options['unusedRoomTimeout'] = $unusedRoomTimeout; $this->options['largeRoom'] = $largeRoom; } /** * Deprecated, now always considered to be true. * * @param bool $enableTurn Deprecated, now always considered to be true. * @return $this Fluent Builder */ public function setEnableTurn(bool $enableTurn): self { $this->options['enableTurn'] = $enableTurn; return $this; } /** * @param string $type * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource's `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource's `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. * * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be `POST` or `GET`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be `POST` or `GET`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The maximum number of concurrent Participants allowed in the room. Peer-to-peer rooms can have up to 10 Participants. Small Group rooms can have up to 4 Participants. Group rooms can have up to 50 Participants. * * @param int $maxParticipants The maximum number of concurrent Participants allowed in the room. Peer-to-peer rooms can have up to 10 Participants. Small Group rooms can have up to 4 Participants. Group rooms can have up to 50 Participants. * @return $this Fluent Builder */ public function setMaxParticipants(int $maxParticipants): self { $this->options['maxParticipants'] = $maxParticipants; return $this; } /** * Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** * * @param bool $recordParticipantsOnConnect Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** * @return $this Fluent Builder */ public function setRecordParticipantsOnConnect(bool $recordParticipantsOnConnect): self { $this->options['recordParticipantsOnConnect'] = $recordParticipantsOnConnect; return $this; } /** * An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** * * @param string $videoCodecs An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** * @return $this Fluent Builder */ public function setVideoCodecs(array $videoCodecs): self { $this->options['videoCodecs'] = $videoCodecs; return $this; } /** * The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.*** * * @param string $mediaRegion The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.*** * @return $this Fluent Builder */ public function setMediaRegion(string $mediaRegion): self { $this->options['mediaRegion'] = $mediaRegion; return $this; } /** * A collection of Recording Rules that describe how to include or exclude matching tracks for recording * * @param array $recordingRules A collection of Recording Rules that describe how to include or exclude matching tracks for recording * @return $this Fluent Builder */ public function setRecordingRules(array $recordingRules): self { $this->options['recordingRules'] = $recordingRules; return $this; } /** * When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. Group rooms only. * * @param bool $audioOnly When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. Group rooms only. * @return $this Fluent Builder */ public function setAudioOnly(bool $audioOnly): self { $this->options['audioOnly'] = $audioOnly; return $this; } /** * The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). * * @param int $maxParticipantDuration The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). * @return $this Fluent Builder */ public function setMaxParticipantDuration(int $maxParticipantDuration): self { $this->options['maxParticipantDuration'] = $maxParticipantDuration; return $this; } /** * Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). * * @param int $emptyRoomTimeout Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). * @return $this Fluent Builder */ public function setEmptyRoomTimeout(int $emptyRoomTimeout): self { $this->options['emptyRoomTimeout'] = $emptyRoomTimeout; return $this; } /** * Configures how long (in minutes) a room will remain active if no one joins. Valid values range from 1 to 60 minutes (no fractions). * * @param int $unusedRoomTimeout Configures how long (in minutes) a room will remain active if no one joins. Valid values range from 1 to 60 minutes (no fractions). * @return $this Fluent Builder */ public function setUnusedRoomTimeout(int $unusedRoomTimeout): self { $this->options['unusedRoomTimeout'] = $unusedRoomTimeout; return $this; } /** * When set to true, indicated that this is the large room. * * @param bool $largeRoom When set to true, indicated that this is the large room. * @return $this Fluent Builder */ public function setLargeRoom(bool $largeRoom): self { $this->options['largeRoom'] = $largeRoom; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.CreateRoomOptions ' . $options . ']'; } } class ReadRoomOptions extends Options { /** * @param string $status Read only the rooms with this status. Can be: `in-progress` (default) or `completed` * @param string $uniqueName Read only rooms with the this `unique_name`. * @param \DateTime $dateCreatedAfter Read only rooms that started on or after this date, given as `YYYY-MM-DD`. * @param \DateTime $dateCreatedBefore Read only rooms that started before this date, given as `YYYY-MM-DD`. */ public function __construct( string $status = Values::NONE, string $uniqueName = Values::NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null ) { $this->options['status'] = $status; $this->options['uniqueName'] = $uniqueName; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; } /** * Read only the rooms with this status. Can be: `in-progress` (default) or `completed` * * @param string $status Read only the rooms with this status. Can be: `in-progress` (default) or `completed` * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Read only rooms with the this `unique_name`. * * @param string $uniqueName Read only rooms with the this `unique_name`. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Read only rooms that started on or after this date, given as `YYYY-MM-DD`. * * @param \DateTime $dateCreatedAfter Read only rooms that started on or after this date, given as `YYYY-MM-DD`. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only rooms that started before this date, given as `YYYY-MM-DD`. * * @param \DateTime $dateCreatedBefore Read only rooms that started before this date, given as `YYYY-MM-DD`. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Video.V1.ReadRoomOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingInstance.php 0000644 00000012137 15021223077 0015751 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string $status * @property \DateTime|null $dateCreated * @property string|null $sid * @property string|null $sourceSid * @property int|null $size * @property string|null $url * @property string $type * @property int|null $duration * @property string $containerFormat * @property string $codec * @property array|null $groupingSids * @property string|null $trackName * @property int|null $offset * @property string|null $mediaExternalLocation * @property string|null $statusCallback * @property string|null $statusCallbackMethod * @property array|null $links */ class RecordingInstance extends InstanceResource { /** * Initialize the RecordingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Recording resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'sid' => Values::array_get($payload, 'sid'), 'sourceSid' => Values::array_get($payload, 'source_sid'), 'size' => Values::array_get($payload, 'size'), 'url' => Values::array_get($payload, 'url'), 'type' => Values::array_get($payload, 'type'), 'duration' => Values::array_get($payload, 'duration'), 'containerFormat' => Values::array_get($payload, 'container_format'), 'codec' => Values::array_get($payload, 'codec'), 'groupingSids' => Values::array_get($payload, 'grouping_sids'), 'trackName' => Values::array_get($payload, 'track_name'), 'offset' => Values::array_get($payload, 'offset'), 'mediaExternalLocation' => Values::array_get($payload, 'media_external_location'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RecordingContext Context for this RecordingInstance */ protected function proxy(): RecordingContext { if (!$this->context) { $this->context = new RecordingContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the RecordingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RecordingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionSettingsContext.php 0000644 00000006262 15021223077 0017743 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class CompositionSettingsContext extends InstanceContext { /** * Initialize the CompositionSettingsContext * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/CompositionSettings/Default'; } /** * Create the CompositionSettingsInstance * * @param string $friendlyName A descriptive string that you create to describe the resource and show to the user in the console * @param array|Options $options Optional Arguments * @return CompositionSettingsInstance Created CompositionSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): CompositionSettingsInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'AwsCredentialsSid' => $options['awsCredentialsSid'], 'EncryptionKeySid' => $options['encryptionKeySid'], 'AwsS3Url' => $options['awsS3Url'], 'AwsStorageEnabled' => Serialize::booleanToString($options['awsStorageEnabled']), 'EncryptionEnabled' => Serialize::booleanToString($options['encryptionEnabled']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CompositionSettingsInstance( $this->version, $payload ); } /** * Fetch the CompositionSettingsInstance * * @return CompositionSettingsInstance Fetched CompositionSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionSettingsInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CompositionSettingsInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionSettingsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1.php 0000644 00000011016 15021223077 0012343 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Video * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Video; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Video\V1\CompositionList; use Twilio\Rest\Video\V1\CompositionHookList; use Twilio\Rest\Video\V1\CompositionSettingsList; use Twilio\Rest\Video\V1\RecordingList; use Twilio\Rest\Video\V1\RecordingSettingsList; use Twilio\Rest\Video\V1\RoomList; use Twilio\Version; /** * @property CompositionList $compositions * @property CompositionHookList $compositionHooks * @property CompositionSettingsList $compositionSettings * @property RecordingList $recordings * @property RecordingSettingsList $recordingSettings * @property RoomList $rooms * @method \Twilio\Rest\Video\V1\CompositionContext compositions(string $sid) * @method \Twilio\Rest\Video\V1\CompositionHookContext compositionHooks(string $sid) * @method \Twilio\Rest\Video\V1\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Video\V1\RoomContext rooms(string $sid) */ class V1 extends Version { protected $_compositions; protected $_compositionHooks; protected $_compositionSettings; protected $_recordings; protected $_recordingSettings; protected $_rooms; /** * Construct the V1 version of Video * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getCompositions(): CompositionList { if (!$this->_compositions) { $this->_compositions = new CompositionList($this); } return $this->_compositions; } protected function getCompositionHooks(): CompositionHookList { if (!$this->_compositionHooks) { $this->_compositionHooks = new CompositionHookList($this); } return $this->_compositionHooks; } protected function getCompositionSettings(): CompositionSettingsList { if (!$this->_compositionSettings) { $this->_compositionSettings = new CompositionSettingsList($this); } return $this->_compositionSettings; } protected function getRecordings(): RecordingList { if (!$this->_recordings) { $this->_recordings = new RecordingList($this); } return $this->_recordings; } protected function getRecordingSettings(): RecordingSettingsList { if (!$this->_recordingSettings) { $this->_recordingSettings = new RecordingSettingsList($this); } return $this->_recordingSettings; } protected function getRooms(): RoomList { if (!$this->_rooms) { $this->_rooms = new RoomList($this); } return $this->_rooms; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video.V1]'; } } sdk/src/Twilio/Rest/EventsBase.php 0000644 00000004522 15021223077 0013052 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Events\V1; /** * @property \Twilio\Rest\Events\V1 $v1 */ class EventsBase extends Domain { protected $_v1; /** * Construct the Events Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://events.twilio.com'; } /** * @return V1 Version v1 of events */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events]'; } } sdk/src/Twilio/Rest/Voice/V1/ArchivedCallList.php 0000644 00000003150 15021223077 0015517 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\ListResource; use Twilio\Version; class ArchivedCallList extends ListResource { /** * Construct the ArchivedCallList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a ArchivedCallContext * * @param \DateTime $date The date of the Call in UTC. * * @param string $sid The Twilio-provided Call SID that uniquely identifies the Call resource to delete */ public function getContext( \DateTime $date , string $sid ): ArchivedCallContext { return new ArchivedCallContext( $this->version, $date, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.ArchivedCallList]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsInstance.php 0000644 00000003471 15021223077 0017640 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Version; class DialingPermissionsInstance extends InstanceResource { /** * Initialize the DialingPermissionsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.DialingPermissionsInstance]'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyList.php 0000644 00000013764 15021223077 0016471 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ConnectionPolicyList extends ListResource { /** * Construct the ConnectionPolicyList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/ConnectionPolicies'; } /** * Create the ConnectionPolicyInstance * * @param array|Options $options Optional Arguments * @return ConnectionPolicyInstance Created ConnectionPolicyInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ConnectionPolicyInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ConnectionPolicyInstance( $this->version, $payload ); } /** * Reads ConnectionPolicyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConnectionPolicyInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ConnectionPolicyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ConnectionPolicyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConnectionPolicyPage Page of ConnectionPolicyInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ConnectionPolicyPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ConnectionPolicyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConnectionPolicyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ConnectionPolicyPage Page of ConnectionPolicyInstance */ public function getPage(string $targetUrl): ConnectionPolicyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConnectionPolicyPage($this->version, $response, $this->solution); } /** * Constructs a ConnectionPolicyContext * * @param string $sid The unique string that we created to identify the Connection Policy resource to delete. */ public function getContext( string $sid ): ConnectionPolicyContext { return new ConnectionPolicyContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.ConnectionPolicyList]'; } } sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingInstance.php 0000644 00000010673 15021223077 0017104 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $ipRecordSid * @property string|null $sipDomainSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class SourceIpMappingInstance extends InstanceResource { /** * Initialize the SourceIpMappingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The Twilio-provided string that uniquely identifies the IP Record resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'ipRecordSid' => Values::array_get($payload, 'ip_record_sid'), 'sipDomainSid' => Values::array_get($payload, 'sip_domain_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SourceIpMappingContext Context for this SourceIpMappingInstance */ protected function proxy(): SourceIpMappingContext { if (!$this->context) { $this->context = new SourceIpMappingContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the SourceIpMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SourceIpMappingInstance * * @return SourceIpMappingInstance Fetched SourceIpMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SourceIpMappingInstance { return $this->proxy()->fetch(); } /** * Update the SourceIpMappingInstance * * @param string $sipDomainSid The SID of the SIP Domain that the IP Record should be mapped to. * @return SourceIpMappingInstance Updated SourceIpMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $sipDomainSid): SourceIpMappingInstance { return $this->proxy()->update($sipDomainSid); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.SourceIpMappingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ArchivedCallInstance.php 0000644 00000006104 15021223077 0016352 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Version; class ArchivedCallInstance extends InstanceResource { /** * Initialize the ArchivedCallInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param \DateTime $date The date of the Call in UTC. * @param string $sid The Twilio-provided Call SID that uniquely identifies the Call resource to delete */ public function __construct(Version $version, array $payload, \DateTime $date = null, string $sid = null) { parent::__construct($version); $this->solution = ['date' => $date ?: $this->properties['date'], 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ArchivedCallContext Context for this ArchivedCallInstance */ protected function proxy(): ArchivedCallContext { if (!$this->context) { $this->context = new ArchivedCallContext( $this->version, $this->solution['date'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ArchivedCallInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.ArchivedCallInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/IpRecordPage.php 0000644 00000003014 15021223077 0014645 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class IpRecordPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return IpRecordInstance \Twilio\Rest\Voice\V1\IpRecordInstance */ public function buildInstance(array $payload): IpRecordInstance { return new IpRecordInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.IpRecordPage]'; } } sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingContext.php 0000644 00000006047 15021223077 0016764 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class SourceIpMappingContext extends InstanceContext { /** * Initialize the SourceIpMappingContext * * @param Version $version Version that contains the resource * @param string $sid The Twilio-provided string that uniquely identifies the IP Record resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/SourceIpMappings/' . \rawurlencode($sid) .''; } /** * Delete the SourceIpMappingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SourceIpMappingInstance * * @return SourceIpMappingInstance Fetched SourceIpMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SourceIpMappingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SourceIpMappingInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the SourceIpMappingInstance * * @param string $sipDomainSid The SID of the SIP Domain that the IP Record should be mapped to. * @return SourceIpMappingInstance Updated SourceIpMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $sipDomainSid): SourceIpMappingInstance { $data = Values::of([ 'SipDomainSid' => $sipDomainSid, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SourceIpMappingInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.SourceIpMappingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ByocTrunkPage.php 0000644 00000003022 15021223077 0015055 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ByocTrunkPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ByocTrunkInstance \Twilio\Rest\Voice\V1\ByocTrunkInstance */ public function buildInstance(array $payload): ByocTrunkInstance { return new ByocTrunkInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.ByocTrunkPage]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsList.php 0000644 00000007447 15021223077 0017016 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Voice\V1\DialingPermissions\BulkCountryUpdateList; use Twilio\Rest\Voice\V1\DialingPermissions\CountryList; use Twilio\Rest\Voice\V1\DialingPermissions\SettingsList; /** * @property BulkCountryUpdateList $bulkCountryUpdates * @property CountryList $countries * @property SettingsList $settings * @method \Twilio\Rest\Voice\V1\DialingPermissions\CountryContext countries(string $isoCode) * @method \Twilio\Rest\Voice\V1\DialingPermissions\SettingsContext settings() */ class DialingPermissionsList extends ListResource { protected $_bulkCountryUpdates = null; protected $_countries = null; protected $_settings = null; /** * Construct the DialingPermissionsList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Access the bulkCountryUpdates */ protected function getBulkCountryUpdates(): BulkCountryUpdateList { if (!$this->_bulkCountryUpdates) { $this->_bulkCountryUpdates = new BulkCountryUpdateList( $this->version ); } return $this->_bulkCountryUpdates; } /** * Access the countries */ protected function getCountries(): CountryList { if (!$this->_countries) { $this->_countries = new CountryList( $this->version ); } return $this->_countries; } /** * Access the settings */ protected function getSettings(): SettingsList { if (!$this->_settings) { $this->_settings = new SettingsList( $this->version ); } return $this->_settings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.DialingPermissionsList]'; } } sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingList.php 0000644 00000014207 15021223077 0016250 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SourceIpMappingList extends ListResource { /** * Construct the SourceIpMappingList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/SourceIpMappings'; } /** * Create the SourceIpMappingInstance * * @param string $ipRecordSid The Twilio-provided string that uniquely identifies the IP Record resource to map from. * @param string $sipDomainSid The SID of the SIP Domain that the IP Record should be mapped to. * @return SourceIpMappingInstance Created SourceIpMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $ipRecordSid, string $sipDomainSid): SourceIpMappingInstance { $data = Values::of([ 'IpRecordSid' => $ipRecordSid, 'SipDomainSid' => $sipDomainSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SourceIpMappingInstance( $this->version, $payload ); } /** * Reads SourceIpMappingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SourceIpMappingInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SourceIpMappingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SourceIpMappingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SourceIpMappingPage Page of SourceIpMappingInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SourceIpMappingPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SourceIpMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SourceIpMappingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SourceIpMappingPage Page of SourceIpMappingInstance */ public function getPage(string $targetUrl): SourceIpMappingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SourceIpMappingPage($this->version, $response, $this->solution); } /** * Constructs a SourceIpMappingContext * * @param string $sid The Twilio-provided string that uniquely identifies the IP Record resource to delete. */ public function getContext( string $sid ): SourceIpMappingContext { return new SourceIpMappingContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.SourceIpMappingList]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsContext.php 0000644 00000005023 15021223077 0021313 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class SettingsContext extends InstanceContext { /** * Initialize the SettingsContext * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Settings'; } /** * Fetch the SettingsInstance * * @return SettingsInstance Fetched SettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SettingsInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SettingsInstance( $this->version, $payload ); } /** * Update the SettingsInstance * * @param array|Options $options Optional Arguments * @return SettingsInstance Updated SettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SettingsInstance { $options = new Values($options); $data = Values::of([ 'DialingPermissionsInheritance' => Serialize::booleanToString($options['dialingPermissionsInheritance']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SettingsInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.SettingsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsList.php 0000644 00000002533 15021223077 0020605 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\ListResource; use Twilio\Version; class SettingsList extends ListResource { /** * Construct the SettingsList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a SettingsContext */ public function getContext( ): SettingsContext { return new SettingsContext( $this->version ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.SettingsList]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsOptions.php 0000644 00000004561 15021223077 0021330 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Options; use Twilio\Values; abstract class SettingsOptions { /** * @param bool $dialingPermissionsInheritance `true` for the sub-account to inherit voice dialing permissions from the Master Project; otherwise `false`. * @return UpdateSettingsOptions Options builder */ public static function update( bool $dialingPermissionsInheritance = Values::BOOL_NONE ): UpdateSettingsOptions { return new UpdateSettingsOptions( $dialingPermissionsInheritance ); } } class UpdateSettingsOptions extends Options { /** * @param bool $dialingPermissionsInheritance `true` for the sub-account to inherit voice dialing permissions from the Master Project; otherwise `false`. */ public function __construct( bool $dialingPermissionsInheritance = Values::BOOL_NONE ) { $this->options['dialingPermissionsInheritance'] = $dialingPermissionsInheritance; } /** * `true` for the sub-account to inherit voice dialing permissions from the Master Project; otherwise `false`. * * @param bool $dialingPermissionsInheritance `true` for the sub-account to inherit voice dialing permissions from the Master Project; otherwise `false`. * @return $this Fluent Builder */ public function setDialingPermissionsInheritance(bool $dialingPermissionsInheritance): self { $this->options['dialingPermissionsInheritance'] = $dialingPermissionsInheritance; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.UpdateSettingsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsPage.php 0000644 00000003062 15021223077 0020544 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SettingsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SettingsInstance \Twilio\Rest\Voice\V1\DialingPermissions\SettingsInstance */ public function buildInstance(array $payload): SettingsInstance { return new SettingsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.SettingsPage]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsInstance.php 0000644 00000006632 15021223077 0021442 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property bool|null $dialingPermissionsInheritance * @property string|null $url */ class SettingsInstance extends InstanceResource { /** * Initialize the SettingsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'dialingPermissionsInheritance' => Values::array_get($payload, 'dialing_permissions_inheritance'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = []; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SettingsContext Context for this SettingsInstance */ protected function proxy(): SettingsContext { if (!$this->context) { $this->context = new SettingsContext( $this->version ); } return $this->context; } /** * Fetch the SettingsInstance * * @return SettingsInstance Fetched SettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SettingsInstance { return $this->proxy()->fetch(); } /** * Update the SettingsInstance * * @param array|Options $options Optional Arguments * @return SettingsInstance Updated SettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SettingsInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.SettingsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryOptions.php 0000644 00000017242 15021223077 0021173 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Options; use Twilio\Values; abstract class CountryOptions { /** * @param string $isoCode Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) * @param string $continent Filter to retrieve the country permissions by specifying the continent * @param string $countryCode Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) * @param bool $lowRiskNumbersEnabled Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. * @param bool $highRiskSpecialNumbersEnabled Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` * @param bool $highRiskTollfraudNumbersEnabled Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers enabled. Can be: `true` or `false`. * @return ReadCountryOptions Options builder */ public static function read( string $isoCode = Values::NONE, string $continent = Values::NONE, string $countryCode = Values::NONE, bool $lowRiskNumbersEnabled = Values::BOOL_NONE, bool $highRiskSpecialNumbersEnabled = Values::BOOL_NONE, bool $highRiskTollfraudNumbersEnabled = Values::BOOL_NONE ): ReadCountryOptions { return new ReadCountryOptions( $isoCode, $continent, $countryCode, $lowRiskNumbersEnabled, $highRiskSpecialNumbersEnabled, $highRiskTollfraudNumbersEnabled ); } } class ReadCountryOptions extends Options { /** * @param string $isoCode Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) * @param string $continent Filter to retrieve the country permissions by specifying the continent * @param string $countryCode Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) * @param bool $lowRiskNumbersEnabled Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. * @param bool $highRiskSpecialNumbersEnabled Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` * @param bool $highRiskTollfraudNumbersEnabled Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers enabled. Can be: `true` or `false`. */ public function __construct( string $isoCode = Values::NONE, string $continent = Values::NONE, string $countryCode = Values::NONE, bool $lowRiskNumbersEnabled = Values::BOOL_NONE, bool $highRiskSpecialNumbersEnabled = Values::BOOL_NONE, bool $highRiskTollfraudNumbersEnabled = Values::BOOL_NONE ) { $this->options['isoCode'] = $isoCode; $this->options['continent'] = $continent; $this->options['countryCode'] = $countryCode; $this->options['lowRiskNumbersEnabled'] = $lowRiskNumbersEnabled; $this->options['highRiskSpecialNumbersEnabled'] = $highRiskSpecialNumbersEnabled; $this->options['highRiskTollfraudNumbersEnabled'] = $highRiskTollfraudNumbersEnabled; } /** * Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) * * @param string $isoCode Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) * @return $this Fluent Builder */ public function setIsoCode(string $isoCode): self { $this->options['isoCode'] = $isoCode; return $this; } /** * Filter to retrieve the country permissions by specifying the continent * * @param string $continent Filter to retrieve the country permissions by specifying the continent * @return $this Fluent Builder */ public function setContinent(string $continent): self { $this->options['continent'] = $continent; return $this; } /** * Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) * * @param string $countryCode Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) * @return $this Fluent Builder */ public function setCountryCode(string $countryCode): self { $this->options['countryCode'] = $countryCode; return $this; } /** * Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. * * @param bool $lowRiskNumbersEnabled Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setLowRiskNumbersEnabled(bool $lowRiskNumbersEnabled): self { $this->options['lowRiskNumbersEnabled'] = $lowRiskNumbersEnabled; return $this; } /** * Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` * * @param bool $highRiskSpecialNumbersEnabled Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` * @return $this Fluent Builder */ public function setHighRiskSpecialNumbersEnabled(bool $highRiskSpecialNumbersEnabled): self { $this->options['highRiskSpecialNumbersEnabled'] = $highRiskSpecialNumbersEnabled; return $this; } /** * Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers enabled. Can be: `true` or `false`. * * @param bool $highRiskTollfraudNumbersEnabled Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers enabled. Can be: `true` or `false`. * @return $this Fluent Builder */ public function setHighRiskTollfraudNumbersEnabled(bool $highRiskTollfraudNumbersEnabled): self { $this->options['highRiskTollfraudNumbersEnabled'] = $highRiskTollfraudNumbersEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.ReadCountryOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateList.php 0000644 00000004212 15021223077 0022425 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class BulkCountryUpdateList extends ListResource { /** * Construct the BulkCountryUpdateList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/DialingPermissions/BulkCountryUpdates'; } /** * Create the BulkCountryUpdateInstance * * @param string $updateRequest URL encoded JSON array of update objects. example : `[ { \\\"iso_code\\\": \\\"GB\\\", \\\"low_risk_numbers_enabled\\\": \\\"true\\\", \\\"high_risk_special_numbers_enabled\\\":\\\"true\\\", \\\"high_risk_tollfraud_numbers_enabled\\\": \\\"false\\\" } ]` * @return BulkCountryUpdateInstance Created BulkCountryUpdateInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $updateRequest): BulkCountryUpdateInstance { $data = Values::of([ 'UpdateRequest' => $updateRequest, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BulkCountryUpdateInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.BulkCountryUpdateList]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryInstance.php 0000644 00000010647 15021223077 0021306 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Rest\Voice\V1\DialingPermissions\Country\HighriskSpecialPrefixList; /** * @property string|null $isoCode * @property string|null $name * @property string|null $continent * @property string[]|null $countryCodes * @property bool|null $lowRiskNumbersEnabled * @property bool|null $highRiskSpecialNumbersEnabled * @property bool|null $highRiskTollfraudNumbersEnabled * @property string|null $url * @property array|null $links */ class CountryInstance extends InstanceResource { protected $_highriskSpecialPrefixes; /** * Initialize the CountryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCode The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the DialingPermissions Country resource to fetch */ public function __construct(Version $version, array $payload, string $isoCode = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'isoCode' => Values::array_get($payload, 'iso_code'), 'name' => Values::array_get($payload, 'name'), 'continent' => Values::array_get($payload, 'continent'), 'countryCodes' => Values::array_get($payload, 'country_codes'), 'lowRiskNumbersEnabled' => Values::array_get($payload, 'low_risk_numbers_enabled'), 'highRiskSpecialNumbersEnabled' => Values::array_get($payload, 'high_risk_special_numbers_enabled'), 'highRiskTollfraudNumbersEnabled' => Values::array_get($payload, 'high_risk_tollfraud_numbers_enabled'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['isoCode' => $isoCode ?: $this->properties['isoCode'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CountryContext Context for this CountryInstance */ protected function proxy(): CountryContext { if (!$this->context) { $this->context = new CountryContext( $this->version, $this->solution['isoCode'] ); } return $this->context; } /** * Fetch the CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CountryInstance { return $this->proxy()->fetch(); } /** * Access the highriskSpecialPrefixes */ protected function getHighriskSpecialPrefixes(): HighriskSpecialPrefixList { return $this->proxy()->highriskSpecialPrefixes; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.CountryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryPage.php 0000644 00000003054 15021223077 0020410 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CountryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CountryInstance \Twilio\Rest\Voice\V1\DialingPermissions\CountryInstance */ public function buildInstance(array $payload): CountryInstance { return new CountryInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.CountryPage]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixInstance.php 0000644 00000004435 15021223077 0025533 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions\Country; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $prefix */ class HighriskSpecialPrefixInstance extends InstanceResource { /** * Initialize the HighriskSpecialPrefixInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCode The [ISO 3166-1 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) to identify the country permissions from which high-risk special service number prefixes are fetched */ public function __construct(Version $version, array $payload, string $isoCode) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'prefix' => Values::array_get($payload, 'prefix'), ]; $this->solution = ['isoCode' => $isoCode, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.HighriskSpecialPrefixInstance]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixList.php 0000644 00000012545 15021223077 0024703 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions\Country; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class HighriskSpecialPrefixList extends ListResource { /** * Construct the HighriskSpecialPrefixList * * @param Version $version Version that contains the resource * @param string $isoCode The [ISO 3166-1 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) to identify the country permissions from which high-risk special service number prefixes are fetched */ public function __construct( Version $version, string $isoCode ) { parent::__construct($version); // Path Solution $this->solution = [ 'isoCode' => $isoCode, ]; $this->uri = '/DialingPermissions/Countries/' . \rawurlencode($isoCode) .'/HighRiskSpecialPrefixes'; } /** * Reads HighriskSpecialPrefixInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return HighriskSpecialPrefixInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams HighriskSpecialPrefixInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of HighriskSpecialPrefixInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return HighriskSpecialPrefixPage Page of HighriskSpecialPrefixInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): HighriskSpecialPrefixPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new HighriskSpecialPrefixPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of HighriskSpecialPrefixInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return HighriskSpecialPrefixPage Page of HighriskSpecialPrefixInstance */ public function getPage(string $targetUrl): HighriskSpecialPrefixPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new HighriskSpecialPrefixPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.HighriskSpecialPrefixList]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixPage.php 0000644 00000003254 15021223077 0024641 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions\Country; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class HighriskSpecialPrefixPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return HighriskSpecialPrefixInstance \Twilio\Rest\Voice\V1\DialingPermissions\Country\HighriskSpecialPrefixInstance */ public function buildInstance(array $payload): HighriskSpecialPrefixInstance { return new HighriskSpecialPrefixInstance($this->version, $payload, $this->solution['isoCode']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.HighriskSpecialPrefixPage]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateInstance.php 0000644 00000004221 15021223077 0023256 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property int|null $updateCount * @property string|null $updateRequest */ class BulkCountryUpdateInstance extends InstanceResource { /** * Initialize the BulkCountryUpdateInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'updateCount' => Values::array_get($payload, 'update_count'), 'updateRequest' => Values::array_get($payload, 'update_request'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.BulkCountryUpdateInstance]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdatePage.php 0000644 00000003150 15021223077 0022366 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BulkCountryUpdatePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return BulkCountryUpdateInstance \Twilio\Rest\Voice\V1\DialingPermissions\BulkCountryUpdateInstance */ public function buildInstance(array $payload): BulkCountryUpdateInstance { return new BulkCountryUpdateInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.BulkCountryUpdatePage]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryContext.php 0000644 00000007474 15021223077 0021172 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Voice\V1\DialingPermissions\Country\HighriskSpecialPrefixList; /** * @property HighriskSpecialPrefixList $highriskSpecialPrefixes */ class CountryContext extends InstanceContext { protected $_highriskSpecialPrefixes; /** * Initialize the CountryContext * * @param Version $version Version that contains the resource * @param string $isoCode The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the DialingPermissions Country resource to fetch */ public function __construct( Version $version, $isoCode ) { parent::__construct($version); // Path Solution $this->solution = [ 'isoCode' => $isoCode, ]; $this->uri = '/DialingPermissions/Countries/' . \rawurlencode($isoCode) .''; } /** * Fetch the CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CountryInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CountryInstance( $this->version, $payload, $this->solution['isoCode'] ); } /** * Access the highriskSpecialPrefixes */ protected function getHighriskSpecialPrefixes(): HighriskSpecialPrefixList { if (!$this->_highriskSpecialPrefixes) { $this->_highriskSpecialPrefixes = new HighriskSpecialPrefixList( $this->version, $this->solution['isoCode'] ); } return $this->_highriskSpecialPrefixes; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.CountryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryList.php 0000644 00000014040 15021223077 0020444 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/DialingPermissions/Countries'; } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CountryPage Page of CountryInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CountryPage { $options = new Values($options); $params = Values::of([ 'IsoCode' => $options['isoCode'], 'Continent' => $options['continent'], 'CountryCode' => $options['countryCode'], 'LowRiskNumbersEnabled' => Serialize::booleanToString($options['lowRiskNumbersEnabled']), 'HighRiskSpecialNumbersEnabled' => Serialize::booleanToString($options['highRiskSpecialNumbersEnabled']), 'HighRiskTollfraudNumbersEnabled' => Serialize::booleanToString($options['highRiskTollfraudNumbersEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CountryPage Page of CountryInstance */ public function getPage(string $targetUrl): CountryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCode The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the DialingPermissions Country resource to fetch */ public function getContext( string $isoCode ): CountryContext { return new CountryContext( $this->version, $isoCode ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.CountryList]'; } } sdk/src/Twilio/Rest/Voice/V1/ByocTrunkOptions.php 0000644 00000057076 15021223077 0015656 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Options; use Twilio\Values; abstract class ByocTrunkOptions { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @param string $voiceUrl The URL we should call when the BYOC Trunk receives a call. * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @param string $statusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @param string $connectionPolicySid The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. * @param string $fromDomainSid The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". * @return CreateByocTrunkOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $statusCallbackUrl = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $cnamLookupEnabled = Values::BOOL_NONE, string $connectionPolicySid = Values::NONE, string $fromDomainSid = Values::NONE ): CreateByocTrunkOptions { return new CreateByocTrunkOptions( $friendlyName, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $statusCallbackUrl, $statusCallbackMethod, $cnamLookupEnabled, $connectionPolicySid, $fromDomainSid ); } /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @param string $voiceUrl The URL we should call when the BYOC Trunk receives a call. * @param string $voiceMethod The HTTP method we should use to call `voice_url` * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @param string $statusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @param string $connectionPolicySid The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. * @param string $fromDomainSid The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". * @return UpdateByocTrunkOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $statusCallbackUrl = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $cnamLookupEnabled = Values::BOOL_NONE, string $connectionPolicySid = Values::NONE, string $fromDomainSid = Values::NONE ): UpdateByocTrunkOptions { return new UpdateByocTrunkOptions( $friendlyName, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $statusCallbackUrl, $statusCallbackMethod, $cnamLookupEnabled, $connectionPolicySid, $fromDomainSid ); } } class CreateByocTrunkOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @param string $voiceUrl The URL we should call when the BYOC Trunk receives a call. * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @param string $statusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @param string $connectionPolicySid The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. * @param string $fromDomainSid The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". */ public function __construct( string $friendlyName = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $statusCallbackUrl = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $cnamLookupEnabled = Values::BOOL_NONE, string $connectionPolicySid = Values::NONE, string $fromDomainSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['voiceUrl'] = $voiceUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['statusCallbackUrl'] = $statusCallbackUrl; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; $this->options['connectionPolicySid'] = $connectionPolicySid; $this->options['fromDomainSid'] = $fromDomainSid; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The URL we should call when the BYOC Trunk receives a call. * * @param string $voiceUrl The URL we should call when the BYOC Trunk receives a call. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call to pass status parameters (such as call ended) to your application. * * @param string $statusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @return $this Fluent Builder */ public function setStatusCallbackUrl(string $statusCallbackUrl): self { $this->options['statusCallbackUrl'] = $statusCallbackUrl; return $this; } /** * The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @return $this Fluent Builder */ public function setCnamLookupEnabled(bool $cnamLookupEnabled): self { $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; return $this; } /** * The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. * * @param string $connectionPolicySid The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. * @return $this Fluent Builder */ public function setConnectionPolicySid(string $connectionPolicySid): self { $this->options['connectionPolicySid'] = $connectionPolicySid; return $this; } /** * The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". * * @param string $fromDomainSid The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". * @return $this Fluent Builder */ public function setFromDomainSid(string $fromDomainSid): self { $this->options['fromDomainSid'] = $fromDomainSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.CreateByocTrunkOptions ' . $options . ']'; } } class UpdateByocTrunkOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @param string $voiceUrl The URL we should call when the BYOC Trunk receives a call. * @param string $voiceMethod The HTTP method we should use to call `voice_url` * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @param string $statusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @param string $connectionPolicySid The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. * @param string $fromDomainSid The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". */ public function __construct( string $friendlyName = Values::NONE, string $voiceUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $statusCallbackUrl = Values::NONE, string $statusCallbackMethod = Values::NONE, bool $cnamLookupEnabled = Values::BOOL_NONE, string $connectionPolicySid = Values::NONE, string $fromDomainSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['voiceUrl'] = $voiceUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['statusCallbackUrl'] = $statusCallbackUrl; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; $this->options['connectionPolicySid'] = $connectionPolicySid; $this->options['fromDomainSid'] = $fromDomainSid; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The URL we should call when the BYOC Trunk receives a call. * * @param string $voiceUrl The URL we should call when the BYOC Trunk receives a call. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method we should use to call `voice_url` * * @param string $voiceMethod The HTTP method we should use to call `voice_url` * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. * * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call to pass status parameters (such as call ended) to your application. * * @param string $statusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. * @return $this Fluent Builder */ public function setStatusCallbackUrl(string $statusCallbackUrl): self { $this->options['statusCallbackUrl'] = $statusCallbackUrl; return $this; } /** * The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * @return $this Fluent Builder */ public function setCnamLookupEnabled(bool $cnamLookupEnabled): self { $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; return $this; } /** * The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. * * @param string $connectionPolicySid The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. * @return $this Fluent Builder */ public function setConnectionPolicySid(string $connectionPolicySid): self { $this->options['connectionPolicySid'] = $connectionPolicySid; return $this; } /** * The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". * * @param string $fromDomainSid The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". * @return $this Fluent Builder */ public function setFromDomainSid(string $fromDomainSid): self { $this->options['fromDomainSid'] = $fromDomainSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.UpdateByocTrunkOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsPage.php 0000644 00000003110 15021223077 0016736 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DialingPermissionsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DialingPermissionsInstance \Twilio\Rest\Voice\V1\DialingPermissionsInstance */ public function buildInstance(array $payload): DialingPermissionsInstance { return new DialingPermissionsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.DialingPermissionsPage]'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetContext.php 0000644 00000007473 15021223077 0023630 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\ConnectionPolicy; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class ConnectionPolicyTargetContext extends InstanceContext { /** * Initialize the ConnectionPolicyTargetContext * * @param Version $version Version that contains the resource * @param string $connectionPolicySid The SID of the Connection Policy that owns the Target. * @param string $sid The unique string that we created to identify the Target resource to delete. */ public function __construct( Version $version, $connectionPolicySid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'connectionPolicySid' => $connectionPolicySid, 'sid' => $sid, ]; $this->uri = '/ConnectionPolicies/' . \rawurlencode($connectionPolicySid) .'/Targets/' . \rawurlencode($sid) .''; } /** * Delete the ConnectionPolicyTargetInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ConnectionPolicyTargetInstance * * @return ConnectionPolicyTargetInstance Fetched ConnectionPolicyTargetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConnectionPolicyTargetInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConnectionPolicyTargetInstance( $this->version, $payload, $this->solution['connectionPolicySid'], $this->solution['sid'] ); } /** * Update the ConnectionPolicyTargetInstance * * @param array|Options $options Optional Arguments * @return ConnectionPolicyTargetInstance Updated ConnectionPolicyTargetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConnectionPolicyTargetInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'Target' => $options['target'], 'Priority' => $options['priority'], 'Weight' => $options['weight'], 'Enabled' => Serialize::booleanToString($options['enabled']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ConnectionPolicyTargetInstance( $this->version, $payload, $this->solution['connectionPolicySid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.ConnectionPolicyTargetContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetInstance.php 0000644 00000012376 15021223077 0023746 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\ConnectionPolicy; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $connectionPolicySid * @property string|null $sid * @property string|null $friendlyName * @property string|null $target * @property int|null $priority * @property int|null $weight * @property bool|null $enabled * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class ConnectionPolicyTargetInstance extends InstanceResource { /** * Initialize the ConnectionPolicyTargetInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $connectionPolicySid The SID of the Connection Policy that owns the Target. * @param string $sid The unique string that we created to identify the Target resource to delete. */ public function __construct(Version $version, array $payload, string $connectionPolicySid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'connectionPolicySid' => Values::array_get($payload, 'connection_policy_sid'), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'target' => Values::array_get($payload, 'target'), 'priority' => Values::array_get($payload, 'priority'), 'weight' => Values::array_get($payload, 'weight'), 'enabled' => Values::array_get($payload, 'enabled'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['connectionPolicySid' => $connectionPolicySid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ConnectionPolicyTargetContext Context for this ConnectionPolicyTargetInstance */ protected function proxy(): ConnectionPolicyTargetContext { if (!$this->context) { $this->context = new ConnectionPolicyTargetContext( $this->version, $this->solution['connectionPolicySid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ConnectionPolicyTargetInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ConnectionPolicyTargetInstance * * @return ConnectionPolicyTargetInstance Fetched ConnectionPolicyTargetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConnectionPolicyTargetInstance { return $this->proxy()->fetch(); } /** * Update the ConnectionPolicyTargetInstance * * @param array|Options $options Optional Arguments * @return ConnectionPolicyTargetInstance Updated ConnectionPolicyTargetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConnectionPolicyTargetInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.ConnectionPolicyTargetInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetOptions.php 0000644 00000026125 15021223077 0023632 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\ConnectionPolicy; use Twilio\Options; use Twilio\Values; abstract class ConnectionPolicyTargetOptions { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @param int $priority The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target. * @param int $weight The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority. * @param bool $enabled Whether the Target is enabled. The default is `true`. * @return CreateConnectionPolicyTargetOptions Options builder */ public static function create( string $friendlyName = Values::NONE, int $priority = Values::INT_NONE, int $weight = Values::INT_NONE, bool $enabled = Values::BOOL_NONE ): CreateConnectionPolicyTargetOptions { return new CreateConnectionPolicyTargetOptions( $friendlyName, $priority, $weight, $enabled ); } /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @param string $target The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. * @param int $priority The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target. * @param int $weight The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority. * @param bool $enabled Whether the Target is enabled. * @return UpdateConnectionPolicyTargetOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $target = Values::NONE, int $priority = Values::INT_NONE, int $weight = Values::INT_NONE, bool $enabled = Values::BOOL_NONE ): UpdateConnectionPolicyTargetOptions { return new UpdateConnectionPolicyTargetOptions( $friendlyName, $target, $priority, $weight, $enabled ); } } class CreateConnectionPolicyTargetOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @param int $priority The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target. * @param int $weight The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority. * @param bool $enabled Whether the Target is enabled. The default is `true`. */ public function __construct( string $friendlyName = Values::NONE, int $priority = Values::INT_NONE, int $weight = Values::INT_NONE, bool $enabled = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['priority'] = $priority; $this->options['weight'] = $weight; $this->options['enabled'] = $enabled; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target. * * @param int $priority The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target. * @return $this Fluent Builder */ public function setPriority(int $priority): self { $this->options['priority'] = $priority; return $this; } /** * The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority. * * @param int $weight The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority. * @return $this Fluent Builder */ public function setWeight(int $weight): self { $this->options['weight'] = $weight; return $this; } /** * Whether the Target is enabled. The default is `true`. * * @param bool $enabled Whether the Target is enabled. The default is `true`. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.CreateConnectionPolicyTargetOptions ' . $options . ']'; } } class UpdateConnectionPolicyTargetOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @param string $target The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. * @param int $priority The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target. * @param int $weight The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority. * @param bool $enabled Whether the Target is enabled. */ public function __construct( string $friendlyName = Values::NONE, string $target = Values::NONE, int $priority = Values::INT_NONE, int $weight = Values::INT_NONE, bool $enabled = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['target'] = $target; $this->options['priority'] = $priority; $this->options['weight'] = $weight; $this->options['enabled'] = $enabled; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. * * @param string $target The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. * @return $this Fluent Builder */ public function setTarget(string $target): self { $this->options['target'] = $target; return $this; } /** * The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target. * * @param int $priority The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target. * @return $this Fluent Builder */ public function setPriority(int $priority): self { $this->options['priority'] = $priority; return $this; } /** * The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority. * * @param int $weight The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority. * @return $this Fluent Builder */ public function setWeight(int $weight): self { $this->options['weight'] = $weight; return $this; } /** * Whether the Target is enabled. * * @param bool $enabled Whether the Target is enabled. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.UpdateConnectionPolicyTargetOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetPage.php 0000644 00000003252 15021223077 0023047 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\ConnectionPolicy; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConnectionPolicyTargetPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ConnectionPolicyTargetInstance \Twilio\Rest\Voice\V1\ConnectionPolicy\ConnectionPolicyTargetInstance */ public function buildInstance(array $payload): ConnectionPolicyTargetInstance { return new ConnectionPolicyTargetInstance($this->version, $payload, $this->solution['connectionPolicySid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.ConnectionPolicyTargetPage]'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetList.php 0000644 00000015670 15021223077 0023115 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1\ConnectionPolicy; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ConnectionPolicyTargetList extends ListResource { /** * Construct the ConnectionPolicyTargetList * * @param Version $version Version that contains the resource * @param string $connectionPolicySid The SID of the Connection Policy that owns the Target. */ public function __construct( Version $version, string $connectionPolicySid ) { parent::__construct($version); // Path Solution $this->solution = [ 'connectionPolicySid' => $connectionPolicySid, ]; $this->uri = '/ConnectionPolicies/' . \rawurlencode($connectionPolicySid) .'/Targets'; } /** * Create the ConnectionPolicyTargetInstance * * @param string $target The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. * @param array|Options $options Optional Arguments * @return ConnectionPolicyTargetInstance Created ConnectionPolicyTargetInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $target, array $options = []): ConnectionPolicyTargetInstance { $options = new Values($options); $data = Values::of([ 'Target' => $target, 'FriendlyName' => $options['friendlyName'], 'Priority' => $options['priority'], 'Weight' => $options['weight'], 'Enabled' => Serialize::booleanToString($options['enabled']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ConnectionPolicyTargetInstance( $this->version, $payload, $this->solution['connectionPolicySid'] ); } /** * Reads ConnectionPolicyTargetInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConnectionPolicyTargetInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ConnectionPolicyTargetInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ConnectionPolicyTargetInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConnectionPolicyTargetPage Page of ConnectionPolicyTargetInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ConnectionPolicyTargetPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ConnectionPolicyTargetPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConnectionPolicyTargetInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ConnectionPolicyTargetPage Page of ConnectionPolicyTargetInstance */ public function getPage(string $targetUrl): ConnectionPolicyTargetPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConnectionPolicyTargetPage($this->version, $response, $this->solution); } /** * Constructs a ConnectionPolicyTargetContext * * @param string $sid The unique string that we created to identify the Target resource to delete. */ public function getContext( string $sid ): ConnectionPolicyTargetContext { return new ConnectionPolicyTargetContext( $this->version, $this->solution['connectionPolicySid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.ConnectionPolicyTargetList]'; } } sdk/src/Twilio/Rest/Voice/V1/ByocTrunkInstance.php 0000644 00000012650 15021223077 0015754 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $sid * @property string|null $friendlyName * @property string|null $voiceUrl * @property string|null $voiceMethod * @property string|null $voiceFallbackUrl * @property string|null $voiceFallbackMethod * @property string|null $statusCallbackUrl * @property string|null $statusCallbackMethod * @property bool|null $cnamLookupEnabled * @property string|null $connectionPolicySid * @property string|null $fromDomainSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class ByocTrunkInstance extends InstanceResource { /** * Initialize the ByocTrunkInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The Twilio-provided string that uniquely identifies the BYOC Trunk resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'statusCallbackUrl' => Values::array_get($payload, 'status_callback_url'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'cnamLookupEnabled' => Values::array_get($payload, 'cnam_lookup_enabled'), 'connectionPolicySid' => Values::array_get($payload, 'connection_policy_sid'), 'fromDomainSid' => Values::array_get($payload, 'from_domain_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ByocTrunkContext Context for this ByocTrunkInstance */ protected function proxy(): ByocTrunkContext { if (!$this->context) { $this->context = new ByocTrunkContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ByocTrunkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ByocTrunkInstance * * @return ByocTrunkInstance Fetched ByocTrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ByocTrunkInstance { return $this->proxy()->fetch(); } /** * Update the ByocTrunkInstance * * @param array|Options $options Optional Arguments * @return ByocTrunkInstance Updated ByocTrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ByocTrunkInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.ByocTrunkInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ByocTrunkContext.php 0000644 00000007343 15021223077 0015637 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class ByocTrunkContext extends InstanceContext { /** * Initialize the ByocTrunkContext * * @param Version $version Version that contains the resource * @param string $sid The Twilio-provided string that uniquely identifies the BYOC Trunk resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/ByocTrunks/' . \rawurlencode($sid) .''; } /** * Delete the ByocTrunkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ByocTrunkInstance * * @return ByocTrunkInstance Fetched ByocTrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ByocTrunkInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ByocTrunkInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the ByocTrunkInstance * * @param array|Options $options Optional Arguments * @return ByocTrunkInstance Updated ByocTrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ByocTrunkInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'VoiceUrl' => $options['voiceUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'StatusCallbackUrl' => $options['statusCallbackUrl'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'CnamLookupEnabled' => Serialize::booleanToString($options['cnamLookupEnabled']), 'ConnectionPolicySid' => $options['connectionPolicySid'], 'FromDomainSid' => $options['fromDomainSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ByocTrunkInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.ByocTrunkContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ByocTrunkList.php 0000644 00000015075 15021223077 0015127 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ByocTrunkList extends ListResource { /** * Construct the ByocTrunkList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/ByocTrunks'; } /** * Create the ByocTrunkInstance * * @param array|Options $options Optional Arguments * @return ByocTrunkInstance Created ByocTrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ByocTrunkInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'VoiceUrl' => $options['voiceUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'StatusCallbackUrl' => $options['statusCallbackUrl'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'CnamLookupEnabled' => Serialize::booleanToString($options['cnamLookupEnabled']), 'ConnectionPolicySid' => $options['connectionPolicySid'], 'FromDomainSid' => $options['fromDomainSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ByocTrunkInstance( $this->version, $payload ); } /** * Reads ByocTrunkInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ByocTrunkInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ByocTrunkInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ByocTrunkInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ByocTrunkPage Page of ByocTrunkInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ByocTrunkPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ByocTrunkPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ByocTrunkInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ByocTrunkPage Page of ByocTrunkInstance */ public function getPage(string $targetUrl): ByocTrunkPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ByocTrunkPage($this->version, $response, $this->solution); } /** * Constructs a ByocTrunkContext * * @param string $sid The Twilio-provided string that uniquely identifies the BYOC Trunk resource to delete. */ public function getContext( string $sid ): ByocTrunkContext { return new ByocTrunkContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.ByocTrunkList]'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyContext.php 0000644 00000011456 15021223077 0017176 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Voice\V1\ConnectionPolicy\ConnectionPolicyTargetList; /** * @property ConnectionPolicyTargetList $targets * @method \Twilio\Rest\Voice\V1\ConnectionPolicy\ConnectionPolicyTargetContext targets(string $sid) */ class ConnectionPolicyContext extends InstanceContext { protected $_targets; /** * Initialize the ConnectionPolicyContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that we created to identify the Connection Policy resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/ConnectionPolicies/' . \rawurlencode($sid) .''; } /** * Delete the ConnectionPolicyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ConnectionPolicyInstance * * @return ConnectionPolicyInstance Fetched ConnectionPolicyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConnectionPolicyInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConnectionPolicyInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the ConnectionPolicyInstance * * @param array|Options $options Optional Arguments * @return ConnectionPolicyInstance Updated ConnectionPolicyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConnectionPolicyInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ConnectionPolicyInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the targets */ protected function getTargets(): ConnectionPolicyTargetList { if (!$this->_targets) { $this->_targets = new ConnectionPolicyTargetList( $this->version, $this->solution['sid'] ); } return $this->_targets; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.ConnectionPolicyContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/IpRecordInstance.php 0000644 00000011016 15021223077 0015536 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $sid * @property string|null $friendlyName * @property string|null $ipAddress * @property int|null $cidrPrefixLength * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class IpRecordInstance extends InstanceResource { /** * Initialize the IpRecordInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The Twilio-provided string that uniquely identifies the IP Record resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'ipAddress' => Values::array_get($payload, 'ip_address'), 'cidrPrefixLength' => Values::array_get($payload, 'cidr_prefix_length'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return IpRecordContext Context for this IpRecordInstance */ protected function proxy(): IpRecordContext { if (!$this->context) { $this->context = new IpRecordContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the IpRecordInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the IpRecordInstance * * @return IpRecordInstance Fetched IpRecordInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpRecordInstance { return $this->proxy()->fetch(); } /** * Update the IpRecordInstance * * @param array|Options $options Optional Arguments * @return IpRecordInstance Updated IpRecordInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): IpRecordInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.IpRecordInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/SourceIpMappingPage.php 0000644 00000003066 15021223077 0016212 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SourceIpMappingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SourceIpMappingInstance \Twilio\Rest\Voice\V1\SourceIpMappingInstance */ public function buildInstance(array $payload): SourceIpMappingInstance { return new SourceIpMappingInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.SourceIpMappingPage]'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyInstance.php 0000644 00000011404 15021223077 0017307 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Voice\V1\ConnectionPolicy\ConnectionPolicyTargetList; /** * @property string|null $accountSid * @property string|null $sid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class ConnectionPolicyInstance extends InstanceResource { protected $_targets; /** * Initialize the ConnectionPolicyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that we created to identify the Connection Policy resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ConnectionPolicyContext Context for this ConnectionPolicyInstance */ protected function proxy(): ConnectionPolicyContext { if (!$this->context) { $this->context = new ConnectionPolicyContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ConnectionPolicyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ConnectionPolicyInstance * * @return ConnectionPolicyInstance Fetched ConnectionPolicyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConnectionPolicyInstance { return $this->proxy()->fetch(); } /** * Update the ConnectionPolicyInstance * * @param array|Options $options Optional Arguments * @return ConnectionPolicyInstance Updated ConnectionPolicyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConnectionPolicyInstance { return $this->proxy()->update($options); } /** * Access the targets */ protected function getTargets(): ConnectionPolicyTargetList { return $this->proxy()->targets; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.ConnectionPolicyInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyOptions.php 0000644 00000007561 15021223077 0017207 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Options; use Twilio\Values; abstract class ConnectionPolicyOptions { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return CreateConnectionPolicyOptions Options builder */ public static function create( string $friendlyName = Values::NONE ): CreateConnectionPolicyOptions { return new CreateConnectionPolicyOptions( $friendlyName ); } /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return UpdateConnectionPolicyOptions Options builder */ public static function update( string $friendlyName = Values::NONE ): UpdateConnectionPolicyOptions { return new UpdateConnectionPolicyOptions( $friendlyName ); } } class CreateConnectionPolicyOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.CreateConnectionPolicyOptions ' . $options . ']'; } } class UpdateConnectionPolicyOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.UpdateConnectionPolicyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Voice/V1/IpRecordList.php 0000644 00000014030 15021223077 0014704 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class IpRecordList extends ListResource { /** * Construct the IpRecordList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/IpRecords'; } /** * Create the IpRecordInstance * * @param string $ipAddress An IP address in dotted decimal notation, IPv4 only. * @param array|Options $options Optional Arguments * @return IpRecordInstance Created IpRecordInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $ipAddress, array $options = []): IpRecordInstance { $options = new Values($options); $data = Values::of([ 'IpAddress' => $ipAddress, 'FriendlyName' => $options['friendlyName'], 'CidrPrefixLength' => $options['cidrPrefixLength'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new IpRecordInstance( $this->version, $payload ); } /** * Reads IpRecordInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpRecordInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams IpRecordInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of IpRecordInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return IpRecordPage Page of IpRecordInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): IpRecordPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new IpRecordPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpRecordInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return IpRecordPage Page of IpRecordInstance */ public function getPage(string $targetUrl): IpRecordPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpRecordPage($this->version, $response, $this->solution); } /** * Constructs a IpRecordContext * * @param string $sid The Twilio-provided string that uniquely identifies the IP Record resource to delete. */ public function getContext( string $sid ): IpRecordContext { return new IpRecordContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.IpRecordList]'; } } sdk/src/Twilio/Rest/Voice/V1/ArchivedCallContext.php 0000644 00000004021 15021223077 0016226 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class ArchivedCallContext extends InstanceContext { /** * Initialize the ArchivedCallContext * * @param Version $version Version that contains the resource * @param \DateTime $date The date of the Call in UTC. * @param string $sid The Twilio-provided Call SID that uniquely identifies the Call resource to delete */ public function __construct( Version $version, $date, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'date' => $date, 'sid' => $sid, ]; $this->uri = '/Archives/' . \rawurlencode($date->format('Y-m-d')) .'/Calls/' . \rawurlencode($sid) .''; } /** * Delete the ArchivedCallInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.ArchivedCallContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/IpRecordOptions.php 0000644 00000012062 15021223077 0015427 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Options; use Twilio\Values; abstract class IpRecordOptions { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @param int $cidrPrefixLength An integer representing the length of the [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32. * @return CreateIpRecordOptions Options builder */ public static function create( string $friendlyName = Values::NONE, int $cidrPrefixLength = Values::INT_NONE ): CreateIpRecordOptions { return new CreateIpRecordOptions( $friendlyName, $cidrPrefixLength ); } /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return UpdateIpRecordOptions Options builder */ public static function update( string $friendlyName = Values::NONE ): UpdateIpRecordOptions { return new UpdateIpRecordOptions( $friendlyName ); } } class CreateIpRecordOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @param int $cidrPrefixLength An integer representing the length of the [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32. */ public function __construct( string $friendlyName = Values::NONE, int $cidrPrefixLength = Values::INT_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['cidrPrefixLength'] = $cidrPrefixLength; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An integer representing the length of the [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32. * * @param int $cidrPrefixLength An integer representing the length of the [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32. * @return $this Fluent Builder */ public function setCidrPrefixLength(int $cidrPrefixLength): self { $this->options['cidrPrefixLength'] = $cidrPrefixLength; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.CreateIpRecordOptions ' . $options . ']'; } } class UpdateIpRecordOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Voice.V1.UpdateIpRecordOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Voice/V1/IpRecordContext.php 0000644 00000005731 15021223077 0015425 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class IpRecordContext extends InstanceContext { /** * Initialize the IpRecordContext * * @param Version $version Version that contains the resource * @param string $sid The Twilio-provided string that uniquely identifies the IP Record resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/IpRecords/' . \rawurlencode($sid) .''; } /** * Delete the IpRecordInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the IpRecordInstance * * @return IpRecordInstance Fetched IpRecordInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): IpRecordInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new IpRecordInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the IpRecordInstance * * @param array|Options $options Optional Arguments * @return IpRecordInstance Updated IpRecordInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): IpRecordInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new IpRecordInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.IpRecordContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/ConnectionPolicyPage.php 0000644 00000003074 15021223077 0016423 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConnectionPolicyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ConnectionPolicyInstance \Twilio\Rest\Voice\V1\ConnectionPolicyInstance */ public function buildInstance(array $payload): ConnectionPolicyInstance { return new ConnectionPolicyInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.ConnectionPolicyPage]'; } } sdk/src/Twilio/Rest/Voice/V1/ArchivedCallPage.php 0000644 00000003044 15021223077 0015462 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ArchivedCallPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ArchivedCallInstance \Twilio\Rest\Voice\V1\ArchivedCallInstance */ public function buildInstance(array $payload): ArchivedCallInstance { return new ArchivedCallInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1.ArchivedCallPage]'; } } sdk/src/Twilio/Rest/Voice/V1.php 0000644 00000011251 15021223077 0012343 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Voice * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Voice; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Voice\V1\ArchivedCallList; use Twilio\Rest\Voice\V1\ByocTrunkList; use Twilio\Rest\Voice\V1\ConnectionPolicyList; use Twilio\Rest\Voice\V1\DialingPermissionsList; use Twilio\Rest\Voice\V1\IpRecordList; use Twilio\Rest\Voice\V1\SourceIpMappingList; use Twilio\Version; /** * @property ArchivedCallList $archivedCalls * @property ByocTrunkList $byocTrunks * @property ConnectionPolicyList $connectionPolicies * @property DialingPermissionsList $dialingPermissions * @property IpRecordList $ipRecords * @property SourceIpMappingList $sourceIpMappings * @method \Twilio\Rest\Voice\V1\ArchivedCallContext archivedCalls(string $date, string $sid) * @method \Twilio\Rest\Voice\V1\ByocTrunkContext byocTrunks(string $sid) * @method \Twilio\Rest\Voice\V1\ConnectionPolicyContext connectionPolicies(string $sid) * @method \Twilio\Rest\Voice\V1\IpRecordContext ipRecords(string $sid) * @method \Twilio\Rest\Voice\V1\SourceIpMappingContext sourceIpMappings(string $sid) */ class V1 extends Version { protected $_archivedCalls; protected $_byocTrunks; protected $_connectionPolicies; protected $_dialingPermissions; protected $_ipRecords; protected $_sourceIpMappings; /** * Construct the V1 version of Voice * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getArchivedCalls(): ArchivedCallList { if (!$this->_archivedCalls) { $this->_archivedCalls = new ArchivedCallList($this); } return $this->_archivedCalls; } protected function getByocTrunks(): ByocTrunkList { if (!$this->_byocTrunks) { $this->_byocTrunks = new ByocTrunkList($this); } return $this->_byocTrunks; } protected function getConnectionPolicies(): ConnectionPolicyList { if (!$this->_connectionPolicies) { $this->_connectionPolicies = new ConnectionPolicyList($this); } return $this->_connectionPolicies; } protected function getDialingPermissions(): DialingPermissionsList { if (!$this->_dialingPermissions) { $this->_dialingPermissions = new DialingPermissionsList($this); } return $this->_dialingPermissions; } protected function getIpRecords(): IpRecordList { if (!$this->_ipRecords) { $this->_ipRecords = new IpRecordList($this); } return $this->_ipRecords; } protected function getSourceIpMappings(): SourceIpMappingList { if (!$this->_sourceIpMappings) { $this->_sourceIpMappings = new SourceIpMappingList($this); } return $this->_sourceIpMappings; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Voice.V1]'; } } sdk/src/Twilio/Rest/VideoBase.php 0000644 00000004513 15021223077 0012654 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Video\V1; /** * @property \Twilio\Rest\Video\V1 $v1 */ class VideoBase extends Domain { protected $_v1; /** * Construct the Video Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://video.twilio.com'; } /** * @return V1 Version v1 of video */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Video]'; } } sdk/src/Twilio/Rest/Preview/Sync.php 0000644 00000005107 15021223077 0013350 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\Sync\ServiceList; use Twilio\Version; /** * @property ServiceList $services * @method \Twilio\Rest\Preview\Sync\ServiceContext services(string $sid) */ class Sync extends Version { protected $_services; /** * Construct the Sync version of Preview * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'Sync'; } protected function getServices(): ServiceList { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnInstance.php 0000644 00000012075 15021223077 0021200 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string|null $description * @property array|null $configuration * @property string|null $uniqueName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class InstalledAddOnInstance extends InstanceResource { protected $_extensions; /** * Initialize the InstalledAddOnInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the InstalledAddOn resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'description' => Values::array_get($payload, 'description'), 'configuration' => Values::array_get($payload, 'configuration'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InstalledAddOnContext Context for this InstalledAddOnInstance */ protected function proxy(): InstalledAddOnContext { if (!$this->context) { $this->context = new InstalledAddOnContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the InstalledAddOnInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the InstalledAddOnInstance * * @return InstalledAddOnInstance Fetched InstalledAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InstalledAddOnInstance { return $this->proxy()->fetch(); } /** * Update the InstalledAddOnInstance * * @param array|Options $options Optional Arguments * @return InstalledAddOnInstance Updated InstalledAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): InstalledAddOnInstance { return $this->proxy()->update($options); } /** * Access the extensions */ protected function getExtensions(): InstalledAddOnExtensionList { return $this->proxy()->extensions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.InstalledAddOnInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnContext.php 0000644 00000011643 15021223077 0021060 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionList; /** * @property InstalledAddOnExtensionList $extensions * @method \Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionContext extensions(string $sid) */ class InstalledAddOnContext extends InstanceContext { protected $_extensions; /** * Initialize the InstalledAddOnContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the InstalledAddOn resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/InstalledAddOns/' . \rawurlencode($sid) .''; } /** * Delete the InstalledAddOnInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the InstalledAddOnInstance * * @return InstalledAddOnInstance Fetched InstalledAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InstalledAddOnInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new InstalledAddOnInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the InstalledAddOnInstance * * @param array|Options $options Optional Arguments * @return InstalledAddOnInstance Updated InstalledAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): InstalledAddOnInstance { $options = new Values($options); $data = Values::of([ 'Configuration' => Serialize::jsonObject($options['configuration']), 'UniqueName' => $options['uniqueName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new InstalledAddOnInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the extensions */ protected function getExtensions(): InstalledAddOnExtensionList { if (!$this->_extensions) { $this->_extensions = new InstalledAddOnExtensionList( $this->version, $this->solution['sid'] ); } return $this->_extensions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.InstalledAddOnContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnPage.php 0000644 00000003123 15021223077 0020302 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class InstalledAddOnPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return InstalledAddOnInstance \Twilio\Rest\Preview\Marketplace\InstalledAddOnInstance */ public function buildInstance(array $payload): InstalledAddOnInstance { return new InstalledAddOnInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Marketplace.InstalledAddOnPage]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnContext.php 0000644 00000007442 15021223077 0021023 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionList; /** * @property AvailableAddOnExtensionList $extensions * @method \Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionContext extensions(string $sid) */ class AvailableAddOnContext extends InstanceContext { protected $_extensions; /** * Initialize the AvailableAddOnContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the AvailableAddOn resource to fetch. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/AvailableAddOns/' . \rawurlencode($sid) .''; } /** * Fetch the AvailableAddOnInstance * * @return AvailableAddOnInstance Fetched AvailableAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AvailableAddOnInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AvailableAddOnInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the extensions */ protected function getExtensions(): AvailableAddOnExtensionList { if (!$this->_extensions) { $this->_extensions = new AvailableAddOnExtensionList( $this->version, $this->solution['sid'] ); } return $this->_extensions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.AvailableAddOnContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionInstance.php 0000644 00000011015 15021223077 0025713 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace\InstalledAddOn; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string|null $installedAddOnSid * @property string|null $friendlyName * @property string|null $productName * @property string|null $uniqueName * @property bool|null $enabled * @property string|null $url */ class InstalledAddOnExtensionInstance extends InstanceResource { /** * Initialize the InstalledAddOnExtensionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $installedAddOnSid The SID of the InstalledAddOn resource with the extension to fetch. * @param string $sid The SID of the InstalledAddOn Extension resource to fetch. */ public function __construct(Version $version, array $payload, string $installedAddOnSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'installedAddOnSid' => Values::array_get($payload, 'installed_add_on_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'productName' => Values::array_get($payload, 'product_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'enabled' => Values::array_get($payload, 'enabled'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['installedAddOnSid' => $installedAddOnSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InstalledAddOnExtensionContext Context for this InstalledAddOnExtensionInstance */ protected function proxy(): InstalledAddOnExtensionContext { if (!$this->context) { $this->context = new InstalledAddOnExtensionContext( $this->version, $this->solution['installedAddOnSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the InstalledAddOnExtensionInstance * * @return InstalledAddOnExtensionInstance Fetched InstalledAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InstalledAddOnExtensionInstance { return $this->proxy()->fetch(); } /** * Update the InstalledAddOnExtensionInstance * * @param bool $enabled Whether the Extension should be invoked. * @return InstalledAddOnExtensionInstance Updated InstalledAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $enabled): InstalledAddOnExtensionInstance { return $this->proxy()->update($enabled); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionContext.php 0000644 00000006333 15021223077 0025602 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace\InstalledAddOn; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class InstalledAddOnExtensionContext extends InstanceContext { /** * Initialize the InstalledAddOnExtensionContext * * @param Version $version Version that contains the resource * @param string $installedAddOnSid The SID of the InstalledAddOn resource with the extension to fetch. * @param string $sid The SID of the InstalledAddOn Extension resource to fetch. */ public function __construct( Version $version, $installedAddOnSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'installedAddOnSid' => $installedAddOnSid, 'sid' => $sid, ]; $this->uri = '/InstalledAddOns/' . \rawurlencode($installedAddOnSid) .'/Extensions/' . \rawurlencode($sid) .''; } /** * Fetch the InstalledAddOnExtensionInstance * * @return InstalledAddOnExtensionInstance Fetched InstalledAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InstalledAddOnExtensionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new InstalledAddOnExtensionInstance( $this->version, $payload, $this->solution['installedAddOnSid'], $this->solution['sid'] ); } /** * Update the InstalledAddOnExtensionInstance * * @param bool $enabled Whether the Extension should be invoked. * @return InstalledAddOnExtensionInstance Updated InstalledAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $enabled): InstalledAddOnExtensionInstance { $data = Values::of([ 'Enabled' => Serialize::booleanToString($enabled), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new InstalledAddOnExtensionInstance( $this->version, $payload, $this->solution['installedAddOnSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionList.php 0000644 00000013344 15021223077 0025071 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace\InstalledAddOn; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class InstalledAddOnExtensionList extends ListResource { /** * Construct the InstalledAddOnExtensionList * * @param Version $version Version that contains the resource * @param string $installedAddOnSid The SID of the InstalledAddOn resource with the extension to fetch. */ public function __construct( Version $version, string $installedAddOnSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'installedAddOnSid' => $installedAddOnSid, ]; $this->uri = '/InstalledAddOns/' . \rawurlencode($installedAddOnSid) .'/Extensions'; } /** * Reads InstalledAddOnExtensionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InstalledAddOnExtensionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams InstalledAddOnExtensionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InstalledAddOnExtensionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InstalledAddOnExtensionPage Page of InstalledAddOnExtensionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InstalledAddOnExtensionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InstalledAddOnExtensionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InstalledAddOnExtensionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InstalledAddOnExtensionPage Page of InstalledAddOnExtensionInstance */ public function getPage(string $targetUrl): InstalledAddOnExtensionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InstalledAddOnExtensionPage($this->version, $response, $this->solution); } /** * Constructs a InstalledAddOnExtensionContext * * @param string $sid The SID of the InstalledAddOn Extension resource to fetch. */ public function getContext( string $sid ): InstalledAddOnExtensionContext { return new InstalledAddOnExtensionContext( $this->version, $this->solution['installedAddOnSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionList]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionPage.php 0000644 00000003315 15021223077 0025027 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace\InstalledAddOn; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class InstalledAddOnExtensionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return InstalledAddOnExtensionInstance \Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionInstance */ public function buildInstance(array $payload): InstalledAddOnExtensionInstance { return new InstalledAddOnExtensionInstance($this->version, $payload, $this->solution['installedAddOnSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionPage]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnPage.php 0000644 00000003123 15021223077 0020243 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AvailableAddOnPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AvailableAddOnInstance \Twilio\Rest\Preview\Marketplace\AvailableAddOnInstance */ public function buildInstance(array $payload): AvailableAddOnInstance { return new AvailableAddOnInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Marketplace.AvailableAddOnPage]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnOptions.php 0000644 00000013474 15021223077 0021073 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Options; use Twilio\Values; abstract class InstalledAddOnOptions { /** * @param array $configuration The JSON object that represents the configuration of the new Add-on being installed. * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. * @return CreateInstalledAddOnOptions Options builder */ public static function create( array $configuration = Values::ARRAY_NONE, string $uniqueName = Values::NONE ): CreateInstalledAddOnOptions { return new CreateInstalledAddOnOptions( $configuration, $uniqueName ); } /** * @param array $configuration Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. * @return UpdateInstalledAddOnOptions Options builder */ public static function update( array $configuration = Values::ARRAY_NONE, string $uniqueName = Values::NONE ): UpdateInstalledAddOnOptions { return new UpdateInstalledAddOnOptions( $configuration, $uniqueName ); } } class CreateInstalledAddOnOptions extends Options { /** * @param array $configuration The JSON object that represents the configuration of the new Add-on being installed. * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. */ public function __construct( array $configuration = Values::ARRAY_NONE, string $uniqueName = Values::NONE ) { $this->options['configuration'] = $configuration; $this->options['uniqueName'] = $uniqueName; } /** * The JSON object that represents the configuration of the new Add-on being installed. * * @param array $configuration The JSON object that represents the configuration of the new Add-on being installed. * @return $this Fluent Builder */ public function setConfiguration(array $configuration): self { $this->options['configuration'] = $configuration; return $this; } /** * An application-defined string that uniquely identifies the resource. This value must be unique within the Account. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Marketplace.CreateInstalledAddOnOptions ' . $options . ']'; } } class UpdateInstalledAddOnOptions extends Options { /** * @param array $configuration Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. */ public function __construct( array $configuration = Values::ARRAY_NONE, string $uniqueName = Values::NONE ) { $this->options['configuration'] = $configuration; $this->options['uniqueName'] = $uniqueName; } /** * Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured * * @param array $configuration Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured * @return $this Fluent Builder */ public function setConfiguration(array $configuration): self { $this->options['configuration'] = $configuration; return $this; } /** * An application-defined string that uniquely identifies the resource. This value must be unique within the Account. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Marketplace.UpdateInstalledAddOnOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnList.php 0000644 00000012333 15021223077 0020305 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AvailableAddOnList extends ListResource { /** * Construct the AvailableAddOnList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/AvailableAddOns'; } /** * Reads AvailableAddOnInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AvailableAddOnInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AvailableAddOnInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AvailableAddOnInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AvailableAddOnPage Page of AvailableAddOnInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AvailableAddOnPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AvailableAddOnPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AvailableAddOnInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AvailableAddOnPage Page of AvailableAddOnInstance */ public function getPage(string $targetUrl): AvailableAddOnPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AvailableAddOnPage($this->version, $response, $this->solution); } /** * Constructs a AvailableAddOnContext * * @param string $sid The SID of the AvailableAddOn resource to fetch. */ public function getContext( string $sid ): AvailableAddOnContext { return new AvailableAddOnContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Marketplace.AvailableAddOnList]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionPage.php 0000644 00000003315 15021223077 0024731 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace\AvailableAddOn; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AvailableAddOnExtensionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AvailableAddOnExtensionInstance \Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionInstance */ public function buildInstance(array $payload): AvailableAddOnExtensionInstance { return new AvailableAddOnExtensionInstance($this->version, $payload, $this->solution['availableAddOnSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionPage]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionInstance.php 0000644 00000010003 15021223077 0025611 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace\AvailableAddOn; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string|null $availableAddOnSid * @property string|null $friendlyName * @property string|null $productName * @property string|null $uniqueName * @property string|null $url */ class AvailableAddOnExtensionInstance extends InstanceResource { /** * Initialize the AvailableAddOnExtensionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $availableAddOnSid The SID of the AvailableAddOn resource with the extension to fetch. * @param string $sid The SID of the AvailableAddOn Extension resource to fetch. */ public function __construct(Version $version, array $payload, string $availableAddOnSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'availableAddOnSid' => Values::array_get($payload, 'available_add_on_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'productName' => Values::array_get($payload, 'product_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['availableAddOnSid' => $availableAddOnSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AvailableAddOnExtensionContext Context for this AvailableAddOnExtensionInstance */ protected function proxy(): AvailableAddOnExtensionContext { if (!$this->context) { $this->context = new AvailableAddOnExtensionContext( $this->version, $this->solution['availableAddOnSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the AvailableAddOnExtensionInstance * * @return AvailableAddOnExtensionInstance Fetched AvailableAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AvailableAddOnExtensionInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionContext.php 0000644 00000004657 15021223077 0025513 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace\AvailableAddOn; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class AvailableAddOnExtensionContext extends InstanceContext { /** * Initialize the AvailableAddOnExtensionContext * * @param Version $version Version that contains the resource * @param string $availableAddOnSid The SID of the AvailableAddOn resource with the extension to fetch. * @param string $sid The SID of the AvailableAddOn Extension resource to fetch. */ public function __construct( Version $version, $availableAddOnSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'availableAddOnSid' => $availableAddOnSid, 'sid' => $sid, ]; $this->uri = '/AvailableAddOns/' . \rawurlencode($availableAddOnSid) .'/Extensions/' . \rawurlencode($sid) .''; } /** * Fetch the AvailableAddOnExtensionInstance * * @return AvailableAddOnExtensionInstance Fetched AvailableAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AvailableAddOnExtensionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AvailableAddOnExtensionInstance( $this->version, $payload, $this->solution['availableAddOnSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionList.php 0000644 00000013344 15021223077 0024773 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace\AvailableAddOn; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class AvailableAddOnExtensionList extends ListResource { /** * Construct the AvailableAddOnExtensionList * * @param Version $version Version that contains the resource * @param string $availableAddOnSid The SID of the AvailableAddOn resource with the extension to fetch. */ public function __construct( Version $version, string $availableAddOnSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'availableAddOnSid' => $availableAddOnSid, ]; $this->uri = '/AvailableAddOns/' . \rawurlencode($availableAddOnSid) .'/Extensions'; } /** * Reads AvailableAddOnExtensionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AvailableAddOnExtensionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams AvailableAddOnExtensionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AvailableAddOnExtensionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AvailableAddOnExtensionPage Page of AvailableAddOnExtensionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AvailableAddOnExtensionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AvailableAddOnExtensionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AvailableAddOnExtensionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AvailableAddOnExtensionPage Page of AvailableAddOnExtensionInstance */ public function getPage(string $targetUrl): AvailableAddOnExtensionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AvailableAddOnExtensionPage($this->version, $response, $this->solution); } /** * Constructs a AvailableAddOnExtensionContext * * @param string $sid The SID of the AvailableAddOn Extension resource to fetch. */ public function getContext( string $sid ): AvailableAddOnExtensionContext { return new AvailableAddOnExtensionContext( $this->version, $this->solution['availableAddOnSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionList]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnInstance.php 0000644 00000010026 15021223077 0021133 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionList; /** * @property string|null $sid * @property string|null $friendlyName * @property string|null $description * @property string|null $pricingType * @property array|null $configurationSchema * @property string|null $url * @property array|null $links */ class AvailableAddOnInstance extends InstanceResource { protected $_extensions; /** * Initialize the AvailableAddOnInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the AvailableAddOn resource to fetch. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'description' => Values::array_get($payload, 'description'), 'pricingType' => Values::array_get($payload, 'pricing_type'), 'configurationSchema' => Values::array_get($payload, 'configuration_schema'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AvailableAddOnContext Context for this AvailableAddOnInstance */ protected function proxy(): AvailableAddOnContext { if (!$this->context) { $this->context = new AvailableAddOnContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the AvailableAddOnInstance * * @return AvailableAddOnInstance Fetched AvailableAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AvailableAddOnInstance { return $this->proxy()->fetch(); } /** * Access the extensions */ protected function getExtensions(): AvailableAddOnExtensionList { return $this->proxy()->extensions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.AvailableAddOnInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnList.php 0000644 00000014664 15021223077 0020355 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class InstalledAddOnList extends ListResource { /** * Construct the InstalledAddOnList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/InstalledAddOns'; } /** * Create the InstalledAddOnInstance * * @param string $availableAddOnSid The SID of the AvaliableAddOn to install. * @param bool $acceptTermsOfService Whether the Terms of Service were accepted. * @param array|Options $options Optional Arguments * @return InstalledAddOnInstance Created InstalledAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $availableAddOnSid, bool $acceptTermsOfService, array $options = []): InstalledAddOnInstance { $options = new Values($options); $data = Values::of([ 'AvailableAddOnSid' => $availableAddOnSid, 'AcceptTermsOfService' => Serialize::booleanToString($acceptTermsOfService), 'Configuration' => Serialize::jsonObject($options['configuration']), 'UniqueName' => $options['uniqueName'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InstalledAddOnInstance( $this->version, $payload ); } /** * Reads InstalledAddOnInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InstalledAddOnInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams InstalledAddOnInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InstalledAddOnInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InstalledAddOnPage Page of InstalledAddOnInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InstalledAddOnPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InstalledAddOnPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InstalledAddOnInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InstalledAddOnPage Page of InstalledAddOnInstance */ public function getPage(string $targetUrl): InstalledAddOnPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InstalledAddOnPage($this->version, $response, $this->solution); } /** * Constructs a InstalledAddOnContext * * @param string $sid The SID of the InstalledAddOn resource to delete. */ public function getContext( string $sid ): InstalledAddOnContext { return new InstalledAddOnContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Marketplace.InstalledAddOnList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapList.php 0000644 00000013706 15021223077 0017162 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncMapList extends ListResource { /** * Construct the SyncMapList * * @param Version $version Version that contains the resource * @param string $serviceSid */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps'; } /** * Create the SyncMapInstance * * @param array|Options $options Optional Arguments * @return SyncMapInstance Created SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): SyncMapInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncMapInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads SyncMapInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncMapInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncMapInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncMapPage Page of SyncMapInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncMapPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncMapPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncMapPage Page of SyncMapInstance */ public function getPage(string $targetUrl): SyncMapPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapContext * * @param string $sid */ public function getContext( string $sid ): SyncMapContext { return new SyncMapContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncMapList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentPage.php 0000644 00000003111 15021223077 0017314 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DocumentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DocumentInstance \Twilio\Rest\Preview\Sync\Service\DocumentInstance */ public function buildInstance(array $payload): DocumentInstance { return new DocumentInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.DocumentPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionPage.php 0000644 00000003267 15021223077 0023157 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\Document; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DocumentPermissionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DocumentPermissionInstance \Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionInstance */ public function buildInstance(array $payload): DocumentPermissionInstance { return new DocumentPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.DocumentPermissionPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionContext.php 0000644 00000010131 15021223077 0023713 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\Document; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class DocumentPermissionContext extends InstanceContext { /** * Initialize the DocumentPermissionContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $documentSid Identifier of the Sync Document. Either a SID or a unique name. * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. */ public function __construct( Version $version, $serviceSid, $documentSid, $identity ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Documents/' . \rawurlencode($documentSid) .'/Permissions/' . \rawurlencode($identity) .''; } /** * Delete the DocumentPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the DocumentPermissionInstance * * @return DocumentPermissionInstance Fetched DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentPermissionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new DocumentPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } /** * Update the DocumentPermissionInstance * * @param bool $read Boolean flag specifying whether the identity can read the Sync Document. * @param bool $write Boolean flag specifying whether the identity can update the Sync Document. * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Document. * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DocumentPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.DocumentPermissionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionList.php 0000644 00000013537 15021223077 0023217 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\Document; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DocumentPermissionList extends ListResource { /** * Construct the DocumentPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $documentSid Identifier of the Sync Document. Either a SID or a unique name. */ public function __construct( Version $version, string $serviceSid, string $documentSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'documentSid' => $documentSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Documents/' . \rawurlencode($documentSid) .'/Permissions'; } /** * Reads DocumentPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DocumentPermissionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DocumentPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DocumentPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DocumentPermissionPage Page of DocumentPermissionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DocumentPermissionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DocumentPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DocumentPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DocumentPermissionPage Page of DocumentPermissionInstance */ public function getPage(string $targetUrl): DocumentPermissionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DocumentPermissionPage($this->version, $response, $this->solution); } /** * Constructs a DocumentPermissionContext * * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. */ public function getContext( string $identity ): DocumentPermissionContext { return new DocumentPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['documentSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.DocumentPermissionList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionInstance.php 0000644 00000012272 15021223077 0024043 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\Document; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $documentSid * @property string|null $identity * @property bool|null $read * @property bool|null $write * @property bool|null $manage * @property string|null $url */ class DocumentPermissionInstance extends InstanceResource { /** * Initialize the DocumentPermissionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $documentSid Identifier of the Sync Document. Either a SID or a unique name. * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. */ public function __construct(Version $version, array $payload, string $serviceSid, string $documentSid, string $identity = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'documentSid' => Values::array_get($payload, 'document_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity ?: $this->properties['identity'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DocumentPermissionContext Context for this DocumentPermissionInstance */ protected function proxy(): DocumentPermissionContext { if (!$this->context) { $this->context = new DocumentPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } return $this->context; } /** * Delete the DocumentPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DocumentPermissionInstance * * @return DocumentPermissionInstance Fetched DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentPermissionInstance { return $this->proxy()->fetch(); } /** * Update the DocumentPermissionInstance * * @param bool $read Boolean flag specifying whether the identity can read the Sync Document. * @param bool $write Boolean flag specifying whether the identity can update the Sync Document. * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Document. * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.DocumentPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapPage.php 0000644 00000003103 15021223077 0017111 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncMapPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SyncMapInstance \Twilio\Rest\Preview\Sync\Service\SyncMapInstance */ public function buildInstance(array $payload): SyncMapInstance { return new SyncMapInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncMapPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentOptions.php 0000644 00000006520 15021223077 0020102 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Options; use Twilio\Values; abstract class DocumentOptions { /** * @param string $uniqueName * @param array $data * @return CreateDocumentOptions Options builder */ public static function create( string $uniqueName = Values::NONE, array $data = Values::ARRAY_NONE ): CreateDocumentOptions { return new CreateDocumentOptions( $uniqueName, $data ); } /** * @param string $ifMatch The If-Match HTTP request header * @return UpdateDocumentOptions Options builder */ public static function update( string $ifMatch = Values::NONE ): UpdateDocumentOptions { return new UpdateDocumentOptions( $ifMatch ); } } class CreateDocumentOptions extends Options { /** * @param string $uniqueName * @param array $data */ public function __construct( string $uniqueName = Values::NONE, array $data = Values::ARRAY_NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['data'] = $data; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * * * @param array $data * @return $this Fluent Builder */ public function setData(array $data): self { $this->options['data'] = $data; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.CreateDocumentOptions ' . $options . ']'; } } class UpdateDocumentOptions extends Options { /** * @param string $ifMatch The If-Match HTTP request header */ public function __construct( string $ifMatch = Values::NONE ) { $this->options['ifMatch'] = $ifMatch; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.UpdateDocumentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapOptions.php 0000644 00000003340 15021223077 0017673 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Options; use Twilio\Values; abstract class SyncMapOptions { /** * @param string $uniqueName * @return CreateSyncMapOptions Options builder */ public static function create( string $uniqueName = Values::NONE ): CreateSyncMapOptions { return new CreateSyncMapOptions( $uniqueName ); } } class CreateSyncMapOptions extends Options { /** * @param string $uniqueName */ public function __construct( string $uniqueName = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.CreateSyncMapOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentList.php 0000644 00000014110 15021223077 0017354 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class DocumentList extends ListResource { /** * Construct the DocumentList * * @param Version $version Version that contains the resource * @param string $serviceSid */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Documents'; } /** * Create the DocumentInstance * * @param array|Options $options Optional Arguments * @return DocumentInstance Created DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): DocumentInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'Data' => Serialize::jsonObject($options['data']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DocumentInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads DocumentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DocumentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DocumentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DocumentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DocumentPage Page of DocumentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DocumentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DocumentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DocumentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DocumentPage Page of DocumentInstance */ public function getPage(string $targetUrl): DocumentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DocumentPage($this->version, $response, $this->solution); } /** * Constructs a DocumentContext * * @param string $sid */ public function getContext( string $sid ): DocumentContext { return new DocumentContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.DocumentList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListInstance.php 0000644 00000011660 15021223077 0020206 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionList; use Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemList; /** * @property string|null $sid * @property string|null $uniqueName * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $url * @property array|null $links * @property string|null $revision * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy */ class SyncListInstance extends InstanceResource { protected $_syncListPermissions; protected $_syncListItems; /** * Initialize the SyncListInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncListContext Context for this SyncListInstance */ protected function proxy(): SyncListContext { if (!$this->context) { $this->context = new SyncListContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the SyncListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncListInstance * * @return SyncListInstance Fetched SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListInstance { return $this->proxy()->fetch(); } /** * Access the syncListPermissions */ protected function getSyncListPermissions(): SyncListPermissionList { return $this->proxy()->syncListPermissions; } /** * Access the syncListItems */ protected function getSyncListItems(): SyncListItemList { return $this->proxy()->syncListItems; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListPage.php 0000644 00000003111 15021223077 0017306 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncListPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SyncListInstance \Twilio\Rest\Preview\Sync\Service\SyncListInstance */ public function buildInstance(array $payload): SyncListInstance { return new SyncListInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncListPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListList.php 0000644 00000013737 15021223077 0017364 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncListList extends ListResource { /** * Construct the SyncListList * * @param Version $version Version that contains the resource * @param string $serviceSid */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists'; } /** * Create the SyncListInstance * * @param array|Options $options Optional Arguments * @return SyncListInstance Created SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): SyncListInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncListInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads SyncListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncListPage Page of SyncListInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncListPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncListPage Page of SyncListInstance */ public function getPage(string $targetUrl): SyncListPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListPage($this->version, $response, $this->solution); } /** * Constructs a SyncListContext * * @param string $sid */ public function getContext( string $sid ): SyncListContext { return new SyncListContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncListList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListContext.php 0000644 00000011563 15021223077 0020070 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionList; use Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemList; /** * @property SyncListPermissionList $syncListPermissions * @property SyncListItemList $syncListItems * @method \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionContext syncListPermissions(string $identity) * @method \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemContext syncListItems(string $index) */ class SyncListContext extends InstanceContext { protected $_syncListPermissions; protected $_syncListItems; /** * Initialize the SyncListContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($sid) .''; } /** * Delete the SyncListInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SyncListInstance * * @return SyncListInstance Fetched SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncListInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the syncListPermissions */ protected function getSyncListPermissions(): SyncListPermissionList { if (!$this->_syncListPermissions) { $this->_syncListPermissions = new SyncListPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListPermissions; } /** * Access the syncListItems */ protected function getSyncListItems(): SyncListItemList { if (!$this->_syncListItems) { $this->_syncListItems = new SyncListItemList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListItems; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapInstance.php 0000644 00000011626 15021223077 0020012 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemList; use Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionList; /** * @property string|null $sid * @property string|null $uniqueName * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $url * @property array|null $links * @property string|null $revision * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy */ class SyncMapInstance extends InstanceResource { protected $_syncMapItems; protected $_syncMapPermissions; /** * Initialize the SyncMapInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncMapContext Context for this SyncMapInstance */ protected function proxy(): SyncMapContext { if (!$this->context) { $this->context = new SyncMapContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the SyncMapInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncMapInstance * * @return SyncMapInstance Fetched SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapInstance { return $this->proxy()->fetch(); } /** * Access the syncMapItems */ protected function getSyncMapItems(): SyncMapItemList { return $this->proxy()->syncMapItems; } /** * Access the syncMapPermissions */ protected function getSyncMapPermissions(): SyncMapPermissionList { return $this->proxy()->syncMapPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapContext.php 0000644 00000011511 15021223077 0017663 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemList; use Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionList; /** * @property SyncMapItemList $syncMapItems * @property SyncMapPermissionList $syncMapPermissions * @method \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemContext syncMapItems(string $key) * @method \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionContext syncMapPermissions(string $identity) */ class SyncMapContext extends InstanceContext { protected $_syncMapItems; protected $_syncMapPermissions; /** * Initialize the SyncMapContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($sid) .''; } /** * Delete the SyncMapInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SyncMapInstance * * @return SyncMapInstance Fetched SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncMapInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the syncMapItems */ protected function getSyncMapItems(): SyncMapItemList { if (!$this->_syncMapItems) { $this->_syncMapItems = new SyncMapItemList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncMapItems; } /** * Access the syncMapPermissions */ protected function getSyncMapPermissions(): SyncMapPermissionList { if (!$this->_syncMapPermissions) { $this->_syncMapPermissions = new SyncMapPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncMapPermissions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentInstance.php 0000644 00000012254 15021223077 0020214 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionList; /** * @property string|null $sid * @property string|null $uniqueName * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $url * @property array|null $links * @property string|null $revision * @property array|null $data * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy */ class DocumentInstance extends InstanceResource { protected $_documentPermissions; /** * Initialize the DocumentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DocumentContext Context for this DocumentInstance */ protected function proxy(): DocumentContext { if (!$this->context) { $this->context = new DocumentContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the DocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DocumentInstance * * @return DocumentInstance Fetched DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentInstance { return $this->proxy()->fetch(); } /** * Update the DocumentInstance * * @param array $data * @param array|Options $options Optional Arguments * @return DocumentInstance Updated DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $data, array $options = []): DocumentInstance { return $this->proxy()->update($data, $options); } /** * Access the documentPermissions */ protected function getDocumentPermissions(): DocumentPermissionList { return $this->proxy()->documentPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.DocumentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemContext.php 0000644 00000007375 15021223077 0022465 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class SyncListItemContext extends InstanceContext { /** * Initialize the SyncListItemContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $listSid * @param int $index */ public function __construct( Version $version, $serviceSid, $listSid, $index ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Items/' . \rawurlencode($index) .''; } /** * Delete the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['If-Match' => $options['ifMatch']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListItemInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } /** * Update the SyncListItemInstance * * @param array $data * @param array|Options $options Optional Arguments * @return SyncListItemInstance Updated SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $data, array $options = []): SyncListItemInstance { $options = new Values($options); $data = Values::of([ 'Data' => Serialize::jsonObject($data), ]); $headers = Values::of(['If-Match' => $options['ifMatch']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListItemContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionPage.php 0000644 00000003263 15021223077 0023137 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncListPermissionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SyncListPermissionInstance \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionInstance */ public function buildInstance(array $payload): SyncListPermissionInstance { return new SyncListPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncListPermissionPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemList.php 0000644 00000015232 15021223077 0021743 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class SyncListItemList extends ListResource { /** * Construct the SyncListItemList * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $listSid */ public function __construct( Version $version, string $serviceSid, string $listSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Items'; } /** * Create the SyncListItemInstance * * @param array $data * @return SyncListItemInstance Created SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $data): SyncListItemInstance { $data = Values::of([ 'Data' => Serialize::jsonObject($data), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'] ); } /** * Reads SyncListItemInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListItemInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SyncListItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncListItemInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncListItemPage Page of SyncListItemInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncListItemPage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'From' => $options['from'], 'Bounds' => $options['bounds'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncListItemPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListItemInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncListItemPage Page of SyncListItemInstance */ public function getPage(string $targetUrl): SyncListItemPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListItemPage($this->version, $response, $this->solution); } /** * Constructs a SyncListItemContext * * @param int $index */ public function getContext( int $index ): SyncListItemContext { return new SyncListItemContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $index ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncListItemList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionContext.php 0000644 00000010105 15021223077 0023700 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class SyncListPermissionContext extends InstanceContext { /** * Initialize the SyncListPermissionContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $listSid Identifier of the Sync List. Either a SID or a unique name. * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. */ public function __construct( Version $version, $serviceSid, $listSid, $identity ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Permissions/' . \rawurlencode($identity) .''; } /** * Delete the SyncListPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SyncListPermissionInstance * * @return SyncListPermissionInstance Fetched SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListPermissionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncListPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } /** * Update the SyncListPermissionInstance * * @param bool $read Boolean flag specifying whether the identity can read the Sync List. * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync List. * @param bool $manage Boolean flag specifying whether the identity can delete the Sync List. * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SyncListPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListPermissionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemOptions.php 0000644 00000011705 15021223077 0022464 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Options; use Twilio\Values; abstract class SyncListItemOptions { /** * @param string $ifMatch The If-Match HTTP request header * @return DeleteSyncListItemOptions Options builder */ public static function delete( string $ifMatch = Values::NONE ): DeleteSyncListItemOptions { return new DeleteSyncListItemOptions( $ifMatch ); } /** * @param string $order * @param string $from * @param string $bounds * @return ReadSyncListItemOptions Options builder */ public static function read( string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE ): ReadSyncListItemOptions { return new ReadSyncListItemOptions( $order, $from, $bounds ); } /** * @param string $ifMatch The If-Match HTTP request header * @return UpdateSyncListItemOptions Options builder */ public static function update( string $ifMatch = Values::NONE ): UpdateSyncListItemOptions { return new UpdateSyncListItemOptions( $ifMatch ); } } class DeleteSyncListItemOptions extends Options { /** * @param string $ifMatch The If-Match HTTP request header */ public function __construct( string $ifMatch = Values::NONE ) { $this->options['ifMatch'] = $ifMatch; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.DeleteSyncListItemOptions ' . $options . ']'; } } class ReadSyncListItemOptions extends Options { /** * @param string $order * @param string $from * @param string $bounds */ public function __construct( string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE ) { $this->options['order'] = $order; $this->options['from'] = $from; $this->options['bounds'] = $bounds; } /** * * * @param string $order * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * * * @param string $from * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * * * @param string $bounds * @return $this Fluent Builder */ public function setBounds(string $bounds): self { $this->options['bounds'] = $bounds; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.ReadSyncListItemOptions ' . $options . ']'; } } class UpdateSyncListItemOptions extends Options { /** * @param string $ifMatch The If-Match HTTP request header */ public function __construct( string $ifMatch = Values::NONE ) { $this->options['ifMatch'] = $ifMatch; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.UpdateSyncListItemOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionList.php 0000644 00000013477 15021223077 0023206 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncListPermissionList extends ListResource { /** * Construct the SyncListPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $listSid Identifier of the Sync List. Either a SID or a unique name. */ public function __construct( Version $version, string $serviceSid, string $listSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'listSid' => $listSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Lists/' . \rawurlencode($listSid) .'/Permissions'; } /** * Reads SyncListPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListPermissionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncListPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncListPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncListPermissionPage Page of SyncListPermissionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncListPermissionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncListPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncListPermissionPage Page of SyncListPermissionInstance */ public function getPage(string $targetUrl): SyncListPermissionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListPermissionPage($this->version, $response, $this->solution); } /** * Constructs a SyncListPermissionContext * * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. */ public function getContext( string $identity ): SyncListPermissionContext { return new SyncListPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncListPermissionList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemInstance.php 0000644 00000012064 15021223077 0022574 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property int|null $index * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $listSid * @property string|null $url * @property string|null $revision * @property array|null $data * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy */ class SyncListItemInstance extends InstanceResource { /** * Initialize the SyncListItemInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $listSid * @param int $index */ public function __construct(Version $version, array $payload, string $serviceSid, string $listSid, int $index = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'index' => Values::array_get($payload, 'index'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'listSid' => Values::array_get($payload, 'list_sid'), 'url' => Values::array_get($payload, 'url'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index ?: $this->properties['index'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncListItemContext Context for this SyncListItemInstance */ protected function proxy(): SyncListItemContext { if (!$this->context) { $this->context = new SyncListItemContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } return $this->context; } /** * Delete the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListItemInstance { return $this->proxy()->fetch(); } /** * Update the SyncListItemInstance * * @param array $data * @param array|Options $options Optional Arguments * @return SyncListItemInstance Updated SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $data, array $options = []): SyncListItemInstance { return $this->proxy()->update($data, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListItemInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemPage.php 0000644 00000003217 15021223077 0021704 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncListItemPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SyncListItemInstance \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemInstance */ public function buildInstance(array $payload): SyncListItemInstance { return new SyncListItemInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncListItemPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionInstance.php 0000644 00000012246 15021223077 0024030 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $listSid * @property string|null $identity * @property bool|null $read * @property bool|null $write * @property bool|null $manage * @property string|null $url */ class SyncListPermissionInstance extends InstanceResource { /** * Initialize the SyncListPermissionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $listSid Identifier of the Sync List. Either a SID or a unique name. * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. */ public function __construct(Version $version, array $payload, string $serviceSid, string $listSid, string $identity = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'listSid' => Values::array_get($payload, 'list_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity ?: $this->properties['identity'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncListPermissionContext Context for this SyncListPermissionInstance */ protected function proxy(): SyncListPermissionContext { if (!$this->context) { $this->context = new SyncListPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } return $this->context; } /** * Delete the SyncListPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncListPermissionInstance * * @return SyncListPermissionInstance Fetched SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncListPermissionInstance { return $this->proxy()->fetch(); } /** * Update the SyncListPermissionInstance * * @param bool $read Boolean flag specifying whether the identity can read the Sync List. * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync List. * @param bool $manage Boolean flag specifying whether the identity can delete the Sync List. * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemList.php 0000644 00000015314 15021223077 0021350 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class SyncMapItemList extends ListResource { /** * Construct the SyncMapItemList * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $mapSid */ public function __construct( Version $version, string $serviceSid, string $mapSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Items'; } /** * Create the SyncMapItemInstance * * @param string $key * @param array $data * @return SyncMapItemInstance Created SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $key, array $data): SyncMapItemInstance { $data = Values::of([ 'Key' => $key, 'Data' => Serialize::jsonObject($data), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'] ); } /** * Reads SyncMapItemInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapItemInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SyncMapItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncMapItemInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncMapItemPage Page of SyncMapItemInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncMapItemPage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'From' => $options['from'], 'Bounds' => $options['bounds'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncMapItemPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapItemInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncMapItemPage Page of SyncMapItemInstance */ public function getPage(string $targetUrl): SyncMapItemPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapItemPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapItemContext * * @param string $key */ public function getContext( string $key ): SyncMapItemContext { return new SyncMapItemContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $key ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncMapItemList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionInstance.php 0000644 00000012211 15021223077 0023424 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $mapSid * @property string|null $identity * @property bool|null $read * @property bool|null $write * @property bool|null $manage * @property string|null $url */ class SyncMapPermissionInstance extends InstanceResource { /** * Initialize the SyncMapPermissionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $mapSid Identifier of the Sync Map. Either a SID or a unique name. * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. */ public function __construct(Version $version, array $payload, string $serviceSid, string $mapSid, string $identity = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'mapSid' => Values::array_get($payload, 'map_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity ?: $this->properties['identity'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncMapPermissionContext Context for this SyncMapPermissionInstance */ protected function proxy(): SyncMapPermissionContext { if (!$this->context) { $this->context = new SyncMapPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } return $this->context; } /** * Delete the SyncMapPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SyncMapPermissionInstance * * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapPermissionInstance { return $this->proxy()->fetch(); } /** * Update the SyncMapPermissionInstance * * @param bool $read Boolean flag specifying whether the identity can read the Sync Map. * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Map. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemOptions.php 0000644 00000011664 15021223077 0022074 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Options; use Twilio\Values; abstract class SyncMapItemOptions { /** * @param string $ifMatch The If-Match HTTP request header * @return DeleteSyncMapItemOptions Options builder */ public static function delete( string $ifMatch = Values::NONE ): DeleteSyncMapItemOptions { return new DeleteSyncMapItemOptions( $ifMatch ); } /** * @param string $order * @param string $from * @param string $bounds * @return ReadSyncMapItemOptions Options builder */ public static function read( string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE ): ReadSyncMapItemOptions { return new ReadSyncMapItemOptions( $order, $from, $bounds ); } /** * @param string $ifMatch The If-Match HTTP request header * @return UpdateSyncMapItemOptions Options builder */ public static function update( string $ifMatch = Values::NONE ): UpdateSyncMapItemOptions { return new UpdateSyncMapItemOptions( $ifMatch ); } } class DeleteSyncMapItemOptions extends Options { /** * @param string $ifMatch The If-Match HTTP request header */ public function __construct( string $ifMatch = Values::NONE ) { $this->options['ifMatch'] = $ifMatch; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.DeleteSyncMapItemOptions ' . $options . ']'; } } class ReadSyncMapItemOptions extends Options { /** * @param string $order * @param string $from * @param string $bounds */ public function __construct( string $order = Values::NONE, string $from = Values::NONE, string $bounds = Values::NONE ) { $this->options['order'] = $order; $this->options['from'] = $from; $this->options['bounds'] = $bounds; } /** * * * @param string $order * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * * * @param string $from * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * * * @param string $bounds * @return $this Fluent Builder */ public function setBounds(string $bounds): self { $this->options['bounds'] = $bounds; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.ReadSyncMapItemOptions ' . $options . ']'; } } class UpdateSyncMapItemOptions extends Options { /** * @param string $ifMatch The If-Match HTTP request header */ public function __construct( string $ifMatch = Values::NONE ) { $this->options['ifMatch'] = $ifMatch; } /** * The If-Match HTTP request header * * @param string $ifMatch The If-Match HTTP request header * @return $this Fluent Builder */ public function setIfMatch(string $ifMatch): self { $this->options['ifMatch'] = $ifMatch; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.UpdateSyncMapItemOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionContext.php 0000644 00000010052 15021223077 0023305 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class SyncMapPermissionContext extends InstanceContext { /** * Initialize the SyncMapPermissionContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $mapSid Identifier of the Sync Map. Either a SID or a unique name. * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. */ public function __construct( Version $version, $serviceSid, $mapSid, $identity ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Permissions/' . \rawurlencode($identity) .''; } /** * Delete the SyncMapPermissionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SyncMapPermissionInstance * * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapPermissionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } /** * Update the SyncMapPermissionInstance * * @param bool $read Boolean flag specifying whether the identity can read the Sync Map. * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Map. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance { $data = Values::of([ 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapPermissionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionList.php 0000644 00000013443 15021223077 0022603 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SyncMapPermissionList extends ListResource { /** * Construct the SyncMapPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $mapSid Identifier of the Sync Map. Either a SID or a unique name. */ public function __construct( Version $version, string $serviceSid, string $mapSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Permissions'; } /** * Reads SyncMapPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapPermissionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SyncMapPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SyncMapPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SyncMapPermissionPage Page of SyncMapPermissionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SyncMapPermissionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SyncMapPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SyncMapPermissionPage Page of SyncMapPermissionInstance */ public function getPage(string $targetUrl): SyncMapPermissionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapPermissionPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapPermissionContext * * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. */ public function getContext( string $identity ): SyncMapPermissionContext { return new SyncMapPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncMapPermissionList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemInstance.php 0000644 00000012022 15021223077 0022172 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $key * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $mapSid * @property string|null $url * @property string|null $revision * @property array|null $data * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy */ class SyncMapItemInstance extends InstanceResource { /** * Initialize the SyncMapItemInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $mapSid * @param string $key */ public function __construct(Version $version, array $payload, string $serviceSid, string $mapSid, string $key = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'key' => Values::array_get($payload, 'key'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'mapSid' => Values::array_get($payload, 'map_sid'), 'url' => Values::array_get($payload, 'url'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ]; $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key ?: $this->properties['key'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SyncMapItemContext Context for this SyncMapItemInstance */ protected function proxy(): SyncMapItemContext { if (!$this->context) { $this->context = new SyncMapItemContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } return $this->context; } /** * Delete the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapItemInstance { return $this->proxy()->fetch(); } /** * Update the SyncMapItemInstance * * @param array $data * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Updated SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $data, array $options = []): SyncMapItemInstance { return $this->proxy()->update($data, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapItemInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemContext.php 0000644 00000007333 15021223077 0022063 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class SyncMapItemContext extends InstanceContext { /** * Initialize the SyncMapItemContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $mapSid * @param string $key */ public function __construct( Version $version, $serviceSid, $mapSid, $key ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Maps/' . \rawurlencode($mapSid) .'/Items/' . \rawurlencode($key) .''; } /** * Delete the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['If-Match' => $options['ifMatch']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SyncMapItemInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } /** * Update the SyncMapItemInstance * * @param array $data * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Updated SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $data, array $options = []): SyncMapItemInstance { $options = new Values($options); $data = Values::of([ 'Data' => Serialize::jsonObject($data), ]); $headers = Values::of(['If-Match' => $options['ifMatch']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapItemContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemPage.php 0000644 00000003206 15021223077 0021306 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncMapItemPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SyncMapItemInstance \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemInstance */ public function buildInstance(array $payload): SyncMapItemInstance { return new SyncMapItemInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncMapItemPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionPage.php 0000644 00000003252 15021223077 0022541 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SyncMapPermissionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SyncMapPermissionInstance \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionInstance */ public function buildInstance(array $payload): SyncMapPermissionInstance { return new SyncMapPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.SyncMapPermissionPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentContext.php 0000644 00000012162 15021223077 0020072 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionList; /** * @property DocumentPermissionList $documentPermissions * @method \Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionContext documentPermissions(string $identity) */ class DocumentContext extends InstanceContext { protected $_documentPermissions; /** * Initialize the DocumentContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Documents/' . \rawurlencode($sid) .''; } /** * Delete the DocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the DocumentInstance * * @return DocumentInstance Fetched DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DocumentInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new DocumentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the DocumentInstance * * @param array $data * @param array|Options $options Optional Arguments * @return DocumentInstance Updated DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $data, array $options = []): DocumentInstance { $options = new Values($options); $data = Values::of([ 'Data' => Serialize::jsonObject($data), ]); $headers = Values::of(['If-Match' => $options['ifMatch']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new DocumentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the documentPermissions */ protected function getDocumentPermissions(): DocumentPermissionList { if (!$this->_documentPermissions) { $this->_documentPermissions = new DocumentPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_documentPermissions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.DocumentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListOptions.php 0000644 00000003346 15021223077 0020077 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Options; use Twilio\Values; abstract class SyncListOptions { /** * @param string $uniqueName * @return CreateSyncListOptions Options builder */ public static function create( string $uniqueName = Values::NONE ): CreateSyncListOptions { return new CreateSyncListOptions( $uniqueName ); } } class CreateSyncListOptions extends Options { /** * @param string $uniqueName */ public function __construct( string $uniqueName = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.CreateSyncListOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/ServiceInstance.php 0000644 00000012511 15021223077 0016432 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Preview\Sync\Service\SyncListList; use Twilio\Rest\Preview\Sync\Service\SyncMapList; use Twilio\Rest\Preview\Sync\Service\DocumentList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property string|null $webhookUrl * @property bool|null $reachabilityWebhooksEnabled * @property bool|null $aclEnabled * @property array|null $links */ class ServiceInstance extends InstanceResource { protected $_syncLists; protected $_syncMaps; protected $_documents; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'reachabilityWebhooksEnabled' => Values::array_get($payload, 'reachability_webhooks_enabled'), 'aclEnabled' => Values::array_get($payload, 'acl_enabled'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the syncLists */ protected function getSyncLists(): SyncListList { return $this->proxy()->syncLists; } /** * Access the syncMaps */ protected function getSyncMaps(): SyncMapList { return $this->proxy()->syncMaps; } /** * Access the documents */ protected function getDocuments(): DocumentList { return $this->proxy()->documents; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/ServiceList.php 0000644 00000014001 15021223077 0015575 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'WebhookUrl' => $options['webhookUrl'], 'ReachabilityWebhooksEnabled' => Serialize::booleanToString($options['reachabilityWebhooksEnabled']), 'AclEnabled' => Serialize::booleanToString($options['aclEnabled']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.ServiceList]'; } } sdk/src/Twilio/Rest/Preview/Sync/ServiceOptions.php 0000644 00000014076 15021223077 0016331 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param string $friendlyName * @param string $webhookUrl * @param bool $reachabilityWebhooksEnabled * @param bool $aclEnabled * @return CreateServiceOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $webhookUrl = Values::NONE, bool $reachabilityWebhooksEnabled = Values::BOOL_NONE, bool $aclEnabled = Values::BOOL_NONE ): CreateServiceOptions { return new CreateServiceOptions( $friendlyName, $webhookUrl, $reachabilityWebhooksEnabled, $aclEnabled ); } /** * @param string $webhookUrl * @param string $friendlyName * @param bool $reachabilityWebhooksEnabled * @param bool $aclEnabled * @return UpdateServiceOptions Options builder */ public static function update( string $webhookUrl = Values::NONE, string $friendlyName = Values::NONE, bool $reachabilityWebhooksEnabled = Values::BOOL_NONE, bool $aclEnabled = Values::BOOL_NONE ): UpdateServiceOptions { return new UpdateServiceOptions( $webhookUrl, $friendlyName, $reachabilityWebhooksEnabled, $aclEnabled ); } } class CreateServiceOptions extends Options { /** * @param string $friendlyName * @param string $webhookUrl * @param bool $reachabilityWebhooksEnabled * @param bool $aclEnabled */ public function __construct( string $friendlyName = Values::NONE, string $webhookUrl = Values::NONE, bool $reachabilityWebhooksEnabled = Values::BOOL_NONE, bool $aclEnabled = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['webhookUrl'] = $webhookUrl; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $webhookUrl * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * * * @param bool $reachabilityWebhooksEnabled * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * * * @param bool $aclEnabled * @return $this Fluent Builder */ public function setAclEnabled(bool $aclEnabled): self { $this->options['aclEnabled'] = $aclEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.CreateServiceOptions ' . $options . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $webhookUrl * @param string $friendlyName * @param bool $reachabilityWebhooksEnabled * @param bool $aclEnabled */ public function __construct( string $webhookUrl = Values::NONE, string $friendlyName = Values::NONE, bool $reachabilityWebhooksEnabled = Values::BOOL_NONE, bool $aclEnabled = Values::BOOL_NONE ) { $this->options['webhookUrl'] = $webhookUrl; $this->options['friendlyName'] = $friendlyName; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; } /** * * * @param string $webhookUrl * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param bool $reachabilityWebhooksEnabled * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * * * @param bool $aclEnabled * @return $this Fluent Builder */ public function setAclEnabled(bool $aclEnabled): self { $this->options['aclEnabled'] = $aclEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Sync.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/ServiceContext.php 0000644 00000013536 15021223077 0016322 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Preview\Sync\Service\SyncListList; use Twilio\Rest\Preview\Sync\Service\SyncMapList; use Twilio\Rest\Preview\Sync\Service\DocumentList; /** * @property SyncListList $syncLists * @property SyncMapList $syncMaps * @property DocumentList $documents * @method \Twilio\Rest\Preview\Sync\Service\SyncMapContext syncMaps(string $sid) * @method \Twilio\Rest\Preview\Sync\Service\DocumentContext documents(string $sid) * @method \Twilio\Rest\Preview\Sync\Service\SyncListContext syncLists(string $sid) */ class ServiceContext extends InstanceContext { protected $_syncLists; protected $_syncMaps; protected $_documents; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) .''; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'WebhookUrl' => $options['webhookUrl'], 'FriendlyName' => $options['friendlyName'], 'ReachabilityWebhooksEnabled' => Serialize::booleanToString($options['reachabilityWebhooksEnabled']), 'AclEnabled' => Serialize::booleanToString($options['aclEnabled']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the syncLists */ protected function getSyncLists(): SyncListList { if (!$this->_syncLists) { $this->_syncLists = new SyncListList( $this->version, $this->solution['sid'] ); } return $this->_syncLists; } /** * Access the syncMaps */ protected function getSyncMaps(): SyncMapList { if (!$this->_syncMaps) { $this->_syncMaps = new SyncMapList( $this->version, $this->solution['sid'] ); } return $this->_syncMaps; } /** * Access the documents */ protected function getDocuments(): DocumentList { if (!$this->_documents) { $this->_documents = new DocumentList( $this->version, $this->solution['sid'] ); } return $this->_documents; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/ServicePage.php 0000644 00000003024 15021223077 0015541 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Sync; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ServiceInstance \Twilio\Rest\Preview\Sync\ServiceInstance */ public function buildInstance(array $payload): ServiceInstance { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Sync.ServicePage]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers.php 0000644 00000006442 15021223077 0015221 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentList; use Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderList; use Twilio\Version; /** * @property AuthorizationDocumentList $authorizationDocuments * @property HostedNumberOrderList $hostedNumberOrders * @method \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentContext authorizationDocuments(string $sid) * @method \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderContext hostedNumberOrders(string $sid) */ class HostedNumbers extends Version { protected $_authorizationDocuments; protected $_hostedNumberOrders; /** * Construct the HostedNumbers version of Preview * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'HostedNumbers'; } protected function getAuthorizationDocuments(): AuthorizationDocumentList { if (!$this->_authorizationDocuments) { $this->_authorizationDocuments = new AuthorizationDocumentList($this); } return $this->_authorizationDocuments; } protected function getHostedNumberOrders(): HostedNumberOrderList { if (!$this->_hostedNumberOrders) { $this->_hostedNumberOrders = new HostedNumberOrderList($this); } return $this->_hostedNumberOrders; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.HostedNumbers]'; } } sdk/src/Twilio/Rest/Preview/Wireless/CommandPage.php 0000644 00000003040 15021223077 0016376 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CommandPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CommandInstance \Twilio\Rest\Preview\Wireless\CommandInstance */ public function buildInstance(array $payload): CommandInstance { return new CommandInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Wireless.CommandPage]'; } } sdk/src/Twilio/Rest/Preview/Wireless/RatePlanList.php 0000644 00000015144 15021223077 0016575 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class RatePlanList extends ListResource { /** * Construct the RatePlanList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/RatePlans'; } /** * Create the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Created RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): RatePlanInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'FriendlyName' => $options['friendlyName'], 'DataEnabled' => Serialize::booleanToString($options['dataEnabled']), 'DataLimit' => $options['dataLimit'], 'DataMetering' => $options['dataMetering'], 'MessagingEnabled' => Serialize::booleanToString($options['messagingEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'CommandsEnabled' => Serialize::booleanToString($options['commandsEnabled']), 'NationalRoamingEnabled' => Serialize::booleanToString($options['nationalRoamingEnabled']), 'InternationalRoaming' => Serialize::map($options['internationalRoaming'], function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RatePlanInstance( $this->version, $payload ); } /** * Reads RatePlanInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RatePlanInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RatePlanInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RatePlanInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RatePlanPage Page of RatePlanInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RatePlanPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RatePlanPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RatePlanInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RatePlanPage Page of RatePlanInstance */ public function getPage(string $targetUrl): RatePlanPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RatePlanPage($this->version, $response, $this->solution); } /** * Constructs a RatePlanContext * * @param string $sid */ public function getContext( string $sid ): RatePlanContext { return new RatePlanContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Wireless.RatePlanList]'; } } sdk/src/Twilio/Rest/Preview/Wireless/RatePlanOptions.php 0000644 00000017770 15021223077 0017324 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Options; use Twilio\Values; abstract class RatePlanOptions { /** * @param string $uniqueName * @param string $friendlyName * @param bool $dataEnabled * @param int $dataLimit * @param string $dataMetering * @param bool $messagingEnabled * @param bool $voiceEnabled * @param bool $commandsEnabled * @param bool $nationalRoamingEnabled * @param string[] $internationalRoaming * @return CreateRatePlanOptions Options builder */ public static function create( string $uniqueName = Values::NONE, string $friendlyName = Values::NONE, bool $dataEnabled = Values::BOOL_NONE, int $dataLimit = Values::INT_NONE, string $dataMetering = Values::NONE, bool $messagingEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $commandsEnabled = Values::BOOL_NONE, bool $nationalRoamingEnabled = Values::BOOL_NONE, array $internationalRoaming = Values::ARRAY_NONE ): CreateRatePlanOptions { return new CreateRatePlanOptions( $uniqueName, $friendlyName, $dataEnabled, $dataLimit, $dataMetering, $messagingEnabled, $voiceEnabled, $commandsEnabled, $nationalRoamingEnabled, $internationalRoaming ); } /** * @param string $uniqueName * @param string $friendlyName * @return UpdateRatePlanOptions Options builder */ public static function update( string $uniqueName = Values::NONE, string $friendlyName = Values::NONE ): UpdateRatePlanOptions { return new UpdateRatePlanOptions( $uniqueName, $friendlyName ); } } class CreateRatePlanOptions extends Options { /** * @param string $uniqueName * @param string $friendlyName * @param bool $dataEnabled * @param int $dataLimit * @param string $dataMetering * @param bool $messagingEnabled * @param bool $voiceEnabled * @param bool $commandsEnabled * @param bool $nationalRoamingEnabled * @param string[] $internationalRoaming */ public function __construct( string $uniqueName = Values::NONE, string $friendlyName = Values::NONE, bool $dataEnabled = Values::BOOL_NONE, int $dataLimit = Values::INT_NONE, string $dataMetering = Values::NONE, bool $messagingEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $commandsEnabled = Values::BOOL_NONE, bool $nationalRoamingEnabled = Values::BOOL_NONE, array $internationalRoaming = Values::ARRAY_NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; $this->options['dataEnabled'] = $dataEnabled; $this->options['dataLimit'] = $dataLimit; $this->options['dataMetering'] = $dataMetering; $this->options['messagingEnabled'] = $messagingEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['commandsEnabled'] = $commandsEnabled; $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; $this->options['internationalRoaming'] = $internationalRoaming; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param bool $dataEnabled * @return $this Fluent Builder */ public function setDataEnabled(bool $dataEnabled): self { $this->options['dataEnabled'] = $dataEnabled; return $this; } /** * * * @param int $dataLimit * @return $this Fluent Builder */ public function setDataLimit(int $dataLimit): self { $this->options['dataLimit'] = $dataLimit; return $this; } /** * * * @param string $dataMetering * @return $this Fluent Builder */ public function setDataMetering(string $dataMetering): self { $this->options['dataMetering'] = $dataMetering; return $this; } /** * * * @param bool $messagingEnabled * @return $this Fluent Builder */ public function setMessagingEnabled(bool $messagingEnabled): self { $this->options['messagingEnabled'] = $messagingEnabled; return $this; } /** * * * @param bool $voiceEnabled * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * * * @param bool $commandsEnabled * @return $this Fluent Builder */ public function setCommandsEnabled(bool $commandsEnabled): self { $this->options['commandsEnabled'] = $commandsEnabled; return $this; } /** * * * @param bool $nationalRoamingEnabled * @return $this Fluent Builder */ public function setNationalRoamingEnabled(bool $nationalRoamingEnabled): self { $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; return $this; } /** * * * @param string[] $internationalRoaming * @return $this Fluent Builder */ public function setInternationalRoaming(array $internationalRoaming): self { $this->options['internationalRoaming'] = $internationalRoaming; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Wireless.CreateRatePlanOptions ' . $options . ']'; } } class UpdateRatePlanOptions extends Options { /** * @param string $uniqueName * @param string $friendlyName */ public function __construct( string $uniqueName = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Wireless.UpdateRatePlanOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/RatePlanPage.php 0000644 00000003046 15021223077 0016534 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RatePlanPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RatePlanInstance \Twilio\Rest\Preview\Wireless\RatePlanInstance */ public function buildInstance(array $payload): RatePlanInstance { return new RatePlanInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Wireless.RatePlanPage]'; } } sdk/src/Twilio/Rest/Preview/Wireless/SimContext.php 0000644 00000012334 15021223077 0016326 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Preview\Wireless\Sim\UsageList; /** * @property UsageList $usage * @method \Twilio\Rest\Preview\Wireless\Sim\UsageContext usage() */ class SimContext extends InstanceContext { protected $_usage; /** * Initialize the SimContext * * @param Version $version Version that contains the resource * @param string $sid */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Sims/' . \rawurlencode($sid) .''; } /** * Fetch the SimInstance * * @return SimInstance Fetched SimInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SimInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SimInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the SimInstance * * @param array|Options $options Optional Arguments * @return SimInstance Updated SimInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SimInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'CallbackMethod' => $options['callbackMethod'], 'CallbackUrl' => $options['callbackUrl'], 'FriendlyName' => $options['friendlyName'], 'RatePlan' => $options['ratePlan'], 'Status' => $options['status'], 'CommandsCallbackMethod' => $options['commandsCallbackMethod'], 'CommandsCallbackUrl' => $options['commandsCallbackUrl'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SimInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the usage */ protected function getUsage(): UsageList { if (!$this->_usage) { $this->_usage = new UsageList( $this->version, $this->solution['sid'] ); } return $this->_usage; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.SimContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/SimList.php 0000644 00000013023 15021223077 0015611 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SimList extends ListResource { /** * Construct the SimList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Sims'; } /** * Reads SimInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SimInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SimInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SimInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SimPage Page of SimInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SimPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'Iccid' => $options['iccid'], 'RatePlan' => $options['ratePlan'], 'EId' => $options['eId'], 'SimRegistrationCode' => $options['simRegistrationCode'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SimPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SimInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SimPage Page of SimInstance */ public function getPage(string $targetUrl): SimPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SimPage($this->version, $response, $this->solution); } /** * Constructs a SimContext * * @param string $sid */ public function getContext( string $sid ): SimContext { return new SimContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Wireless.SimList]'; } } sdk/src/Twilio/Rest/Preview/Wireless/CommandContext.php 0000644 00000003644 15021223077 0017160 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class CommandContext extends InstanceContext { /** * Initialize the CommandContext * * @param Version $version Version that contains the resource * @param string $sid */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Commands/' . \rawurlencode($sid) .''; } /** * Fetch the CommandInstance * * @return CommandInstance Fetched CommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CommandInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CommandInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.CommandContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/RatePlanContext.php 0000644 00000005732 15021223077 0017310 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class RatePlanContext extends InstanceContext { /** * Initialize the RatePlanContext * * @param Version $version Version that contains the resource * @param string $sid */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/RatePlans/' . \rawurlencode($sid) .''; } /** * Delete the RatePlanInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RatePlanInstance * * @return RatePlanInstance Fetched RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RatePlanInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RatePlanInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Updated RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): RatePlanInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RatePlanInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.RatePlanContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/CommandOptions.php 0000644 00000014474 15021223077 0017172 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Options; use Twilio\Values; abstract class CommandOptions { /** * @param string $device * @param string $sim * @param string $callbackMethod * @param string $callbackUrl * @param string $commandMode * @param string $includeSid * @return CreateCommandOptions Options builder */ public static function create( string $device = Values::NONE, string $sim = Values::NONE, string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $commandMode = Values::NONE, string $includeSid = Values::NONE ): CreateCommandOptions { return new CreateCommandOptions( $device, $sim, $callbackMethod, $callbackUrl, $commandMode, $includeSid ); } /** * @param string $device * @param string $sim * @param string $status * @param string $direction * @return ReadCommandOptions Options builder */ public static function read( string $device = Values::NONE, string $sim = Values::NONE, string $status = Values::NONE, string $direction = Values::NONE ): ReadCommandOptions { return new ReadCommandOptions( $device, $sim, $status, $direction ); } } class CreateCommandOptions extends Options { /** * @param string $device * @param string $sim * @param string $callbackMethod * @param string $callbackUrl * @param string $commandMode * @param string $includeSid */ public function __construct( string $device = Values::NONE, string $sim = Values::NONE, string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $commandMode = Values::NONE, string $includeSid = Values::NONE ) { $this->options['device'] = $device; $this->options['sim'] = $sim; $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['commandMode'] = $commandMode; $this->options['includeSid'] = $includeSid; } /** * * * @param string $device * @return $this Fluent Builder */ public function setDevice(string $device): self { $this->options['device'] = $device; return $this; } /** * * * @param string $sim * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * * * @param string $callbackMethod * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * * * @param string $callbackUrl * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * * * @param string $commandMode * @return $this Fluent Builder */ public function setCommandMode(string $commandMode): self { $this->options['commandMode'] = $commandMode; return $this; } /** * * * @param string $includeSid * @return $this Fluent Builder */ public function setIncludeSid(string $includeSid): self { $this->options['includeSid'] = $includeSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Wireless.CreateCommandOptions ' . $options . ']'; } } class ReadCommandOptions extends Options { /** * @param string $device * @param string $sim * @param string $status * @param string $direction */ public function __construct( string $device = Values::NONE, string $sim = Values::NONE, string $status = Values::NONE, string $direction = Values::NONE ) { $this->options['device'] = $device; $this->options['sim'] = $sim; $this->options['status'] = $status; $this->options['direction'] = $direction; } /** * * * @param string $device * @return $this Fluent Builder */ public function setDevice(string $device): self { $this->options['device'] = $device; return $this; } /** * * * @param string $sim * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * * * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * * * @param string $direction * @return $this Fluent Builder */ public function setDirection(string $direction): self { $this->options['direction'] = $direction; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Wireless.ReadCommandOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/CommandInstance.php 0000644 00000010110 15021223077 0017262 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $deviceSid * @property string|null $simSid * @property string|null $command * @property string|null $commandMode * @property string|null $status * @property string|null $direction * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class CommandInstance extends InstanceResource { /** * Initialize the CommandInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'deviceSid' => Values::array_get($payload, 'device_sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'command' => Values::array_get($payload, 'command'), 'commandMode' => Values::array_get($payload, 'command_mode'), 'status' => Values::array_get($payload, 'status'), 'direction' => Values::array_get($payload, 'direction'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CommandContext Context for this CommandInstance */ protected function proxy(): CommandContext { if (!$this->context) { $this->context = new CommandContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the CommandInstance * * @return CommandInstance Fetched CommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CommandInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.CommandInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/CommandList.php 0000644 00000015132 15021223077 0016442 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CommandList extends ListResource { /** * Construct the CommandList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Commands'; } /** * Create the CommandInstance * * @param string $command * @param array|Options $options Optional Arguments * @return CommandInstance Created CommandInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $command, array $options = []): CommandInstance { $options = new Values($options); $data = Values::of([ 'Command' => $command, 'Device' => $options['device'], 'Sim' => $options['sim'], 'CallbackMethod' => $options['callbackMethod'], 'CallbackUrl' => $options['callbackUrl'], 'CommandMode' => $options['commandMode'], 'IncludeSid' => $options['includeSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CommandInstance( $this->version, $payload ); } /** * Reads CommandInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CommandInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CommandInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CommandInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CommandPage Page of CommandInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CommandPage { $options = new Values($options); $params = Values::of([ 'Device' => $options['device'], 'Sim' => $options['sim'], 'Status' => $options['status'], 'Direction' => $options['direction'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CommandPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CommandInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CommandPage Page of CommandInstance */ public function getPage(string $targetUrl): CommandPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CommandPage($this->version, $response, $this->solution); } /** * Constructs a CommandContext * * @param string $sid */ public function getContext( string $sid ): CommandContext { return new CommandContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Wireless.CommandList]'; } } sdk/src/Twilio/Rest/Preview/Wireless/RatePlanInstance.php 0000644 00000012244 15021223077 0017424 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $uniqueName * @property string|null $accountSid * @property string|null $friendlyName * @property bool|null $dataEnabled * @property string|null $dataMetering * @property int|null $dataLimit * @property bool|null $messagingEnabled * @property bool|null $voiceEnabled * @property bool|null $nationalRoamingEnabled * @property string[]|null $internationalRoaming * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class RatePlanInstance extends InstanceResource { /** * Initialize the RatePlanInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dataEnabled' => Values::array_get($payload, 'data_enabled'), 'dataMetering' => Values::array_get($payload, 'data_metering'), 'dataLimit' => Values::array_get($payload, 'data_limit'), 'messagingEnabled' => Values::array_get($payload, 'messaging_enabled'), 'voiceEnabled' => Values::array_get($payload, 'voice_enabled'), 'nationalRoamingEnabled' => Values::array_get($payload, 'national_roaming_enabled'), 'internationalRoaming' => Values::array_get($payload, 'international_roaming'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RatePlanContext Context for this RatePlanInstance */ protected function proxy(): RatePlanContext { if (!$this->context) { $this->context = new RatePlanContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the RatePlanInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RatePlanInstance * * @return RatePlanInstance Fetched RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RatePlanInstance { return $this->proxy()->fetch(); } /** * Update the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Updated RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): RatePlanInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.RatePlanInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageList.php 0000644 00000002733 15021223077 0016663 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless\Sim; use Twilio\ListResource; use Twilio\Version; class UsageList extends ListResource { /** * Construct the UsageList * * @param Version $version Version that contains the resource * @param string $simSid */ public function __construct( Version $version, string $simSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'simSid' => $simSid, ]; } /** * Constructs a UsageContext */ public function getContext( ): UsageContext { return new UsageContext( $this->version, $this->solution['simSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Wireless.UsageList]'; } } sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageInstance.php 0000644 00000007622 15021223077 0017516 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless\Sim; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $simSid * @property string|null $simUniqueName * @property string|null $accountSid * @property array|null $period * @property array|null $commandsUsage * @property array|null $commandsCosts * @property array|null $dataUsage * @property array|null $dataCosts * @property string|null $url */ class UsageInstance extends InstanceResource { /** * Initialize the UsageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $simSid */ public function __construct(Version $version, array $payload, string $simSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'simSid' => Values::array_get($payload, 'sim_sid'), 'simUniqueName' => Values::array_get($payload, 'sim_unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'period' => Values::array_get($payload, 'period'), 'commandsUsage' => Values::array_get($payload, 'commands_usage'), 'commandsCosts' => Values::array_get($payload, 'commands_costs'), 'dataUsage' => Values::array_get($payload, 'data_usage'), 'dataCosts' => Values::array_get($payload, 'data_costs'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['simSid' => $simSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UsageContext Context for this UsageInstance */ protected function proxy(): UsageContext { if (!$this->context) { $this->context = new UsageContext( $this->version, $this->solution['simSid'] ); } return $this->context; } /** * Fetch the UsageInstance * * @param array|Options $options Optional Arguments * @return UsageInstance Fetched UsageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): UsageInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.UsageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageContext.php 0000644 00000004351 15021223077 0017372 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless\Sim; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class UsageContext extends InstanceContext { /** * Initialize the UsageContext * * @param Version $version Version that contains the resource * @param string $simSid */ public function __construct( Version $version, $simSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'simSid' => $simSid, ]; $this->uri = '/Sims/' . \rawurlencode($simSid) .'/Usage'; } /** * Fetch the UsageInstance * * @param array|Options $options Optional Arguments * @return UsageInstance Fetched UsageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): UsageInstance { $options = new Values($options); $params = Values::of([ 'End' => $options['end'], 'Start' => $options['start'], ]); $payload = $this->version->fetch('GET', $this->uri, $params, []); return new UsageInstance( $this->version, $payload, $this->solution['simSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.UsageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageOptions.php 0000644 00000004033 15021223077 0017376 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless\Sim; use Twilio\Options; use Twilio\Values; abstract class UsageOptions { /** * @param string $end * @param string $start * @return FetchUsageOptions Options builder */ public static function fetch( string $end = Values::NONE, string $start = Values::NONE ): FetchUsageOptions { return new FetchUsageOptions( $end, $start ); } } class FetchUsageOptions extends Options { /** * @param string $end * @param string $start */ public function __construct( string $end = Values::NONE, string $start = Values::NONE ) { $this->options['end'] = $end; $this->options['start'] = $start; } /** * * * @param string $end * @return $this Fluent Builder */ public function setEnd(string $end): self { $this->options['end'] = $end; return $this; } /** * * * @param string $start * @return $this Fluent Builder */ public function setStart(string $start): self { $this->options['start'] = $start; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Wireless.FetchUsageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsagePage.php 0000644 00000003067 15021223077 0016625 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless\Sim; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UsagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UsageInstance \Twilio\Rest\Preview\Wireless\Sim\UsageInstance */ public function buildInstance(array $payload): UsageInstance { return new UsageInstance($this->version, $payload, $this->solution['simSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Wireless.UsagePage]'; } } sdk/src/Twilio/Rest/Preview/Wireless/SimInstance.php 0000644 00000013560 15021223077 0016450 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Preview\Wireless\Sim\UsageList; /** * @property string|null $sid * @property string|null $uniqueName * @property string|null $accountSid * @property string|null $ratePlanSid * @property string|null $friendlyName * @property string|null $iccid * @property string|null $eId * @property string|null $status * @property string|null $commandsCallbackUrl * @property string|null $commandsCallbackMethod * @property string|null $smsFallbackMethod * @property string|null $smsFallbackUrl * @property string|null $smsMethod * @property string|null $smsUrl * @property string|null $voiceFallbackMethod * @property string|null $voiceFallbackUrl * @property string|null $voiceMethod * @property string|null $voiceUrl * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class SimInstance extends InstanceResource { protected $_usage; /** * Initialize the SimInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'ratePlanSid' => Values::array_get($payload, 'rate_plan_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'iccid' => Values::array_get($payload, 'iccid'), 'eId' => Values::array_get($payload, 'e_id'), 'status' => Values::array_get($payload, 'status'), 'commandsCallbackUrl' => Values::array_get($payload, 'commands_callback_url'), 'commandsCallbackMethod' => Values::array_get($payload, 'commands_callback_method'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SimContext Context for this SimInstance */ protected function proxy(): SimContext { if (!$this->context) { $this->context = new SimContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the SimInstance * * @return SimInstance Fetched SimInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SimInstance { return $this->proxy()->fetch(); } /** * Update the SimInstance * * @param array|Options $options Optional Arguments * @return SimInstance Updated SimInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SimInstance { return $this->proxy()->update($options); } /** * Access the usage */ protected function getUsage(): UsageList { return $this->proxy()->usage; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.SimInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/SimPage.php 0000644 00000003010 15021223077 0015545 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SimPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SimInstance \Twilio\Rest\Preview\Wireless\SimInstance */ public function buildInstance(array $payload): SimInstance { return new SimInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Wireless.SimPage]'; } } sdk/src/Twilio/Rest/Preview/Wireless/SimOptions.php 0000644 00000030055 15021223077 0016335 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Options; use Twilio\Values; abstract class SimOptions { /** * @param string $status * @param string $iccid * @param string $ratePlan * @param string $eId * @param string $simRegistrationCode * @return ReadSimOptions Options builder */ public static function read( string $status = Values::NONE, string $iccid = Values::NONE, string $ratePlan = Values::NONE, string $eId = Values::NONE, string $simRegistrationCode = Values::NONE ): ReadSimOptions { return new ReadSimOptions( $status, $iccid, $ratePlan, $eId, $simRegistrationCode ); } /** * @param string $uniqueName * @param string $callbackMethod * @param string $callbackUrl * @param string $friendlyName * @param string $ratePlan * @param string $status * @param string $commandsCallbackMethod * @param string $commandsCallbackUrl * @param string $smsFallbackMethod * @param string $smsFallbackUrl * @param string $smsMethod * @param string $smsUrl * @param string $voiceFallbackMethod * @param string $voiceFallbackUrl * @param string $voiceMethod * @param string $voiceUrl * @return UpdateSimOptions Options builder */ public static function update( string $uniqueName = Values::NONE, string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $friendlyName = Values::NONE, string $ratePlan = Values::NONE, string $status = Values::NONE, string $commandsCallbackMethod = Values::NONE, string $commandsCallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE ): UpdateSimOptions { return new UpdateSimOptions( $uniqueName, $callbackMethod, $callbackUrl, $friendlyName, $ratePlan, $status, $commandsCallbackMethod, $commandsCallbackUrl, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl ); } } class ReadSimOptions extends Options { /** * @param string $status * @param string $iccid * @param string $ratePlan * @param string $eId * @param string $simRegistrationCode */ public function __construct( string $status = Values::NONE, string $iccid = Values::NONE, string $ratePlan = Values::NONE, string $eId = Values::NONE, string $simRegistrationCode = Values::NONE ) { $this->options['status'] = $status; $this->options['iccid'] = $iccid; $this->options['ratePlan'] = $ratePlan; $this->options['eId'] = $eId; $this->options['simRegistrationCode'] = $simRegistrationCode; } /** * * * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * * * @param string $iccid * @return $this Fluent Builder */ public function setIccid(string $iccid): self { $this->options['iccid'] = $iccid; return $this; } /** * * * @param string $ratePlan * @return $this Fluent Builder */ public function setRatePlan(string $ratePlan): self { $this->options['ratePlan'] = $ratePlan; return $this; } /** * * * @param string $eId * @return $this Fluent Builder */ public function setEId(string $eId): self { $this->options['eId'] = $eId; return $this; } /** * * * @param string $simRegistrationCode * @return $this Fluent Builder */ public function setSimRegistrationCode(string $simRegistrationCode): self { $this->options['simRegistrationCode'] = $simRegistrationCode; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Wireless.ReadSimOptions ' . $options . ']'; } } class UpdateSimOptions extends Options { /** * @param string $uniqueName * @param string $callbackMethod * @param string $callbackUrl * @param string $friendlyName * @param string $ratePlan * @param string $status * @param string $commandsCallbackMethod * @param string $commandsCallbackUrl * @param string $smsFallbackMethod * @param string $smsFallbackUrl * @param string $smsMethod * @param string $smsUrl * @param string $voiceFallbackMethod * @param string $voiceFallbackUrl * @param string $voiceMethod * @param string $voiceUrl */ public function __construct( string $uniqueName = Values::NONE, string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $friendlyName = Values::NONE, string $ratePlan = Values::NONE, string $status = Values::NONE, string $commandsCallbackMethod = Values::NONE, string $commandsCallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['friendlyName'] = $friendlyName; $this->options['ratePlan'] = $ratePlan; $this->options['status'] = $status; $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * * * @param string $callbackMethod * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * * * @param string $callbackUrl * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $ratePlan * @return $this Fluent Builder */ public function setRatePlan(string $ratePlan): self { $this->options['ratePlan'] = $ratePlan; return $this; } /** * * * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * * * @param string $commandsCallbackMethod * @return $this Fluent Builder */ public function setCommandsCallbackMethod(string $commandsCallbackMethod): self { $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; return $this; } /** * * * @param string $commandsCallbackUrl * @return $this Fluent Builder */ public function setCommandsCallbackUrl(string $commandsCallbackUrl): self { $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; return $this; } /** * * * @param string $smsFallbackMethod * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * * * @param string $smsFallbackUrl * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * * * @param string $smsMethod * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * * * @param string $smsUrl * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * * * @param string $voiceFallbackMethod * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * * * @param string $voiceFallbackUrl * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * * * @param string $voiceMethod * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * * * @param string $voiceUrl * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.Wireless.UpdateSimOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices.php 0000644 00000005161 15021223077 0015504 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\DeployedDevices\FleetList; use Twilio\Version; /** * @property FleetList $fleets * @method \Twilio\Rest\Preview\DeployedDevices\FleetContext fleets(string $sid) */ class DeployedDevices extends Version { protected $_fleets; /** * Construct the DeployedDevices version of Preview * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'DeployedDevices'; } protected function getFleets(): FleetList { if (!$this->_fleets) { $this->_fleets = new FleetList($this); } return $this->_fleets; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetList.php 0000644 00000013376 15021223077 0017406 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class FleetList extends ListResource { /** * Construct the FleetList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Fleets'; } /** * Create the FleetInstance * * @param array|Options $options Optional Arguments * @return FleetInstance Created FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): FleetInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FleetInstance( $this->version, $payload ); } /** * Reads FleetInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FleetInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams FleetInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FleetInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FleetPage Page of FleetInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FleetPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FleetPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FleetInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FleetPage Page of FleetInstance */ public function getPage(string $targetUrl): FleetPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FleetPage($this->version, $response, $this->solution); } /** * Constructs a FleetContext * * @param string $sid Provides a 34 character string that uniquely identifies the requested Fleet resource. */ public function getContext( string $sid ): FleetContext { return new FleetContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices.FleetList]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetOptions.php 0000644 00000011026 15021223077 0020114 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices; use Twilio\Options; use Twilio\Values; abstract class FleetOptions { /** * @param string $friendlyName Provides a human readable descriptive text for this Fleet, up to 256 characters long. * @return CreateFleetOptions Options builder */ public static function create( string $friendlyName = Values::NONE ): CreateFleetOptions { return new CreateFleetOptions( $friendlyName ); } /** * @param string $friendlyName Provides a human readable descriptive text for this Fleet, up to 256 characters long. * @param string $defaultDeploymentSid Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. * @return UpdateFleetOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $defaultDeploymentSid = Values::NONE ): UpdateFleetOptions { return new UpdateFleetOptions( $friendlyName, $defaultDeploymentSid ); } } class CreateFleetOptions extends Options { /** * @param string $friendlyName Provides a human readable descriptive text for this Fleet, up to 256 characters long. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * Provides a human readable descriptive text for this Fleet, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text for this Fleet, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.CreateFleetOptions ' . $options . ']'; } } class UpdateFleetOptions extends Options { /** * @param string $friendlyName Provides a human readable descriptive text for this Fleet, up to 256 characters long. * @param string $defaultDeploymentSid Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. */ public function __construct( string $friendlyName = Values::NONE, string $defaultDeploymentSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['defaultDeploymentSid'] = $defaultDeploymentSid; } /** * Provides a human readable descriptive text for this Fleet, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text for this Fleet, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. * * @param string $defaultDeploymentSid Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. * @return $this Fluent Builder */ public function setDefaultDeploymentSid(string $defaultDeploymentSid): self { $this->options['defaultDeploymentSid'] = $defaultDeploymentSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.UpdateFleetOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetPage.php 0000644 00000003051 15021223077 0017334 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FleetPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FleetInstance \Twilio\Rest\Preview\DeployedDevices\FleetInstance */ public function buildInstance(array $payload): FleetInstance { return new FleetInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices.FleetPage]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentOptions.php 0000644 00000013272 15021223077 0022241 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Options; use Twilio\Values; abstract class DeploymentOptions { /** * @param string $friendlyName Provides a human readable descriptive text for this Deployment, up to 256 characters long. * @param string $syncServiceSid Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. * @return CreateDeploymentOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $syncServiceSid = Values::NONE ): CreateDeploymentOptions { return new CreateDeploymentOptions( $friendlyName, $syncServiceSid ); } /** * @param string $friendlyName Provides a human readable descriptive text for this Deployment, up to 64 characters long * @param string $syncServiceSid Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. * @return UpdateDeploymentOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $syncServiceSid = Values::NONE ): UpdateDeploymentOptions { return new UpdateDeploymentOptions( $friendlyName, $syncServiceSid ); } } class CreateDeploymentOptions extends Options { /** * @param string $friendlyName Provides a human readable descriptive text for this Deployment, up to 256 characters long. * @param string $syncServiceSid Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. */ public function __construct( string $friendlyName = Values::NONE, string $syncServiceSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['syncServiceSid'] = $syncServiceSid; } /** * Provides a human readable descriptive text for this Deployment, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text for this Deployment, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. * * @param string $syncServiceSid Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. * @return $this Fluent Builder */ public function setSyncServiceSid(string $syncServiceSid): self { $this->options['syncServiceSid'] = $syncServiceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.CreateDeploymentOptions ' . $options . ']'; } } class UpdateDeploymentOptions extends Options { /** * @param string $friendlyName Provides a human readable descriptive text for this Deployment, up to 64 characters long * @param string $syncServiceSid Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. */ public function __construct( string $friendlyName = Values::NONE, string $syncServiceSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['syncServiceSid'] = $syncServiceSid; } /** * Provides a human readable descriptive text for this Deployment, up to 64 characters long * * @param string $friendlyName Provides a human readable descriptive text for this Deployment, up to 64 characters long * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. * * @param string $syncServiceSid Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. * @return $this Fluent Builder */ public function setSyncServiceSid(string $syncServiceSid): self { $this->options['syncServiceSid'] = $syncServiceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.UpdateDeploymentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateOptions.php 0000644 00000016106 15021223077 0022342 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Options; use Twilio\Values; abstract class CertificateOptions { /** * @param string $friendlyName Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. * @return CreateCertificateOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $deviceSid = Values::NONE ): CreateCertificateOptions { return new CreateCertificateOptions( $friendlyName, $deviceSid ); } /** * @param string $deviceSid Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. * @return ReadCertificateOptions Options builder */ public static function read( string $deviceSid = Values::NONE ): ReadCertificateOptions { return new ReadCertificateOptions( $deviceSid ); } /** * @param string $friendlyName Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. * @return UpdateCertificateOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $deviceSid = Values::NONE ): UpdateCertificateOptions { return new UpdateCertificateOptions( $friendlyName, $deviceSid ); } } class CreateCertificateOptions extends Options { /** * @param string $friendlyName Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. */ public function __construct( string $friendlyName = Values::NONE, string $deviceSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['deviceSid'] = $deviceSid; } /** * Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. * * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. * @return $this Fluent Builder */ public function setDeviceSid(string $deviceSid): self { $this->options['deviceSid'] = $deviceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.CreateCertificateOptions ' . $options . ']'; } } class ReadCertificateOptions extends Options { /** * @param string $deviceSid Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. */ public function __construct( string $deviceSid = Values::NONE ) { $this->options['deviceSid'] = $deviceSid; } /** * Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. * * @param string $deviceSid Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. * @return $this Fluent Builder */ public function setDeviceSid(string $deviceSid): self { $this->options['deviceSid'] = $deviceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.ReadCertificateOptions ' . $options . ']'; } } class UpdateCertificateOptions extends Options { /** * @param string $friendlyName Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. */ public function __construct( string $friendlyName = Values::NONE, string $deviceSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['deviceSid'] = $deviceSid; } /** * Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. * * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. * @return $this Fluent Builder */ public function setDeviceSid(string $deviceSid): self { $this->options['deviceSid'] = $deviceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.UpdateCertificateOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateContext.php 0000644 00000006540 15021223077 0022334 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class CertificateContext extends InstanceContext { /** * Initialize the CertificateContext * * @param Version $version Version that contains the resource * @param string $fleetSid * @param string $sid Provides a 34 character string that uniquely identifies the requested Certificate credential resource. */ public function __construct( Version $version, $fleetSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'fleetSid' => $fleetSid, 'sid' => $sid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) .'/Certificates/' . \rawurlencode($sid) .''; } /** * Delete the CertificateInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CertificateInstance * * @return CertificateInstance Fetched CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CertificateInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CertificateInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Update the CertificateInstance * * @param array|Options $options Optional Arguments * @return CertificateInstance Updated CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CertificateInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DeviceSid' => $options['deviceSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CertificateInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.CertificateContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyList.php 0000644 00000014504 15021223077 0020130 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class KeyList extends ListResource { /** * Construct the KeyList * * @param Version $version Version that contains the resource * @param string $fleetSid */ public function __construct( Version $version, string $fleetSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'fleetSid' => $fleetSid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) .'/Keys'; } /** * Create the KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Created KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): KeyInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DeviceSid' => $options['deviceSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new KeyInstance( $this->version, $payload, $this->solution['fleetSid'] ); } /** * Reads KeyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return KeyInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams KeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of KeyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return KeyPage Page of KeyInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): KeyPage { $options = new Values($options); $params = Values::of([ 'DeviceSid' => $options['deviceSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new KeyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of KeyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return KeyPage Page of KeyInstance */ public function getPage(string $targetUrl): KeyPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new KeyPage($this->version, $response, $this->solution); } /** * Constructs a KeyContext * * @param string $sid Provides a 34 character string that uniquely identifies the requested Key credential resource. */ public function getContext( string $sid ): KeyContext { return new KeyContext( $this->version, $this->solution['fleetSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices.KeyList]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentPage.php 0000644 00000003160 15021223077 0021455 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DeploymentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DeploymentInstance \Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentInstance */ public function buildInstance(array $payload): DeploymentInstance { return new DeploymentInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices.DeploymentPage]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateInstance.php 0000644 00000011503 15021223077 0022447 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $url * @property string|null $friendlyName * @property string|null $fleetSid * @property string|null $accountSid * @property string|null $deviceSid * @property string|null $thumbprint * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class CertificateInstance extends InstanceResource { /** * Initialize the CertificateInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $fleetSid * @param string $sid Provides a 34 character string that uniquely identifies the requested Certificate credential resource. */ public function __construct(Version $version, array $payload, string $fleetSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'deviceSid' => Values::array_get($payload, 'device_sid'), 'thumbprint' => Values::array_get($payload, 'thumbprint'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CertificateContext Context for this CertificateInstance */ protected function proxy(): CertificateContext { if (!$this->context) { $this->context = new CertificateContext( $this->version, $this->solution['fleetSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the CertificateInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CertificateInstance * * @return CertificateInstance Fetched CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CertificateInstance { return $this->proxy()->fetch(); } /** * Update the CertificateInstance * * @param array|Options $options Optional Arguments * @return CertificateInstance Updated CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CertificateInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.CertificateInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceList.php 0000644 00000015213 15021223077 0020575 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class DeviceList extends ListResource { /** * Construct the DeviceList * * @param Version $version Version that contains the resource * @param string $fleetSid */ public function __construct( Version $version, string $fleetSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'fleetSid' => $fleetSid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) .'/Devices'; } /** * Create the DeviceInstance * * @param array|Options $options Optional Arguments * @return DeviceInstance Created DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): DeviceInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'FriendlyName' => $options['friendlyName'], 'Identity' => $options['identity'], 'DeploymentSid' => $options['deploymentSid'], 'Enabled' => Serialize::booleanToString($options['enabled']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DeviceInstance( $this->version, $payload, $this->solution['fleetSid'] ); } /** * Reads DeviceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeviceInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams DeviceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DeviceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DevicePage Page of DeviceInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DevicePage { $options = new Values($options); $params = Values::of([ 'DeploymentSid' => $options['deploymentSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DevicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeviceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DevicePage Page of DeviceInstance */ public function getPage(string $targetUrl): DevicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DevicePage($this->version, $response, $this->solution); } /** * Constructs a DeviceContext * * @param string $sid Provides a 34 character string that uniquely identifies the requested Device resource. */ public function getContext( string $sid ): DeviceContext { return new DeviceContext( $this->version, $this->solution['fleetSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices.DeviceList]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceInstance.php 0000644 00000012123 15021223077 0021423 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $url * @property string|null $uniqueName * @property string|null $friendlyName * @property string|null $fleetSid * @property bool|null $enabled * @property string|null $accountSid * @property string|null $identity * @property string|null $deploymentSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property \DateTime|null $dateAuthenticated */ class DeviceInstance extends InstanceResource { /** * Initialize the DeviceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $fleetSid * @param string $sid Provides a 34 character string that uniquely identifies the requested Device resource. */ public function __construct(Version $version, array $payload, string $fleetSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'enabled' => Values::array_get($payload, 'enabled'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'identity' => Values::array_get($payload, 'identity'), 'deploymentSid' => Values::array_get($payload, 'deployment_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'dateAuthenticated' => Deserialize::dateTime(Values::array_get($payload, 'date_authenticated')), ]; $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DeviceContext Context for this DeviceInstance */ protected function proxy(): DeviceContext { if (!$this->context) { $this->context = new DeviceContext( $this->version, $this->solution['fleetSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the DeviceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DeviceInstance * * @return DeviceInstance Fetched DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeviceInstance { return $this->proxy()->fetch(); } /** * Update the DeviceInstance * * @param array|Options $options Optional Arguments * @return DeviceInstance Updated DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DeviceInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.DeviceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentContext.php 0000644 00000006517 15021223077 0022236 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class DeploymentContext extends InstanceContext { /** * Initialize the DeploymentContext * * @param Version $version Version that contains the resource * @param string $fleetSid * @param string $sid Provides a 34 character string that uniquely identifies the requested Deployment resource. */ public function __construct( Version $version, $fleetSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'fleetSid' => $fleetSid, 'sid' => $sid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) .'/Deployments/' . \rawurlencode($sid) .''; } /** * Delete the DeploymentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the DeploymentInstance * * @return DeploymentInstance Fetched DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeploymentInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new DeploymentInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Update the DeploymentInstance * * @param array|Options $options Optional Arguments * @return DeploymentInstance Updated DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DeploymentInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'SyncServiceSid' => $options['syncServiceSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DeploymentInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.DeploymentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentList.php 0000644 00000014303 15021223077 0021515 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DeploymentList extends ListResource { /** * Construct the DeploymentList * * @param Version $version Version that contains the resource * @param string $fleetSid */ public function __construct( Version $version, string $fleetSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'fleetSid' => $fleetSid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) .'/Deployments'; } /** * Create the DeploymentInstance * * @param array|Options $options Optional Arguments * @return DeploymentInstance Created DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): DeploymentInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'SyncServiceSid' => $options['syncServiceSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new DeploymentInstance( $this->version, $payload, $this->solution['fleetSid'] ); } /** * Reads DeploymentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeploymentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DeploymentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DeploymentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DeploymentPage Page of DeploymentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DeploymentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DeploymentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeploymentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DeploymentPage Page of DeploymentInstance */ public function getPage(string $targetUrl): DeploymentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DeploymentPage($this->version, $response, $this->solution); } /** * Constructs a DeploymentContext * * @param string $sid Provides a 34 character string that uniquely identifies the requested Deployment resource. */ public function getContext( string $sid ): DeploymentContext { return new DeploymentContext( $this->version, $this->solution['fleetSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices.DeploymentList]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DevicePage.php 0000644 00000003130 15021223077 0020531 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DevicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DeviceInstance \Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceInstance */ public function buildInstance(array $payload): DeviceInstance { return new DeviceInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices.DevicePage]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentInstance.php 0000644 00000011313 15021223077 0022344 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $url * @property string|null $friendlyName * @property string|null $fleetSid * @property string|null $accountSid * @property string|null $syncServiceSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class DeploymentInstance extends InstanceResource { /** * Initialize the DeploymentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $fleetSid * @param string $sid Provides a 34 character string that uniquely identifies the requested Deployment resource. */ public function __construct(Version $version, array $payload, string $fleetSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'syncServiceSid' => Values::array_get($payload, 'sync_service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DeploymentContext Context for this DeploymentInstance */ protected function proxy(): DeploymentContext { if (!$this->context) { $this->context = new DeploymentContext( $this->version, $this->solution['fleetSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the DeploymentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the DeploymentInstance * * @return DeploymentInstance Fetched DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeploymentInstance { return $this->proxy()->fetch(); } /** * Update the DeploymentInstance * * @param array|Options $options Optional Arguments * @return DeploymentInstance Updated DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DeploymentInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.DeploymentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceOptions.php 0000644 00000025505 15021223077 0021322 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Options; use Twilio\Values; abstract class DeviceOptions { /** * @param string $uniqueName Provides a unique and addressable name to be assigned to this Device, to be used in addition to SID, up to 128 characters long. * @param string $friendlyName Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * @param string $identity Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. * @param string $deploymentSid Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. * @param bool $enabled * @return CreateDeviceOptions Options builder */ public static function create( string $uniqueName = Values::NONE, string $friendlyName = Values::NONE, string $identity = Values::NONE, string $deploymentSid = Values::NONE, bool $enabled = Values::BOOL_NONE ): CreateDeviceOptions { return new CreateDeviceOptions( $uniqueName, $friendlyName, $identity, $deploymentSid, $enabled ); } /** * @param string $deploymentSid Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. * @return ReadDeviceOptions Options builder */ public static function read( string $deploymentSid = Values::NONE ): ReadDeviceOptions { return new ReadDeviceOptions( $deploymentSid ); } /** * @param string $friendlyName Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * @param string $identity Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. * @param string $deploymentSid Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. * @param bool $enabled * @return UpdateDeviceOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $identity = Values::NONE, string $deploymentSid = Values::NONE, bool $enabled = Values::BOOL_NONE ): UpdateDeviceOptions { return new UpdateDeviceOptions( $friendlyName, $identity, $deploymentSid, $enabled ); } } class CreateDeviceOptions extends Options { /** * @param string $uniqueName Provides a unique and addressable name to be assigned to this Device, to be used in addition to SID, up to 128 characters long. * @param string $friendlyName Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * @param string $identity Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. * @param string $deploymentSid Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. * @param bool $enabled */ public function __construct( string $uniqueName = Values::NONE, string $friendlyName = Values::NONE, string $identity = Values::NONE, string $deploymentSid = Values::NONE, bool $enabled = Values::BOOL_NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; $this->options['identity'] = $identity; $this->options['deploymentSid'] = $deploymentSid; $this->options['enabled'] = $enabled; } /** * Provides a unique and addressable name to be assigned to this Device, to be used in addition to SID, up to 128 characters long. * * @param string $uniqueName Provides a unique and addressable name to be assigned to this Device, to be used in addition to SID, up to 128 characters long. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. * * @param string $identity Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. * * @param string $deploymentSid Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. * @return $this Fluent Builder */ public function setDeploymentSid(string $deploymentSid): self { $this->options['deploymentSid'] = $deploymentSid; return $this; } /** * * * @param bool $enabled * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.CreateDeviceOptions ' . $options . ']'; } } class ReadDeviceOptions extends Options { /** * @param string $deploymentSid Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. */ public function __construct( string $deploymentSid = Values::NONE ) { $this->options['deploymentSid'] = $deploymentSid; } /** * Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. * * @param string $deploymentSid Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. * @return $this Fluent Builder */ public function setDeploymentSid(string $deploymentSid): self { $this->options['deploymentSid'] = $deploymentSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.ReadDeviceOptions ' . $options . ']'; } } class UpdateDeviceOptions extends Options { /** * @param string $friendlyName Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * @param string $identity Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. * @param string $deploymentSid Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. * @param bool $enabled */ public function __construct( string $friendlyName = Values::NONE, string $identity = Values::NONE, string $deploymentSid = Values::NONE, bool $enabled = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['identity'] = $identity; $this->options['deploymentSid'] = $deploymentSid; $this->options['enabled'] = $enabled; } /** * Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. * * @param string $identity Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. * * @param string $deploymentSid Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. * @return $this Fluent Builder */ public function setDeploymentSid(string $deploymentSid): self { $this->options['deploymentSid'] = $deploymentSid; return $this; } /** * * * @param bool $enabled * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.UpdateDeviceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceContext.php 0000644 00000006675 15021223077 0021322 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class DeviceContext extends InstanceContext { /** * Initialize the DeviceContext * * @param Version $version Version that contains the resource * @param string $fleetSid * @param string $sid Provides a 34 character string that uniquely identifies the requested Device resource. */ public function __construct( Version $version, $fleetSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'fleetSid' => $fleetSid, 'sid' => $sid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) .'/Devices/' . \rawurlencode($sid) .''; } /** * Delete the DeviceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the DeviceInstance * * @return DeviceInstance Fetched DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeviceInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new DeviceInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Update the DeviceInstance * * @param array|Options $options Optional Arguments * @return DeviceInstance Updated DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): DeviceInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'Identity' => $options['identity'], 'DeploymentSid' => $options['deploymentSid'], 'Enabled' => Serialize::booleanToString($options['enabled']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new DeviceInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.DeviceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificatePage.php 0000644 00000003166 15021223077 0021565 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CertificatePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CertificateInstance \Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateInstance */ public function buildInstance(array $payload): CertificateInstance { return new CertificateInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices.CertificatePage]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyInstance.php 0000644 00000011257 15021223077 0020763 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $url * @property string|null $friendlyName * @property string|null $fleetSid * @property string|null $accountSid * @property string|null $deviceSid * @property string|null $secret * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class KeyInstance extends InstanceResource { /** * Initialize the KeyInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $fleetSid * @param string $sid Provides a 34 character string that uniquely identifies the requested Key credential resource. */ public function __construct(Version $version, array $payload, string $fleetSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'deviceSid' => Values::array_get($payload, 'device_sid'), 'secret' => Values::array_get($payload, 'secret'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return KeyContext Context for this KeyInstance */ protected function proxy(): KeyContext { if (!$this->context) { $this->context = new KeyContext( $this->version, $this->solution['fleetSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the KeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the KeyInstance * * @return KeyInstance Fetched KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): KeyInstance { return $this->proxy()->fetch(); } /** * Update the KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Updated KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): KeyInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.KeyInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyPage.php 0000644 00000003106 15021223077 0020065 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class KeyPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return KeyInstance \Twilio\Rest\Preview\DeployedDevices\Fleet\KeyInstance */ public function buildInstance(array $payload): KeyInstance { return new KeyInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices.KeyPage]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyContext.php 0000644 00000006340 15021223077 0020640 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class KeyContext extends InstanceContext { /** * Initialize the KeyContext * * @param Version $version Version that contains the resource * @param string $fleetSid * @param string $sid Provides a 34 character string that uniquely identifies the requested Key credential resource. */ public function __construct( Version $version, $fleetSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'fleetSid' => $fleetSid, 'sid' => $sid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) .'/Keys/' . \rawurlencode($sid) .''; } /** * Delete the KeyInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the KeyInstance * * @return KeyInstance Fetched KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): KeyInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new KeyInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Update the KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Updated KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): KeyInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DeviceSid' => $options['deviceSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new KeyInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.KeyContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateList.php 0000644 00000015345 15021223077 0021626 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CertificateList extends ListResource { /** * Construct the CertificateList * * @param Version $version Version that contains the resource * @param string $fleetSid */ public function __construct( Version $version, string $fleetSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'fleetSid' => $fleetSid, ]; $this->uri = '/Fleets/' . \rawurlencode($fleetSid) .'/Certificates'; } /** * Create the CertificateInstance * * @param string $certificateData Provides a URL encoded representation of the public certificate in PEM format. * @param array|Options $options Optional Arguments * @return CertificateInstance Created CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $certificateData, array $options = []): CertificateInstance { $options = new Values($options); $data = Values::of([ 'CertificateData' => $certificateData, 'FriendlyName' => $options['friendlyName'], 'DeviceSid' => $options['deviceSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CertificateInstance( $this->version, $payload, $this->solution['fleetSid'] ); } /** * Reads CertificateInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CertificateInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CertificateInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CertificateInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CertificatePage Page of CertificateInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CertificatePage { $options = new Values($options); $params = Values::of([ 'DeviceSid' => $options['deviceSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CertificatePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CertificateInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CertificatePage Page of CertificateInstance */ public function getPage(string $targetUrl): CertificatePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CertificatePage($this->version, $response, $this->solution); } /** * Constructs a CertificateContext * * @param string $sid Provides a 34 character string that uniquely identifies the requested Certificate credential resource. */ public function getContext( string $sid ): CertificateContext { return new CertificateContext( $this->version, $this->solution['fleetSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.DeployedDevices.CertificateList]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyOptions.php 0000644 00000015446 15021223077 0020656 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Options; use Twilio\Values; abstract class KeyOptions { /** * @param string $friendlyName Provides a human readable descriptive text for this Key credential, up to 256 characters long. * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Key credential. * @return CreateKeyOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $deviceSid = Values::NONE ): CreateKeyOptions { return new CreateKeyOptions( $friendlyName, $deviceSid ); } /** * @param string $deviceSid Filters the resulting list of Keys by a unique string identifier of an authenticated Device. * @return ReadKeyOptions Options builder */ public static function read( string $deviceSid = Values::NONE ): ReadKeyOptions { return new ReadKeyOptions( $deviceSid ); } /** * @param string $friendlyName Provides a human readable descriptive text for this Key credential, up to 256 characters long. * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Key credential. * @return UpdateKeyOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $deviceSid = Values::NONE ): UpdateKeyOptions { return new UpdateKeyOptions( $friendlyName, $deviceSid ); } } class CreateKeyOptions extends Options { /** * @param string $friendlyName Provides a human readable descriptive text for this Key credential, up to 256 characters long. * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Key credential. */ public function __construct( string $friendlyName = Values::NONE, string $deviceSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['deviceSid'] = $deviceSid; } /** * Provides a human readable descriptive text for this Key credential, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text for this Key credential, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of an existing Device to become authenticated with this Key credential. * * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Key credential. * @return $this Fluent Builder */ public function setDeviceSid(string $deviceSid): self { $this->options['deviceSid'] = $deviceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.CreateKeyOptions ' . $options . ']'; } } class ReadKeyOptions extends Options { /** * @param string $deviceSid Filters the resulting list of Keys by a unique string identifier of an authenticated Device. */ public function __construct( string $deviceSid = Values::NONE ) { $this->options['deviceSid'] = $deviceSid; } /** * Filters the resulting list of Keys by a unique string identifier of an authenticated Device. * * @param string $deviceSid Filters the resulting list of Keys by a unique string identifier of an authenticated Device. * @return $this Fluent Builder */ public function setDeviceSid(string $deviceSid): self { $this->options['deviceSid'] = $deviceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.ReadKeyOptions ' . $options . ']'; } } class UpdateKeyOptions extends Options { /** * @param string $friendlyName Provides a human readable descriptive text for this Key credential, up to 256 characters long. * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Key credential. */ public function __construct( string $friendlyName = Values::NONE, string $deviceSid = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['deviceSid'] = $deviceSid; } /** * Provides a human readable descriptive text for this Key credential, up to 256 characters long. * * @param string $friendlyName Provides a human readable descriptive text for this Key credential, up to 256 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of an existing Device to become authenticated with this Key credential. * * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Key credential. * @return $this Fluent Builder */ public function setDeviceSid(string $deviceSid): self { $this->options['deviceSid'] = $deviceSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.DeployedDevices.UpdateKeyOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetInstance.php 0000644 00000013031 15021223077 0020223 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateList; use Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceList; use Twilio\Rest\Preview\DeployedDevices\Fleet\KeyList; use Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentList; /** * @property string|null $sid * @property string|null $url * @property string|null $uniqueName * @property string|null $friendlyName * @property string|null $accountSid * @property string|null $defaultDeploymentSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property array|null $links */ class FleetInstance extends InstanceResource { protected $_certificates; protected $_devices; protected $_keys; protected $_deployments; /** * Initialize the FleetInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid Provides a 34 character string that uniquely identifies the requested Fleet resource. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'defaultDeploymentSid' => Values::array_get($payload, 'default_deployment_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FleetContext Context for this FleetInstance */ protected function proxy(): FleetContext { if (!$this->context) { $this->context = new FleetContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the FleetInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the FleetInstance * * @return FleetInstance Fetched FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FleetInstance { return $this->proxy()->fetch(); } /** * Update the FleetInstance * * @param array|Options $options Optional Arguments * @return FleetInstance Updated FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FleetInstance { return $this->proxy()->update($options); } /** * Access the certificates */ protected function getCertificates(): CertificateList { return $this->proxy()->certificates; } /** * Access the devices */ protected function getDevices(): DeviceList { return $this->proxy()->devices; } /** * Access the keys */ protected function getKeys(): KeyList { return $this->proxy()->keys; } /** * Access the deployments */ protected function getDeployments(): DeploymentList { return $this->proxy()->deployments; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.FleetInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetContext.php 0000644 00000014415 15021223077 0020112 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\DeployedDevices; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateList; use Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceList; use Twilio\Rest\Preview\DeployedDevices\Fleet\KeyList; use Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentList; /** * @property CertificateList $certificates * @property DeviceList $devices * @property KeyList $keys * @property DeploymentList $deployments * @method \Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateContext certificates(string $sid) * @method \Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceContext devices(string $sid) * @method \Twilio\Rest\Preview\DeployedDevices\Fleet\KeyContext keys(string $sid) * @method \Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentContext deployments(string $sid) */ class FleetContext extends InstanceContext { protected $_certificates; protected $_devices; protected $_keys; protected $_deployments; /** * Initialize the FleetContext * * @param Version $version Version that contains the resource * @param string $sid Provides a 34 character string that uniquely identifies the requested Fleet resource. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Fleets/' . \rawurlencode($sid) .''; } /** * Delete the FleetInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the FleetInstance * * @return FleetInstance Fetched FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FleetInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new FleetInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the FleetInstance * * @param array|Options $options Optional Arguments * @return FleetInstance Updated FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FleetInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DefaultDeploymentSid' => $options['defaultDeploymentSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FleetInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the certificates */ protected function getCertificates(): CertificateList { if (!$this->_certificates) { $this->_certificates = new CertificateList( $this->version, $this->solution['sid'] ); } return $this->_certificates; } /** * Access the devices */ protected function getDevices(): DeviceList { if (!$this->_devices) { $this->_devices = new DeviceList( $this->version, $this->solution['sid'] ); } return $this->_devices; } /** * Access the keys */ protected function getKeys(): KeyList { if (!$this->_keys) { $this->_keys = new KeyList( $this->version, $this->solution['sid'] ); } return $this->_keys; } /** * Access the deployments */ protected function getDeployments(): DeploymentList { if (!$this->_deployments) { $this->_deployments = new DeploymentList( $this->version, $this->solution['sid'] ); } return $this->_deployments; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.FleetContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless.php 0000644 00000006461 15021223077 0014235 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\Wireless\CommandList; use Twilio\Rest\Preview\Wireless\RatePlanList; use Twilio\Rest\Preview\Wireless\SimList; use Twilio\Version; /** * @property CommandList $commands * @property RatePlanList $ratePlans * @property SimList $sims * @method \Twilio\Rest\Preview\Wireless\CommandContext commands(string $sid) * @method \Twilio\Rest\Preview\Wireless\RatePlanContext ratePlans(string $sid) * @method \Twilio\Rest\Preview\Wireless\SimContext sims(string $sid) */ class Wireless extends Version { protected $_commands; protected $_ratePlans; protected $_sims; /** * Construct the Wireless version of Preview * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'wireless'; } protected function getCommands(): CommandList { if (!$this->_commands) { $this->_commands = new CommandList($this); } return $this->_commands; } protected function getRatePlans(): RatePlanList { if (!$this->_ratePlans) { $this->_ratePlans = new RatePlanList($this); } return $this->_ratePlans; } protected function getSims(): SimList { if (!$this->_sims) { $this->_sims = new SimList($this); } return $this->_sims; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Wireless]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentList.php 0000644 00000017263 15021223077 0022417 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class AuthorizationDocumentList extends ListResource { /** * Construct the AuthorizationDocumentList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/AuthorizationDocuments'; } /** * Create the AuthorizationDocumentInstance * * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. * @param string $addressSid A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. * @param string $email Email that this AuthorizationDocument will be sent to for signing. * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. * @param array|Options $options Optional Arguments * @return AuthorizationDocumentInstance Created AuthorizationDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $hostedNumberOrderSids, string $addressSid, string $email, string $contactTitle, string $contactPhoneNumber, array $options = []): AuthorizationDocumentInstance { $options = new Values($options); $data = Values::of([ 'HostedNumberOrderSids' => Serialize::map($hostedNumberOrderSids,function ($e) { return $e; }), 'AddressSid' => $addressSid, 'Email' => $email, 'ContactTitle' => $contactTitle, 'ContactPhoneNumber' => $contactPhoneNumber, 'CcEmails' => Serialize::map($options['ccEmails'], function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AuthorizationDocumentInstance( $this->version, $payload ); } /** * Reads AuthorizationDocumentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthorizationDocumentInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams AuthorizationDocumentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AuthorizationDocumentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AuthorizationDocumentPage Page of AuthorizationDocumentInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AuthorizationDocumentPage { $options = new Values($options); $params = Values::of([ 'Email' => $options['email'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AuthorizationDocumentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthorizationDocumentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AuthorizationDocumentPage Page of AuthorizationDocumentInstance */ public function getPage(string $targetUrl): AuthorizationDocumentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthorizationDocumentPage($this->version, $response, $this->solution); } /** * Constructs a AuthorizationDocumentContext * * @param string $sid A 34 character string that uniquely identifies this AuthorizationDocument. */ public function getContext( string $sid ): AuthorizationDocumentContext { return new AuthorizationDocumentContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentList]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderList.php 0000644 00000020141 15021223077 0021440 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class HostedNumberOrderList extends ListResource { /** * Construct the HostedNumberOrderList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/HostedNumberOrders'; } /** * Create the HostedNumberOrderInstance * * @param string $phoneNumber The number to host in [+E.164](https://en.wikipedia.org/wiki/E.164) format * @param bool $smsCapability Used to specify that the SMS capability will be hosted on Twilio's platform. * @param array|Options $options Optional Arguments * @return HostedNumberOrderInstance Created HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumber, bool $smsCapability, array $options = []): HostedNumberOrderInstance { $options = new Values($options); $data = Values::of([ 'PhoneNumber' => $phoneNumber, 'SmsCapability' => Serialize::booleanToString($smsCapability), 'AccountSid' => $options['accountSid'], 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'CcEmails' => Serialize::map($options['ccEmails'], function ($e) { return $e; }), 'SmsUrl' => $options['smsUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'StatusCallbackUrl' => $options['statusCallbackUrl'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'AddressSid' => $options['addressSid'], 'Email' => $options['email'], 'VerificationType' => $options['verificationType'], 'VerificationDocumentSid' => $options['verificationDocumentSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new HostedNumberOrderInstance( $this->version, $payload ); } /** * Reads HostedNumberOrderInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return HostedNumberOrderInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams HostedNumberOrderInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of HostedNumberOrderInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return HostedNumberOrderPage Page of HostedNumberOrderInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): HostedNumberOrderPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'PhoneNumber' => $options['phoneNumber'], 'IncomingPhoneNumberSid' => $options['incomingPhoneNumberSid'], 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new HostedNumberOrderPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of HostedNumberOrderInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return HostedNumberOrderPage Page of HostedNumberOrderInstance */ public function getPage(string $targetUrl): HostedNumberOrderPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new HostedNumberOrderPage($this->version, $response, $this->solution); } /** * Constructs a HostedNumberOrderContext * * @param string $sid A 34 character string that uniquely identifies this HostedNumberOrder. */ public function getContext( string $sid ): HostedNumberOrderContext { return new HostedNumberOrderContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.HostedNumbers.HostedNumberOrderList]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentPage.php 0000644 00000003203 15021223077 0022345 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AuthorizationDocumentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AuthorizationDocumentInstance \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentInstance */ public function buildInstance(array $payload): AuthorizationDocumentInstance { return new AuthorizationDocumentInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentPage]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentOptions.php 0000644 00000027320 15021223077 0023132 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Options; use Twilio\Values; abstract class AuthorizationDocumentOptions { /** * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed. * @return CreateAuthorizationDocumentOptions Options builder */ public static function create( array $ccEmails = Values::ARRAY_NONE ): CreateAuthorizationDocumentOptions { return new CreateAuthorizationDocumentOptions( $ccEmails ); } /** * @param string $email Email that this AuthorizationDocument will be sent to for signing. * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. * @return ReadAuthorizationDocumentOptions Options builder */ public static function read( string $email = Values::NONE, string $status = Values::NONE ): ReadAuthorizationDocumentOptions { return new ReadAuthorizationDocumentOptions( $email, $status ); } /** * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. * @param string $addressSid A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. * @param string $email Email that this AuthorizationDocument will be sent to for signing. * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed * @param string $status * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. * @return UpdateAuthorizationDocumentOptions Options builder */ public static function update( array $hostedNumberOrderSids = Values::ARRAY_NONE, string $addressSid = Values::NONE, string $email = Values::NONE, array $ccEmails = Values::ARRAY_NONE, string $status = Values::NONE, string $contactTitle = Values::NONE, string $contactPhoneNumber = Values::NONE ): UpdateAuthorizationDocumentOptions { return new UpdateAuthorizationDocumentOptions( $hostedNumberOrderSids, $addressSid, $email, $ccEmails, $status, $contactTitle, $contactPhoneNumber ); } } class CreateAuthorizationDocumentOptions extends Options { /** * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed. */ public function __construct( array $ccEmails = Values::ARRAY_NONE ) { $this->options['ccEmails'] = $ccEmails; } /** * Email recipients who will be informed when an Authorization Document has been sent and signed. * * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed. * @return $this Fluent Builder */ public function setCcEmails(array $ccEmails): self { $this->options['ccEmails'] = $ccEmails; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.HostedNumbers.CreateAuthorizationDocumentOptions ' . $options . ']'; } } class ReadAuthorizationDocumentOptions extends Options { /** * @param string $email Email that this AuthorizationDocument will be sent to for signing. * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. */ public function __construct( string $email = Values::NONE, string $status = Values::NONE ) { $this->options['email'] = $email; $this->options['status'] = $status; } /** * Email that this AuthorizationDocument will be sent to for signing. * * @param string $email Email that this AuthorizationDocument will be sent to for signing. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. * * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.HostedNumbers.ReadAuthorizationDocumentOptions ' . $options . ']'; } } class UpdateAuthorizationDocumentOptions extends Options { /** * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. * @param string $addressSid A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. * @param string $email Email that this AuthorizationDocument will be sent to for signing. * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed * @param string $status * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. */ public function __construct( array $hostedNumberOrderSids = Values::ARRAY_NONE, string $addressSid = Values::NONE, string $email = Values::NONE, array $ccEmails = Values::ARRAY_NONE, string $status = Values::NONE, string $contactTitle = Values::NONE, string $contactPhoneNumber = Values::NONE ) { $this->options['hostedNumberOrderSids'] = $hostedNumberOrderSids; $this->options['addressSid'] = $addressSid; $this->options['email'] = $email; $this->options['ccEmails'] = $ccEmails; $this->options['status'] = $status; $this->options['contactTitle'] = $contactTitle; $this->options['contactPhoneNumber'] = $contactPhoneNumber; } /** * A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. * * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. * @return $this Fluent Builder */ public function setHostedNumberOrderSids(array $hostedNumberOrderSids): self { $this->options['hostedNumberOrderSids'] = $hostedNumberOrderSids; return $this; } /** * A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. * * @param string $addressSid A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * Email that this AuthorizationDocument will be sent to for signing. * * @param string $email Email that this AuthorizationDocument will be sent to for signing. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * Email recipients who will be informed when an Authorization Document has been sent and signed * * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed * @return $this Fluent Builder */ public function setCcEmails(array $ccEmails): self { $this->options['ccEmails'] = $ccEmails; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The title of the person authorized to sign the Authorization Document for this phone number. * * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. * @return $this Fluent Builder */ public function setContactTitle(string $contactTitle): self { $this->options['contactTitle'] = $contactTitle; return $this; } /** * The contact phone number of the person authorized to sign the Authorization Document. * * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. * @return $this Fluent Builder */ public function setContactPhoneNumber(string $contactPhoneNumber): self { $this->options['contactPhoneNumber'] = $contactPhoneNumber; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.HostedNumbers.UpdateAuthorizationDocumentOptions ' . $options . ']'; } } src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderInstance.php 0000644 00000011545 15021223077 0030410 0 ustar 00 sdk <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Base\PhoneNumberCapabilities; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $incomingPhoneNumberSid * @property string|null $addressSid * @property string|null $signingDocumentSid * @property string|null $phoneNumber * @property PhoneNumberCapabilities|null $capabilities * @property string|null $friendlyName * @property string|null $uniqueName * @property string $status * @property string|null $failureReason * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property int|null $verificationAttempts * @property string|null $email * @property string[]|null $ccEmails * @property string $verificationType * @property string|null $verificationDocumentSid * @property string|null $extension * @property int|null $callDelay * @property string|null $verificationCode * @property string[]|null $verificationCallSids */ class DependentHostedNumberOrderInstance extends InstanceResource { /** * Initialize the DependentHostedNumberOrderInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $signingDocumentSid A 34 character string that uniquely identifies the LOA document associated with this HostedNumberOrder. */ public function __construct(Version $version, array $payload, string $signingDocumentSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'incomingPhoneNumberSid' => Values::array_get($payload, 'incoming_phone_number_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'signingDocumentSid' => Values::array_get($payload, 'signing_document_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'status' => Values::array_get($payload, 'status'), 'failureReason' => Values::array_get($payload, 'failure_reason'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'verificationAttempts' => Values::array_get($payload, 'verification_attempts'), 'email' => Values::array_get($payload, 'email'), 'ccEmails' => Values::array_get($payload, 'cc_emails'), 'verificationType' => Values::array_get($payload, 'verification_type'), 'verificationDocumentSid' => Values::array_get($payload, 'verification_document_sid'), 'extension' => Values::array_get($payload, 'extension'), 'callDelay' => Values::array_get($payload, 'call_delay'), 'verificationCode' => Values::array_get($payload, 'verification_code'), 'verificationCallSids' => Values::array_get($payload, 'verification_call_sids'), ]; $this->solution = ['signingDocumentSid' => $signingDocumentSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.HostedNumbers.DependentHostedNumberOrderInstance]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderPage.php 0000644 00000003364 15021223077 0027577 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DependentHostedNumberOrderPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DependentHostedNumberOrderInstance \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument\DependentHostedNumberOrderInstance */ public function buildInstance(array $payload): DependentHostedNumberOrderInstance { return new DependentHostedNumberOrderInstance($this->version, $payload, $this->solution['signingDocumentSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.HostedNumbers.DependentHostedNumberOrderPage]'; } } src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderOptions.php 0000644 00000015304 15021223077 0030274 0 ustar 00 sdk <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument; use Twilio\Options; use Twilio\Values; abstract class DependentHostedNumberOrderOptions { /** * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * @return ReadDependentHostedNumberOrderOptions Options builder */ public static function read( string $status = Values::NONE, string $phoneNumber = Values::NONE, string $incomingPhoneNumberSid = Values::NONE, string $friendlyName = Values::NONE, string $uniqueName = Values::NONE ): ReadDependentHostedNumberOrderOptions { return new ReadDependentHostedNumberOrderOptions( $status, $phoneNumber, $incomingPhoneNumberSid, $friendlyName, $uniqueName ); } } class ReadDependentHostedNumberOrderOptions extends Options { /** * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. */ public function __construct( string $status = Values::NONE, string $phoneNumber = Values::NONE, string $incomingPhoneNumberSid = Values::NONE, string $friendlyName = Values::NONE, string $uniqueName = Values::NONE ) { $this->options['status'] = $status; $this->options['phoneNumber'] = $phoneNumber; $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; } /** * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. * * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource#status-values) for more information on each of these statuses. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * An E164 formatted phone number hosted by this HostedNumberOrder. * * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * @return $this Fluent Builder */ public function setIncomingPhoneNumberSid(string $incomingPhoneNumberSid): self { $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; return $this; } /** * A human readable description of this resource, up to 64 characters. * * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.HostedNumbers.ReadDependentHostedNumberOrderOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderList.php 0000644 00000014046 15021223077 0027635 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DependentHostedNumberOrderList extends ListResource { /** * Construct the DependentHostedNumberOrderList * * @param Version $version Version that contains the resource * @param string $signingDocumentSid A 34 character string that uniquely identifies the LOA document associated with this HostedNumberOrder. */ public function __construct( Version $version, string $signingDocumentSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'signingDocumentSid' => $signingDocumentSid, ]; $this->uri = '/AuthorizationDocuments/' . \rawurlencode($signingDocumentSid) .'/DependentHostedNumberOrders'; } /** * Reads DependentHostedNumberOrderInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DependentHostedNumberOrderInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams DependentHostedNumberOrderInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DependentHostedNumberOrderInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DependentHostedNumberOrderPage Page of DependentHostedNumberOrderInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DependentHostedNumberOrderPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'PhoneNumber' => $options['phoneNumber'], 'IncomingPhoneNumberSid' => $options['incomingPhoneNumberSid'], 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DependentHostedNumberOrderPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DependentHostedNumberOrderInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DependentHostedNumberOrderPage Page of DependentHostedNumberOrderInstance */ public function getPage(string $targetUrl): DependentHostedNumberOrderPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DependentHostedNumberOrderPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.HostedNumbers.DependentHostedNumberOrderList]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderInstance.php 0000644 00000015004 15021223077 0022273 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Base\PhoneNumberCapabilities; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $incomingPhoneNumberSid * @property string|null $addressSid * @property string|null $signingDocumentSid * @property string|null $phoneNumber * @property PhoneNumberCapabilities|null $capabilities * @property string|null $friendlyName * @property string|null $uniqueName * @property string $status * @property string|null $failureReason * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property int|null $verificationAttempts * @property string|null $email * @property string[]|null $ccEmails * @property string|null $url * @property string $verificationType * @property string|null $verificationDocumentSid * @property string|null $extension * @property int|null $callDelay * @property string|null $verificationCode * @property string[]|null $verificationCallSids */ class HostedNumberOrderInstance extends InstanceResource { /** * Initialize the HostedNumberOrderInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies this HostedNumberOrder. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'incomingPhoneNumberSid' => Values::array_get($payload, 'incoming_phone_number_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'signingDocumentSid' => Values::array_get($payload, 'signing_document_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'status' => Values::array_get($payload, 'status'), 'failureReason' => Values::array_get($payload, 'failure_reason'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'verificationAttempts' => Values::array_get($payload, 'verification_attempts'), 'email' => Values::array_get($payload, 'email'), 'ccEmails' => Values::array_get($payload, 'cc_emails'), 'url' => Values::array_get($payload, 'url'), 'verificationType' => Values::array_get($payload, 'verification_type'), 'verificationDocumentSid' => Values::array_get($payload, 'verification_document_sid'), 'extension' => Values::array_get($payload, 'extension'), 'callDelay' => Values::array_get($payload, 'call_delay'), 'verificationCode' => Values::array_get($payload, 'verification_code'), 'verificationCallSids' => Values::array_get($payload, 'verification_call_sids'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return HostedNumberOrderContext Context for this HostedNumberOrderInstance */ protected function proxy(): HostedNumberOrderContext { if (!$this->context) { $this->context = new HostedNumberOrderContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the HostedNumberOrderInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the HostedNumberOrderInstance * * @return HostedNumberOrderInstance Fetched HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): HostedNumberOrderInstance { return $this->proxy()->fetch(); } /** * Update the HostedNumberOrderInstance * * @param array|Options $options Optional Arguments * @return HostedNumberOrderInstance Updated HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): HostedNumberOrderInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.HostedNumbers.HostedNumberOrderInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderPage.php 0000644 00000003153 15021223077 0021405 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class HostedNumberOrderPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return HostedNumberOrderInstance \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderInstance */ public function buildInstance(array $payload): HostedNumberOrderInstance { return new HostedNumberOrderInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.HostedNumbers.HostedNumberOrderPage]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentInstance.php 0000644 00000011543 15021223077 0023243 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument\DependentHostedNumberOrderList; /** * @property string|null $sid * @property string|null $addressSid * @property string $status * @property string|null $email * @property string[]|null $ccEmails * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class AuthorizationDocumentInstance extends InstanceResource { protected $_dependentHostedNumberOrders; /** * Initialize the AuthorizationDocumentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies this AuthorizationDocument. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'status' => Values::array_get($payload, 'status'), 'email' => Values::array_get($payload, 'email'), 'ccEmails' => Values::array_get($payload, 'cc_emails'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AuthorizationDocumentContext Context for this AuthorizationDocumentInstance */ protected function proxy(): AuthorizationDocumentContext { if (!$this->context) { $this->context = new AuthorizationDocumentContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the AuthorizationDocumentInstance * * @return AuthorizationDocumentInstance Fetched AuthorizationDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthorizationDocumentInstance { return $this->proxy()->fetch(); } /** * Update the AuthorizationDocumentInstance * * @param array|Options $options Optional Arguments * @return AuthorizationDocumentInstance Updated AuthorizationDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AuthorizationDocumentInstance { return $this->proxy()->update($options); } /** * Access the dependentHostedNumberOrders */ protected function getDependentHostedNumberOrders(): DependentHostedNumberOrderList { return $this->proxy()->dependentHostedNumberOrders; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderContext.php 0000644 00000007455 15021223077 0022166 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class HostedNumberOrderContext extends InstanceContext { /** * Initialize the HostedNumberOrderContext * * @param Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies this HostedNumberOrder. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/HostedNumberOrders/' . \rawurlencode($sid) .''; } /** * Delete the HostedNumberOrderInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the HostedNumberOrderInstance * * @return HostedNumberOrderInstance Fetched HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): HostedNumberOrderInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new HostedNumberOrderInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the HostedNumberOrderInstance * * @param array|Options $options Optional Arguments * @return HostedNumberOrderInstance Updated HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): HostedNumberOrderInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Email' => $options['email'], 'CcEmails' => Serialize::map($options['ccEmails'], function ($e) { return $e; }), 'Status' => $options['status'], 'VerificationCode' => $options['verificationCode'], 'VerificationType' => $options['verificationType'], 'VerificationDocumentSid' => $options['verificationDocumentSid'], 'Extension' => $options['extension'], 'CallDelay' => $options['callDelay'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new HostedNumberOrderInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.HostedNumbers.HostedNumberOrderContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderOptions.php 0000644 00000074655 15021223077 0022203 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Options; use Twilio\Values; abstract class HostedNumberOrderOptions { /** * @param string $accountSid This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. * @param string $friendlyName A 64 character string that is a human readable text that describes this resource. * @param string $uniqueName Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * @param string[] $ccEmails Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. * @param string $smsUrl The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. * @param string $smsMethod The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * @param string $smsFallbackUrl A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. * @param string $smsFallbackMethod The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * @param string $statusCallbackUrl Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. * @param string $statusCallbackMethod Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. * @param string $smsApplicationSid Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. * @param string $addressSid Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. * @param string $email Optional. Email of the owner of this phone number that is being hosted. * @param string $verificationType * @param string $verificationDocumentSid Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. * @return CreateHostedNumberOrderOptions Options builder */ public static function create( string $accountSid = Values::NONE, string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, array $ccEmails = Values::ARRAY_NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $statusCallbackUrl = Values::NONE, string $statusCallbackMethod = Values::NONE, string $smsApplicationSid = Values::NONE, string $addressSid = Values::NONE, string $email = Values::NONE, string $verificationType = Values::NONE, string $verificationDocumentSid = Values::NONE ): CreateHostedNumberOrderOptions { return new CreateHostedNumberOrderOptions( $accountSid, $friendlyName, $uniqueName, $ccEmails, $smsUrl, $smsMethod, $smsFallbackUrl, $smsFallbackMethod, $statusCallbackUrl, $statusCallbackMethod, $smsApplicationSid, $addressSid, $email, $verificationType, $verificationDocumentSid ); } /** * @param string $status The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * @return ReadHostedNumberOrderOptions Options builder */ public static function read( string $status = Values::NONE, string $phoneNumber = Values::NONE, string $incomingPhoneNumberSid = Values::NONE, string $friendlyName = Values::NONE, string $uniqueName = Values::NONE ): ReadHostedNumberOrderOptions { return new ReadHostedNumberOrderOptions( $status, $phoneNumber, $incomingPhoneNumberSid, $friendlyName, $uniqueName ); } /** * @param string $friendlyName A 64 character string that is a human readable text that describes this resource. * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * @param string $email Email of the owner of this phone number that is being hosted. * @param string[] $ccEmails Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. * @param string $status * @param string $verificationCode A verification code that is given to the user via a phone call to the phone number that is being hosted. * @param string $verificationType * @param string $verificationDocumentSid Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. * @param string $extension Digits to dial after connecting the verification call. * @param int $callDelay The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0. * @return UpdateHostedNumberOrderOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $email = Values::NONE, array $ccEmails = Values::ARRAY_NONE, string $status = Values::NONE, string $verificationCode = Values::NONE, string $verificationType = Values::NONE, string $verificationDocumentSid = Values::NONE, string $extension = Values::NONE, int $callDelay = Values::INT_NONE ): UpdateHostedNumberOrderOptions { return new UpdateHostedNumberOrderOptions( $friendlyName, $uniqueName, $email, $ccEmails, $status, $verificationCode, $verificationType, $verificationDocumentSid, $extension, $callDelay ); } } class CreateHostedNumberOrderOptions extends Options { /** * @param string $accountSid This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. * @param string $friendlyName A 64 character string that is a human readable text that describes this resource. * @param string $uniqueName Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * @param string[] $ccEmails Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. * @param string $smsUrl The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. * @param string $smsMethod The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * @param string $smsFallbackUrl A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. * @param string $smsFallbackMethod The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * @param string $statusCallbackUrl Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. * @param string $statusCallbackMethod Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. * @param string $smsApplicationSid Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. * @param string $addressSid Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. * @param string $email Optional. Email of the owner of this phone number that is being hosted. * @param string $verificationType * @param string $verificationDocumentSid Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. */ public function __construct( string $accountSid = Values::NONE, string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, array $ccEmails = Values::ARRAY_NONE, string $smsUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $statusCallbackUrl = Values::NONE, string $statusCallbackMethod = Values::NONE, string $smsApplicationSid = Values::NONE, string $addressSid = Values::NONE, string $email = Values::NONE, string $verificationType = Values::NONE, string $verificationDocumentSid = Values::NONE ) { $this->options['accountSid'] = $accountSid; $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['ccEmails'] = $ccEmails; $this->options['smsUrl'] = $smsUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['statusCallbackUrl'] = $statusCallbackUrl; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['addressSid'] = $addressSid; $this->options['email'] = $email; $this->options['verificationType'] = $verificationType; $this->options['verificationDocumentSid'] = $verificationDocumentSid; } /** * This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. * * @param string $accountSid This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. * @return $this Fluent Builder */ public function setAccountSid(string $accountSid): self { $this->options['accountSid'] = $accountSid; return $this; } /** * A 64 character string that is a human readable text that describes this resource. * * @param string $friendlyName A 64 character string that is a human readable text that describes this resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. * * @param string[] $ccEmails Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. * @return $this Fluent Builder */ public function setCcEmails(array $ccEmails): self { $this->options['ccEmails'] = $ccEmails; return $this; } /** * The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsUrl The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsMethod The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsFallbackUrl A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsFallbackMethod The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. * * @param string $statusCallbackUrl Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setStatusCallbackUrl(string $statusCallbackUrl): self { $this->options['statusCallbackUrl'] = $statusCallbackUrl; return $this; } /** * Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. * * @param string $statusCallbackMethod Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. * @return $this Fluent Builder */ public function setStatusCallbackMethod(string $statusCallbackMethod): self { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. * * @param string $smsApplicationSid Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. * @return $this Fluent Builder */ public function setSmsApplicationSid(string $smsApplicationSid): self { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. * * @param string $addressSid Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. * @return $this Fluent Builder */ public function setAddressSid(string $addressSid): self { $this->options['addressSid'] = $addressSid; return $this; } /** * Optional. Email of the owner of this phone number that is being hosted. * * @param string $email Optional. Email of the owner of this phone number that is being hosted. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * @param string $verificationType * @return $this Fluent Builder */ public function setVerificationType(string $verificationType): self { $this->options['verificationType'] = $verificationType; return $this; } /** * Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. * * @param string $verificationDocumentSid Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. * @return $this Fluent Builder */ public function setVerificationDocumentSid(string $verificationDocumentSid): self { $this->options['verificationDocumentSid'] = $verificationDocumentSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.HostedNumbers.CreateHostedNumberOrderOptions ' . $options . ']'; } } class ReadHostedNumberOrderOptions extends Options { /** * @param string $status The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. */ public function __construct( string $status = Values::NONE, string $phoneNumber = Values::NONE, string $incomingPhoneNumberSid = Values::NONE, string $friendlyName = Values::NONE, string $uniqueName = Values::NONE ) { $this->options['status'] = $status; $this->options['phoneNumber'] = $phoneNumber; $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; } /** * The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. * * @param string $status The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * An E164 formatted phone number hosted by this HostedNumberOrder. * * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. * @return $this Fluent Builder */ public function setPhoneNumber(string $phoneNumber): self { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * @return $this Fluent Builder */ public function setIncomingPhoneNumberSid(string $incomingPhoneNumberSid): self { $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; return $this; } /** * A human readable description of this resource, up to 64 characters. * * @param string $friendlyName A human readable description of this resource, up to 64 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.HostedNumbers.ReadHostedNumberOrderOptions ' . $options . ']'; } } class UpdateHostedNumberOrderOptions extends Options { /** * @param string $friendlyName A 64 character string that is a human readable text that describes this resource. * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * @param string $email Email of the owner of this phone number that is being hosted. * @param string[] $ccEmails Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. * @param string $status * @param string $verificationCode A verification code that is given to the user via a phone call to the phone number that is being hosted. * @param string $verificationType * @param string $verificationDocumentSid Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. * @param string $extension Digits to dial after connecting the verification call. * @param int $callDelay The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0. */ public function __construct( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $email = Values::NONE, array $ccEmails = Values::ARRAY_NONE, string $status = Values::NONE, string $verificationCode = Values::NONE, string $verificationType = Values::NONE, string $verificationDocumentSid = Values::NONE, string $extension = Values::NONE, int $callDelay = Values::INT_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['email'] = $email; $this->options['ccEmails'] = $ccEmails; $this->options['status'] = $status; $this->options['verificationCode'] = $verificationCode; $this->options['verificationType'] = $verificationType; $this->options['verificationDocumentSid'] = $verificationDocumentSid; $this->options['extension'] = $extension; $this->options['callDelay'] = $callDelay; } /** * A 64 character string that is a human readable text that describes this resource. * * @param string $friendlyName A 64 character string that is a human readable text that describes this resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Email of the owner of this phone number that is being hosted. * * @param string $email Email of the owner of this phone number that is being hosted. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. * * @param string[] $ccEmails Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. * @return $this Fluent Builder */ public function setCcEmails(array $ccEmails): self { $this->options['ccEmails'] = $ccEmails; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * A verification code that is given to the user via a phone call to the phone number that is being hosted. * * @param string $verificationCode A verification code that is given to the user via a phone call to the phone number that is being hosted. * @return $this Fluent Builder */ public function setVerificationCode(string $verificationCode): self { $this->options['verificationCode'] = $verificationCode; return $this; } /** * @param string $verificationType * @return $this Fluent Builder */ public function setVerificationType(string $verificationType): self { $this->options['verificationType'] = $verificationType; return $this; } /** * Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. * * @param string $verificationDocumentSid Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. * @return $this Fluent Builder */ public function setVerificationDocumentSid(string $verificationDocumentSid): self { $this->options['verificationDocumentSid'] = $verificationDocumentSid; return $this; } /** * Digits to dial after connecting the verification call. * * @param string $extension Digits to dial after connecting the verification call. * @return $this Fluent Builder */ public function setExtension(string $extension): self { $this->options['extension'] = $extension; return $this; } /** * The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0. * * @param int $callDelay The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0. * @return $this Fluent Builder */ public function setCallDelay(int $callDelay): self { $this->options['callDelay'] = $callDelay; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Preview.HostedNumbers.UpdateHostedNumberOrderOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php 0000644 00000012275 15021223077 0023126 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument\DependentHostedNumberOrderList; /** * @property DependentHostedNumberOrderList $dependentHostedNumberOrders */ class AuthorizationDocumentContext extends InstanceContext { protected $_dependentHostedNumberOrders; /** * Initialize the AuthorizationDocumentContext * * @param Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies this AuthorizationDocument. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/AuthorizationDocuments/' . \rawurlencode($sid) .''; } /** * Fetch the AuthorizationDocumentInstance * * @return AuthorizationDocumentInstance Fetched AuthorizationDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AuthorizationDocumentInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AuthorizationDocumentInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the AuthorizationDocumentInstance * * @param array|Options $options Optional Arguments * @return AuthorizationDocumentInstance Updated AuthorizationDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AuthorizationDocumentInstance { $options = new Values($options); $data = Values::of([ 'HostedNumberOrderSids' => Serialize::map($options['hostedNumberOrderSids'], function ($e) { return $e; }), 'AddressSid' => $options['addressSid'], 'Email' => $options['email'], 'CcEmails' => Serialize::map($options['ccEmails'], function ($e) { return $e; }), 'Status' => $options['status'], 'ContactTitle' => $options['contactTitle'], 'ContactPhoneNumber' => $options['contactPhoneNumber'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AuthorizationDocumentInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the dependentHostedNumberOrders */ protected function getDependentHostedNumberOrders(): DependentHostedNumberOrderList { if (!$this->_dependentHostedNumberOrders) { $this->_dependentHostedNumberOrders = new DependentHostedNumberOrderList( $this->version, $this->solution['sid'] ); } return $this->_dependentHostedNumberOrders; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace.php 0000644 00000006232 15021223077 0014664 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Preview * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\Marketplace\AvailableAddOnList; use Twilio\Rest\Preview\Marketplace\InstalledAddOnList; use Twilio\Version; /** * @property AvailableAddOnList $availableAddOns * @property InstalledAddOnList $installedAddOns * @method \Twilio\Rest\Preview\Marketplace\AvailableAddOnContext availableAddOns(string $sid) * @method \Twilio\Rest\Preview\Marketplace\InstalledAddOnContext installedAddOns(string $sid) */ class Marketplace extends Version { protected $_availableAddOns; protected $_installedAddOns; /** * Construct the Marketplace version of Preview * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'marketplace'; } protected function getAvailableAddOns(): AvailableAddOnList { if (!$this->_availableAddOns) { $this->_availableAddOns = new AvailableAddOnList($this); } return $this->_availableAddOns; } protected function getInstalledAddOns(): InstalledAddOnList { if (!$this->_installedAddOns) { $this->_installedAddOns = new InstalledAddOnList($this); } return $this->_installedAddOns; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Preview.Marketplace]'; } } sdk/src/Twilio/Rest/Wireless/V1/CommandPage.php 0000644 00000003022 15021223077 0015243 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CommandPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CommandInstance \Twilio\Rest\Wireless\V1\CommandInstance */ public function buildInstance(array $payload): CommandInstance { return new CommandInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.CommandPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/RatePlanList.php 0000644 00000015346 15021223077 0015446 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class RatePlanList extends ListResource { /** * Construct the RatePlanList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/RatePlans'; } /** * Create the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Created RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): RatePlanInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'FriendlyName' => $options['friendlyName'], 'DataEnabled' => Serialize::booleanToString($options['dataEnabled']), 'DataLimit' => $options['dataLimit'], 'DataMetering' => $options['dataMetering'], 'MessagingEnabled' => Serialize::booleanToString($options['messagingEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'NationalRoamingEnabled' => Serialize::booleanToString($options['nationalRoamingEnabled']), 'InternationalRoaming' => Serialize::map($options['internationalRoaming'], function ($e) { return $e; }), 'NationalRoamingDataLimit' => $options['nationalRoamingDataLimit'], 'InternationalRoamingDataLimit' => $options['internationalRoamingDataLimit'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RatePlanInstance( $this->version, $payload ); } /** * Reads RatePlanInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RatePlanInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RatePlanInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RatePlanInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RatePlanPage Page of RatePlanInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RatePlanPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RatePlanPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RatePlanInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RatePlanPage Page of RatePlanInstance */ public function getPage(string $targetUrl): RatePlanPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RatePlanPage($this->version, $response, $this->solution); } /** * Constructs a RatePlanContext * * @param string $sid The SID of the RatePlan resource to delete. */ public function getContext( string $sid ): RatePlanContext { return new RatePlanContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.RatePlanList]'; } } sdk/src/Twilio/Rest/Wireless/V1/RatePlanOptions.php 0000644 00000041777 15021223077 0016175 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Options; use Twilio\Values; abstract class RatePlanOptions { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @param string $friendlyName A descriptive string that you create to describe the resource. It does not have to be unique. * @param bool $dataEnabled Whether SIMs can use GPRS/3G/4G/LTE data connectivity. * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB and the default value is `1000`. * @param string $dataMetering The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#payg-vs-quota-data-plans). * @param bool $messagingEnabled Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/iot/wireless/api/command-resource). * @param bool $voiceEnabled Deprecated. * @param bool $nationalRoamingEnabled Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming). * @param string[] $internationalRoaming The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`. * @param int $nationalRoamingDataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming) for more info. * @param int $internationalRoamingDataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB. * @return CreateRatePlanOptions Options builder */ public static function create( string $uniqueName = Values::NONE, string $friendlyName = Values::NONE, bool $dataEnabled = Values::BOOL_NONE, int $dataLimit = Values::INT_NONE, string $dataMetering = Values::NONE, bool $messagingEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $nationalRoamingEnabled = Values::BOOL_NONE, array $internationalRoaming = Values::ARRAY_NONE, int $nationalRoamingDataLimit = Values::INT_NONE, int $internationalRoamingDataLimit = Values::INT_NONE ): CreateRatePlanOptions { return new CreateRatePlanOptions( $uniqueName, $friendlyName, $dataEnabled, $dataLimit, $dataMetering, $messagingEnabled, $voiceEnabled, $nationalRoamingEnabled, $internationalRoaming, $nationalRoamingDataLimit, $internationalRoamingDataLimit ); } /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @param string $friendlyName A descriptive string that you create to describe the resource. It does not have to be unique. * @return UpdateRatePlanOptions Options builder */ public static function update( string $uniqueName = Values::NONE, string $friendlyName = Values::NONE ): UpdateRatePlanOptions { return new UpdateRatePlanOptions( $uniqueName, $friendlyName ); } } class CreateRatePlanOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @param string $friendlyName A descriptive string that you create to describe the resource. It does not have to be unique. * @param bool $dataEnabled Whether SIMs can use GPRS/3G/4G/LTE data connectivity. * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB and the default value is `1000`. * @param string $dataMetering The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#payg-vs-quota-data-plans). * @param bool $messagingEnabled Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/iot/wireless/api/command-resource). * @param bool $voiceEnabled Deprecated. * @param bool $nationalRoamingEnabled Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming). * @param string[] $internationalRoaming The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`. * @param int $nationalRoamingDataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming) for more info. * @param int $internationalRoamingDataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB. */ public function __construct( string $uniqueName = Values::NONE, string $friendlyName = Values::NONE, bool $dataEnabled = Values::BOOL_NONE, int $dataLimit = Values::INT_NONE, string $dataMetering = Values::NONE, bool $messagingEnabled = Values::BOOL_NONE, bool $voiceEnabled = Values::BOOL_NONE, bool $nationalRoamingEnabled = Values::BOOL_NONE, array $internationalRoaming = Values::ARRAY_NONE, int $nationalRoamingDataLimit = Values::INT_NONE, int $internationalRoamingDataLimit = Values::INT_NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; $this->options['dataEnabled'] = $dataEnabled; $this->options['dataLimit'] = $dataLimit; $this->options['dataMetering'] = $dataMetering; $this->options['messagingEnabled'] = $messagingEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; $this->options['internationalRoaming'] = $internationalRoaming; $this->options['nationalRoamingDataLimit'] = $nationalRoamingDataLimit; $this->options['internationalRoamingDataLimit'] = $internationalRoamingDataLimit; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A descriptive string that you create to describe the resource. It does not have to be unique. * * @param string $friendlyName A descriptive string that you create to describe the resource. It does not have to be unique. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether SIMs can use GPRS/3G/4G/LTE data connectivity. * * @param bool $dataEnabled Whether SIMs can use GPRS/3G/4G/LTE data connectivity. * @return $this Fluent Builder */ public function setDataEnabled(bool $dataEnabled): self { $this->options['dataEnabled'] = $dataEnabled; return $this; } /** * The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB and the default value is `1000`. * * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB and the default value is `1000`. * @return $this Fluent Builder */ public function setDataLimit(int $dataLimit): self { $this->options['dataLimit'] = $dataLimit; return $this; } /** * The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#payg-vs-quota-data-plans). * * @param string $dataMetering The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#payg-vs-quota-data-plans). * @return $this Fluent Builder */ public function setDataMetering(string $dataMetering): self { $this->options['dataMetering'] = $dataMetering; return $this; } /** * Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/iot/wireless/api/command-resource). * * @param bool $messagingEnabled Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/iot/wireless/api/command-resource). * @return $this Fluent Builder */ public function setMessagingEnabled(bool $messagingEnabled): self { $this->options['messagingEnabled'] = $messagingEnabled; return $this; } /** * Deprecated. * * @param bool $voiceEnabled Deprecated. * @return $this Fluent Builder */ public function setVoiceEnabled(bool $voiceEnabled): self { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming). * * @param bool $nationalRoamingEnabled Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming). * @return $this Fluent Builder */ public function setNationalRoamingEnabled(bool $nationalRoamingEnabled): self { $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; return $this; } /** * The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`. * * @param string[] $internationalRoaming The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`. * @return $this Fluent Builder */ public function setInternationalRoaming(array $internationalRoaming): self { $this->options['internationalRoaming'] = $internationalRoaming; return $this; } /** * The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming) for more info. * * @param int $nationalRoamingDataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming) for more info. * @return $this Fluent Builder */ public function setNationalRoamingDataLimit(int $nationalRoamingDataLimit): self { $this->options['nationalRoamingDataLimit'] = $nationalRoamingDataLimit; return $this; } /** * The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB. * * @param int $internationalRoamingDataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB. * @return $this Fluent Builder */ public function setInternationalRoamingDataLimit(int $internationalRoamingDataLimit): self { $this->options['internationalRoamingDataLimit'] = $internationalRoamingDataLimit; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.CreateRatePlanOptions ' . $options . ']'; } } class UpdateRatePlanOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @param string $friendlyName A descriptive string that you create to describe the resource. It does not have to be unique. */ public function __construct( string $uniqueName = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A descriptive string that you create to describe the resource. It does not have to be unique. * * @param string $friendlyName A descriptive string that you create to describe the resource. It does not have to be unique. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.UpdateRatePlanOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/RatePlanPage.php 0000644 00000003030 15021223077 0015372 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RatePlanPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RatePlanInstance \Twilio\Rest\Wireless\V1\RatePlanInstance */ public function buildInstance(array $payload): RatePlanInstance { return new RatePlanInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.RatePlanPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/SimContext.php 0000644 00000014210 15021223077 0015166 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Wireless\V1\Sim\DataSessionList; use Twilio\Rest\Wireless\V1\Sim\UsageRecordList; /** * @property DataSessionList $dataSessions * @property UsageRecordList $usageRecords */ class SimContext extends InstanceContext { protected $_dataSessions; protected $_usageRecords; /** * Initialize the SimContext * * @param Version $version Version that contains the resource * @param string $sid The SID or the `unique_name` of the Sim resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Sims/' . \rawurlencode($sid) .''; } /** * Delete the SimInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SimInstance * * @return SimInstance Fetched SimInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SimInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SimInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the SimInstance * * @param array|Options $options Optional Arguments * @return SimInstance Updated SimInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SimInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'CallbackMethod' => $options['callbackMethod'], 'CallbackUrl' => $options['callbackUrl'], 'FriendlyName' => $options['friendlyName'], 'RatePlan' => $options['ratePlan'], 'Status' => $options['status'], 'CommandsCallbackMethod' => $options['commandsCallbackMethod'], 'CommandsCallbackUrl' => $options['commandsCallbackUrl'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'ResetStatus' => $options['resetStatus'], 'AccountSid' => $options['accountSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SimInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the dataSessions */ protected function getDataSessions(): DataSessionList { if (!$this->_dataSessions) { $this->_dataSessions = new DataSessionList( $this->version, $this->solution['sid'] ); } return $this->_dataSessions; } /** * Access the usageRecords */ protected function getUsageRecords(): UsageRecordList { if (!$this->_usageRecords) { $this->_usageRecords = new UsageRecordList( $this->version, $this->solution['sid'] ); } return $this->_usageRecords; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.SimContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/SimList.php 0000644 00000013105 15021223077 0014457 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SimList extends ListResource { /** * Construct the SimList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Sims'; } /** * Reads SimInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SimInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SimInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SimInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SimPage Page of SimInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SimPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'Iccid' => $options['iccid'], 'RatePlan' => $options['ratePlan'], 'EId' => $options['eId'], 'SimRegistrationCode' => $options['simRegistrationCode'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SimPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SimInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SimPage Page of SimInstance */ public function getPage(string $targetUrl): SimPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SimPage($this->version, $response, $this->solution); } /** * Constructs a SimContext * * @param string $sid The SID or the `unique_name` of the Sim resource to delete. */ public function getContext( string $sid ): SimContext { return new SimContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.SimList]'; } } sdk/src/Twilio/Rest/Wireless/V1/CommandContext.php 0000644 00000004344 15021223077 0016023 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class CommandContext extends InstanceContext { /** * Initialize the CommandContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Command resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Commands/' . \rawurlencode($sid) .''; } /** * Delete the CommandInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CommandInstance * * @return CommandInstance Fetched CommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CommandInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CommandInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.CommandContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/RatePlanContext.php 0000644 00000005774 15021223077 0016163 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class RatePlanContext extends InstanceContext { /** * Initialize the RatePlanContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the RatePlan resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/RatePlans/' . \rawurlencode($sid) .''; } /** * Delete the RatePlanInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RatePlanInstance * * @return RatePlanInstance Fetched RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RatePlanInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RatePlanInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Updated RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): RatePlanInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $options['uniqueName'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RatePlanInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.RatePlanContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/CommandOptions.php 0000644 00000031340 15021223077 0016026 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Options; use Twilio\Values; abstract class CommandOptions { /** * @param string $sim The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to send the Command to. * @param string $callbackMethod The HTTP method we use to call `callback_url`. Can be: `POST` or `GET`, and the default is `POST`. * @param string $callbackUrl The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed. * @param string $commandMode * @param string $includeSid Whether to include the SID of the command in the message body. Can be: `none`, `start`, or `end`, and the default behavior is `none`. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once. A value of `start` will prepend the message with the Command SID, and `end` will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included. * @param bool $deliveryReceiptRequested Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to 'delivered' once the server has received a delivery receipt from the device. The default value is `true`. * @return CreateCommandOptions Options builder */ public static function create( string $sim = Values::NONE, string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $commandMode = Values::NONE, string $includeSid = Values::NONE, bool $deliveryReceiptRequested = Values::BOOL_NONE ): CreateCommandOptions { return new CreateCommandOptions( $sim, $callbackMethod, $callbackUrl, $commandMode, $includeSid, $deliveryReceiptRequested ); } /** * @param string $sim The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read. * @param string $status The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. * @param string $direction Only return Commands with this direction value. * @param string $transport Only return Commands with this transport value. Can be: `sms` or `ip`. * @return ReadCommandOptions Options builder */ public static function read( string $sim = Values::NONE, string $status = Values::NONE, string $direction = Values::NONE, string $transport = Values::NONE ): ReadCommandOptions { return new ReadCommandOptions( $sim, $status, $direction, $transport ); } } class CreateCommandOptions extends Options { /** * @param string $sim The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to send the Command to. * @param string $callbackMethod The HTTP method we use to call `callback_url`. Can be: `POST` or `GET`, and the default is `POST`. * @param string $callbackUrl The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed. * @param string $commandMode * @param string $includeSid Whether to include the SID of the command in the message body. Can be: `none`, `start`, or `end`, and the default behavior is `none`. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once. A value of `start` will prepend the message with the Command SID, and `end` will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included. * @param bool $deliveryReceiptRequested Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to 'delivered' once the server has received a delivery receipt from the device. The default value is `true`. */ public function __construct( string $sim = Values::NONE, string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $commandMode = Values::NONE, string $includeSid = Values::NONE, bool $deliveryReceiptRequested = Values::BOOL_NONE ) { $this->options['sim'] = $sim; $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['commandMode'] = $commandMode; $this->options['includeSid'] = $includeSid; $this->options['deliveryReceiptRequested'] = $deliveryReceiptRequested; } /** * The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to send the Command to. * * @param string $sim The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to send the Command to. * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * The HTTP method we use to call `callback_url`. Can be: `POST` or `GET`, and the default is `POST`. * * @param string $callbackMethod The HTTP method we use to call `callback_url`. Can be: `POST` or `GET`, and the default is `POST`. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed. * * @param string $callbackUrl The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed. * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * @param string $commandMode * @return $this Fluent Builder */ public function setCommandMode(string $commandMode): self { $this->options['commandMode'] = $commandMode; return $this; } /** * Whether to include the SID of the command in the message body. Can be: `none`, `start`, or `end`, and the default behavior is `none`. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once. A value of `start` will prepend the message with the Command SID, and `end` will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included. * * @param string $includeSid Whether to include the SID of the command in the message body. Can be: `none`, `start`, or `end`, and the default behavior is `none`. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once. A value of `start` will prepend the message with the Command SID, and `end` will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included. * @return $this Fluent Builder */ public function setIncludeSid(string $includeSid): self { $this->options['includeSid'] = $includeSid; return $this; } /** * Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to 'delivered' once the server has received a delivery receipt from the device. The default value is `true`. * * @param bool $deliveryReceiptRequested Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to 'delivered' once the server has received a delivery receipt from the device. The default value is `true`. * @return $this Fluent Builder */ public function setDeliveryReceiptRequested(bool $deliveryReceiptRequested): self { $this->options['deliveryReceiptRequested'] = $deliveryReceiptRequested; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.CreateCommandOptions ' . $options . ']'; } } class ReadCommandOptions extends Options { /** * @param string $sim The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read. * @param string $status The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. * @param string $direction Only return Commands with this direction value. * @param string $transport Only return Commands with this transport value. Can be: `sms` or `ip`. */ public function __construct( string $sim = Values::NONE, string $status = Values::NONE, string $direction = Values::NONE, string $transport = Values::NONE ) { $this->options['sim'] = $sim; $this->options['status'] = $status; $this->options['direction'] = $direction; $this->options['transport'] = $transport; } /** * The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read. * * @param string $sim The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read. * @return $this Fluent Builder */ public function setSim(string $sim): self { $this->options['sim'] = $sim; return $this; } /** * The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. * * @param string $status The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Only return Commands with this direction value. * * @param string $direction Only return Commands with this direction value. * @return $this Fluent Builder */ public function setDirection(string $direction): self { $this->options['direction'] = $direction; return $this; } /** * Only return Commands with this transport value. Can be: `sms` or `ip`. * * @param string $transport Only return Commands with this transport value. Can be: `sms` or `ip`. * @return $this Fluent Builder */ public function setTransport(string $transport): self { $this->options['transport'] = $transport; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.ReadCommandOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/CommandInstance.php 0000644 00000010764 15021223077 0016146 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $simSid * @property string|null $command * @property string $commandMode * @property string $transport * @property bool|null $deliveryReceiptRequested * @property string $status * @property string $direction * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class CommandInstance extends InstanceResource { /** * Initialize the CommandInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Command resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'command' => Values::array_get($payload, 'command'), 'commandMode' => Values::array_get($payload, 'command_mode'), 'transport' => Values::array_get($payload, 'transport'), 'deliveryReceiptRequested' => Values::array_get($payload, 'delivery_receipt_requested'), 'status' => Values::array_get($payload, 'status'), 'direction' => Values::array_get($payload, 'direction'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CommandContext Context for this CommandInstance */ protected function proxy(): CommandContext { if (!$this->context) { $this->context = new CommandContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CommandInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CommandInstance * * @return CommandInstance Fetched CommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CommandInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.CommandInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/CommandList.php 0000644 00000015506 15021223077 0015314 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class CommandList extends ListResource { /** * Construct the CommandList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Commands'; } /** * Create the CommandInstance * * @param string $command The message body of the Command. Can be plain text in text mode or a Base64 encoded byte string in binary mode. * @param array|Options $options Optional Arguments * @return CommandInstance Created CommandInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $command, array $options = []): CommandInstance { $options = new Values($options); $data = Values::of([ 'Command' => $command, 'Sim' => $options['sim'], 'CallbackMethod' => $options['callbackMethod'], 'CallbackUrl' => $options['callbackUrl'], 'CommandMode' => $options['commandMode'], 'IncludeSid' => $options['includeSid'], 'DeliveryReceiptRequested' => Serialize::booleanToString($options['deliveryReceiptRequested']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CommandInstance( $this->version, $payload ); } /** * Reads CommandInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CommandInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CommandInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CommandInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CommandPage Page of CommandInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CommandPage { $options = new Values($options); $params = Values::of([ 'Sim' => $options['sim'], 'Status' => $options['status'], 'Direction' => $options['direction'], 'Transport' => $options['transport'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CommandPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CommandInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CommandPage Page of CommandInstance */ public function getPage(string $targetUrl): CommandPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CommandPage($this->version, $response, $this->solution); } /** * Constructs a CommandContext * * @param string $sid The SID of the Command resource to delete. */ public function getContext( string $sid ): CommandContext { return new CommandContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.CommandList]'; } } sdk/src/Twilio/Rest/Wireless/V1/RatePlanInstance.php 0000644 00000013001 15021223077 0016261 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $uniqueName * @property string|null $accountSid * @property string|null $friendlyName * @property bool|null $dataEnabled * @property string|null $dataMetering * @property int|null $dataLimit * @property bool|null $messagingEnabled * @property bool|null $voiceEnabled * @property bool|null $nationalRoamingEnabled * @property int|null $nationalRoamingDataLimit * @property string[]|null $internationalRoaming * @property int|null $internationalRoamingDataLimit * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class RatePlanInstance extends InstanceResource { /** * Initialize the RatePlanInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the RatePlan resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dataEnabled' => Values::array_get($payload, 'data_enabled'), 'dataMetering' => Values::array_get($payload, 'data_metering'), 'dataLimit' => Values::array_get($payload, 'data_limit'), 'messagingEnabled' => Values::array_get($payload, 'messaging_enabled'), 'voiceEnabled' => Values::array_get($payload, 'voice_enabled'), 'nationalRoamingEnabled' => Values::array_get($payload, 'national_roaming_enabled'), 'nationalRoamingDataLimit' => Values::array_get($payload, 'national_roaming_data_limit'), 'internationalRoaming' => Values::array_get($payload, 'international_roaming'), 'internationalRoamingDataLimit' => Values::array_get($payload, 'international_roaming_data_limit'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RatePlanContext Context for this RatePlanInstance */ protected function proxy(): RatePlanContext { if (!$this->context) { $this->context = new RatePlanContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the RatePlanInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RatePlanInstance * * @return RatePlanInstance Fetched RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RatePlanInstance { return $this->proxy()->fetch(); } /** * Update the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Updated RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): RatePlanInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.RatePlanInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionPage.php 0000644 00000003115 15021223077 0016635 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DataSessionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DataSessionInstance \Twilio\Rest\Wireless\V1\Sim\DataSessionInstance */ public function buildInstance(array $payload): DataSessionInstance { return new DataSessionInstance($this->version, $payload, $this->solution['simSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.DataSessionPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordInstance.php 0000644 00000005065 15021223077 0017521 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $simSid * @property string|null $accountSid * @property array|null $period * @property array|null $commands * @property array|null $data */ class UsageRecordInstance extends InstanceResource { /** * Initialize the UsageRecordInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $simSid The SID of the [Sim resource](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read the usage from. */ public function __construct(Version $version, array $payload, string $simSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'simSid' => Values::array_get($payload, 'sim_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'period' => Values::array_get($payload, 'period'), 'commands' => Values::array_get($payload, 'commands'), 'data' => Values::array_get($payload, 'data'), ]; $this->solution = ['simSid' => $simSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.UsageRecordInstance]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordOptions.php 0000644 00000011303 15021223077 0017400 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\Options; use Twilio\Values; abstract class UsageRecordOptions { /** * @param \DateTime $end Only include usage that occurred on or before this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is the current time. * @param \DateTime $start Only include usage that has occurred on or after this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is one month before the `end` parameter value. * @param string $granularity How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. The default is `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. * @return ReadUsageRecordOptions Options builder */ public static function read( \DateTime $end = null, \DateTime $start = null, string $granularity = Values::NONE ): ReadUsageRecordOptions { return new ReadUsageRecordOptions( $end, $start, $granularity ); } } class ReadUsageRecordOptions extends Options { /** * @param \DateTime $end Only include usage that occurred on or before this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is the current time. * @param \DateTime $start Only include usage that has occurred on or after this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is one month before the `end` parameter value. * @param string $granularity How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. The default is `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. */ public function __construct( \DateTime $end = null, \DateTime $start = null, string $granularity = Values::NONE ) { $this->options['end'] = $end; $this->options['start'] = $start; $this->options['granularity'] = $granularity; } /** * Only include usage that occurred on or before this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is the current time. * * @param \DateTime $end Only include usage that occurred on or before this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is the current time. * @return $this Fluent Builder */ public function setEnd(\DateTime $end): self { $this->options['end'] = $end; return $this; } /** * Only include usage that has occurred on or after this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is one month before the `end` parameter value. * * @param \DateTime $start Only include usage that has occurred on or after this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is one month before the `end` parameter value. * @return $this Fluent Builder */ public function setStart(\DateTime $start): self { $this->options['start'] = $start; return $this; } /** * How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. The default is `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. * * @param string $granularity How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. The default is `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. * @return $this Fluent Builder */ public function setGranularity(string $granularity): self { $this->options['granularity'] = $granularity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.ReadUsageRecordOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionInstance.php 0000644 00000007567 15021223077 0017544 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $simSid * @property string|null $accountSid * @property string|null $radioLink * @property string|null $operatorMcc * @property string|null $operatorMnc * @property string|null $operatorCountry * @property string|null $operatorName * @property string|null $cellId * @property array|null $cellLocationEstimate * @property int|null $packetsUploaded * @property int|null $packetsDownloaded * @property \DateTime|null $lastUpdated * @property \DateTime|null $start * @property \DateTime|null $end * @property string|null $imei */ class DataSessionInstance extends InstanceResource { /** * Initialize the DataSessionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $simSid The SID of the [Sim resource](https://www.twilio.com/docs/iot/wireless/api/sim-resource) with the Data Sessions to read. */ public function __construct(Version $version, array $payload, string $simSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'radioLink' => Values::array_get($payload, 'radio_link'), 'operatorMcc' => Values::array_get($payload, 'operator_mcc'), 'operatorMnc' => Values::array_get($payload, 'operator_mnc'), 'operatorCountry' => Values::array_get($payload, 'operator_country'), 'operatorName' => Values::array_get($payload, 'operator_name'), 'cellId' => Values::array_get($payload, 'cell_id'), 'cellLocationEstimate' => Values::array_get($payload, 'cell_location_estimate'), 'packetsUploaded' => Values::array_get($payload, 'packets_uploaded'), 'packetsDownloaded' => Values::array_get($payload, 'packets_downloaded'), 'lastUpdated' => Deserialize::dateTime(Values::array_get($payload, 'last_updated')), 'start' => Deserialize::dateTime(Values::array_get($payload, 'start')), 'end' => Deserialize::dateTime(Values::array_get($payload, 'end')), 'imei' => Values::array_get($payload, 'imei'), ]; $this->solution = ['simSid' => $simSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.DataSessionInstance]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordList.php 0000644 00000013130 15021223077 0016660 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class UsageRecordList extends ListResource { /** * Construct the UsageRecordList * * @param Version $version Version that contains the resource * @param string $simSid The SID of the [Sim resource](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read the usage from. */ public function __construct( Version $version, string $simSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'simSid' => $simSid, ]; $this->uri = '/Sims/' . \rawurlencode($simSid) .'/UsageRecords'; } /** * Reads UsageRecordInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UsageRecordInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams UsageRecordInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UsageRecordInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UsageRecordPage Page of UsageRecordInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UsageRecordPage { $options = new Values($options); $params = Values::of([ 'End' => Serialize::iso8601DateTime($options['end']), 'Start' => Serialize::iso8601DateTime($options['start']), 'Granularity' => $options['granularity'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UsageRecordInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UsageRecordPage Page of UsageRecordInstance */ public function getPage(string $targetUrl): UsageRecordPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.UsageRecordList]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordPage.php 0000644 00000003115 15021223077 0016623 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UsageRecordPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UsageRecordInstance \Twilio\Rest\Wireless\V1\Sim\UsageRecordInstance */ public function buildInstance(array $payload): UsageRecordInstance { return new UsageRecordInstance($this->version, $payload, $this->solution['simSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.UsageRecordPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionList.php 0000644 00000012123 15021223077 0016673 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DataSessionList extends ListResource { /** * Construct the DataSessionList * * @param Version $version Version that contains the resource * @param string $simSid The SID of the [Sim resource](https://www.twilio.com/docs/iot/wireless/api/sim-resource) with the Data Sessions to read. */ public function __construct( Version $version, string $simSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'simSid' => $simSid, ]; $this->uri = '/Sims/' . \rawurlencode($simSid) .'/DataSessions'; } /** * Reads DataSessionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DataSessionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DataSessionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DataSessionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DataSessionPage Page of DataSessionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DataSessionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DataSessionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DataSessionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DataSessionPage Page of DataSessionInstance */ public function getPage(string $targetUrl): DataSessionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DataSessionPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.DataSessionList]'; } } sdk/src/Twilio/Rest/Wireless/V1/UsageRecordInstance.php 0000644 00000004434 15021223077 0016770 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property array|null $period * @property array|null $commands * @property array|null $data */ class UsageRecordInstance extends InstanceResource { /** * Initialize the UsageRecordInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'period' => Values::array_get($payload, 'period'), 'commands' => Values::array_get($payload, 'commands'), 'data' => Values::array_get($payload, 'data'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.UsageRecordInstance]'; } } sdk/src/Twilio/Rest/Wireless/V1/UsageRecordOptions.php 0000644 00000010357 15021223077 0016660 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Options; use Twilio\Values; abstract class UsageRecordOptions { /** * @param \DateTime $end Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). * @param \DateTime $start Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). * @param string $granularity How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. * @return ReadUsageRecordOptions Options builder */ public static function read( \DateTime $end = null, \DateTime $start = null, string $granularity = Values::NONE ): ReadUsageRecordOptions { return new ReadUsageRecordOptions( $end, $start, $granularity ); } } class ReadUsageRecordOptions extends Options { /** * @param \DateTime $end Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). * @param \DateTime $start Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). * @param string $granularity How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. */ public function __construct( \DateTime $end = null, \DateTime $start = null, string $granularity = Values::NONE ) { $this->options['end'] = $end; $this->options['start'] = $start; $this->options['granularity'] = $granularity; } /** * Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). * * @param \DateTime $end Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). * @return $this Fluent Builder */ public function setEnd(\DateTime $end): self { $this->options['end'] = $end; return $this; } /** * Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). * * @param \DateTime $start Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). * @return $this Fluent Builder */ public function setStart(\DateTime $start): self { $this->options['start'] = $start; return $this; } /** * How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. * * @param string $granularity How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. * @return $this Fluent Builder */ public function setGranularity(string $granularity): self { $this->options['granularity'] = $granularity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.ReadUsageRecordOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/SimInstance.php 0000644 00000015215 15021223077 0015314 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Wireless\V1\Sim\DataSessionList; use Twilio\Rest\Wireless\V1\Sim\UsageRecordList; /** * @property string|null $sid * @property string|null $uniqueName * @property string|null $accountSid * @property string|null $ratePlanSid * @property string|null $friendlyName * @property string|null $iccid * @property string|null $eId * @property string $status * @property string $resetStatus * @property string|null $commandsCallbackUrl * @property string|null $commandsCallbackMethod * @property string|null $smsFallbackMethod * @property string|null $smsFallbackUrl * @property string|null $smsMethod * @property string|null $smsUrl * @property string|null $voiceFallbackMethod * @property string|null $voiceFallbackUrl * @property string|null $voiceMethod * @property string|null $voiceUrl * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links * @property string|null $ipAddress */ class SimInstance extends InstanceResource { protected $_dataSessions; protected $_usageRecords; /** * Initialize the SimInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID or the `unique_name` of the Sim resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'ratePlanSid' => Values::array_get($payload, 'rate_plan_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'iccid' => Values::array_get($payload, 'iccid'), 'eId' => Values::array_get($payload, 'e_id'), 'status' => Values::array_get($payload, 'status'), 'resetStatus' => Values::array_get($payload, 'reset_status'), 'commandsCallbackUrl' => Values::array_get($payload, 'commands_callback_url'), 'commandsCallbackMethod' => Values::array_get($payload, 'commands_callback_method'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'ipAddress' => Values::array_get($payload, 'ip_address'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SimContext Context for this SimInstance */ protected function proxy(): SimContext { if (!$this->context) { $this->context = new SimContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the SimInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SimInstance * * @return SimInstance Fetched SimInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SimInstance { return $this->proxy()->fetch(); } /** * Update the SimInstance * * @param array|Options $options Optional Arguments * @return SimInstance Updated SimInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SimInstance { return $this->proxy()->update($options); } /** * Access the dataSessions */ protected function getDataSessions(): DataSessionList { return $this->proxy()->dataSessions; } /** * Access the usageRecords */ protected function getUsageRecords(): UsageRecordList { return $this->proxy()->usageRecords; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.SimInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/SimPage.php 0000644 00000002772 15021223077 0014430 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SimPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SimInstance \Twilio\Rest\Wireless\V1\SimInstance */ public function buildInstance(array $payload): SimInstance { return new SimInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.SimPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/SimOptions.php 0000644 00000056663 15021223077 0015217 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Options; use Twilio\Values; abstract class SimOptions { /** * @param string $status Only return Sim resources with this status. * @param string $iccid Only return Sim resources with this ICCID. This will return a list with a maximum size of 1. * @param string $ratePlan The SID or unique name of a [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource). Only return Sim resources assigned to this RatePlan resource. * @param string $eId Deprecated. * @param string $simRegistrationCode Only return Sim resources with this registration code. This will return a list with a maximum size of 1. * @return ReadSimOptions Options builder */ public static function read( string $status = Values::NONE, string $iccid = Values::NONE, string $ratePlan = Values::NONE, string $eId = Values::NONE, string $simRegistrationCode = Values::NONE ): ReadSimOptions { return new ReadSimOptions( $status, $iccid, $ratePlan, $eId, $simRegistrationCode ); } /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource. * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`. * @param string $callbackUrl The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`). * @param string $friendlyName A descriptive string that you create to describe the Sim resource. It does not need to be unique. * @param string $ratePlan The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource) to which the Sim resource should be assigned. * @param string $status * @param string $commandsCallbackMethod The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`. * @param string $commandsCallbackUrl The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored. * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. * @param string $smsFallbackUrl The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`. * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. * @param string $smsUrl The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). * @param string $voiceFallbackMethod Deprecated. * @param string $voiceFallbackUrl Deprecated. * @param string $voiceMethod Deprecated. * @param string $voiceUrl Deprecated. * @param string $resetStatus * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/iot/wireless/api/sim-resource#move-sims-between-subaccounts). * @return UpdateSimOptions Options builder */ public static function update( string $uniqueName = Values::NONE, string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $friendlyName = Values::NONE, string $ratePlan = Values::NONE, string $status = Values::NONE, string $commandsCallbackMethod = Values::NONE, string $commandsCallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $resetStatus = Values::NONE, string $accountSid = Values::NONE ): UpdateSimOptions { return new UpdateSimOptions( $uniqueName, $callbackMethod, $callbackUrl, $friendlyName, $ratePlan, $status, $commandsCallbackMethod, $commandsCallbackUrl, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $resetStatus, $accountSid ); } } class ReadSimOptions extends Options { /** * @param string $status Only return Sim resources with this status. * @param string $iccid Only return Sim resources with this ICCID. This will return a list with a maximum size of 1. * @param string $ratePlan The SID or unique name of a [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource). Only return Sim resources assigned to this RatePlan resource. * @param string $eId Deprecated. * @param string $simRegistrationCode Only return Sim resources with this registration code. This will return a list with a maximum size of 1. */ public function __construct( string $status = Values::NONE, string $iccid = Values::NONE, string $ratePlan = Values::NONE, string $eId = Values::NONE, string $simRegistrationCode = Values::NONE ) { $this->options['status'] = $status; $this->options['iccid'] = $iccid; $this->options['ratePlan'] = $ratePlan; $this->options['eId'] = $eId; $this->options['simRegistrationCode'] = $simRegistrationCode; } /** * Only return Sim resources with this status. * * @param string $status Only return Sim resources with this status. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Only return Sim resources with this ICCID. This will return a list with a maximum size of 1. * * @param string $iccid Only return Sim resources with this ICCID. This will return a list with a maximum size of 1. * @return $this Fluent Builder */ public function setIccid(string $iccid): self { $this->options['iccid'] = $iccid; return $this; } /** * The SID or unique name of a [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource). Only return Sim resources assigned to this RatePlan resource. * * @param string $ratePlan The SID or unique name of a [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource). Only return Sim resources assigned to this RatePlan resource. * @return $this Fluent Builder */ public function setRatePlan(string $ratePlan): self { $this->options['ratePlan'] = $ratePlan; return $this; } /** * Deprecated. * * @param string $eId Deprecated. * @return $this Fluent Builder */ public function setEId(string $eId): self { $this->options['eId'] = $eId; return $this; } /** * Only return Sim resources with this registration code. This will return a list with a maximum size of 1. * * @param string $simRegistrationCode Only return Sim resources with this registration code. This will return a list with a maximum size of 1. * @return $this Fluent Builder */ public function setSimRegistrationCode(string $simRegistrationCode): self { $this->options['simRegistrationCode'] = $simRegistrationCode; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.ReadSimOptions ' . $options . ']'; } } class UpdateSimOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource. * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`. * @param string $callbackUrl The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`). * @param string $friendlyName A descriptive string that you create to describe the Sim resource. It does not need to be unique. * @param string $ratePlan The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource) to which the Sim resource should be assigned. * @param string $status * @param string $commandsCallbackMethod The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`. * @param string $commandsCallbackUrl The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored. * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. * @param string $smsFallbackUrl The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`. * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. * @param string $smsUrl The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). * @param string $voiceFallbackMethod Deprecated. * @param string $voiceFallbackUrl Deprecated. * @param string $voiceMethod Deprecated. * @param string $voiceUrl Deprecated. * @param string $resetStatus * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/iot/wireless/api/sim-resource#move-sims-between-subaccounts). */ public function __construct( string $uniqueName = Values::NONE, string $callbackMethod = Values::NONE, string $callbackUrl = Values::NONE, string $friendlyName = Values::NONE, string $ratePlan = Values::NONE, string $status = Values::NONE, string $commandsCallbackMethod = Values::NONE, string $commandsCallbackUrl = Values::NONE, string $smsFallbackMethod = Values::NONE, string $smsFallbackUrl = Values::NONE, string $smsMethod = Values::NONE, string $smsUrl = Values::NONE, string $voiceFallbackMethod = Values::NONE, string $voiceFallbackUrl = Values::NONE, string $voiceMethod = Values::NONE, string $voiceUrl = Values::NONE, string $resetStatus = Values::NONE, string $accountSid = Values::NONE ) { $this->options['uniqueName'] = $uniqueName; $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['friendlyName'] = $friendlyName; $this->options['ratePlan'] = $ratePlan; $this->options['status'] = $status; $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['resetStatus'] = $resetStatus; $this->options['accountSid'] = $accountSid; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`. * * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`. * @return $this Fluent Builder */ public function setCallbackMethod(string $callbackMethod): self { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`). * * @param string $callbackUrl The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`). * @return $this Fluent Builder */ public function setCallbackUrl(string $callbackUrl): self { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * A descriptive string that you create to describe the Sim resource. It does not need to be unique. * * @param string $friendlyName A descriptive string that you create to describe the Sim resource. It does not need to be unique. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource) to which the Sim resource should be assigned. * * @param string $ratePlan The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource) to which the Sim resource should be assigned. * @return $this Fluent Builder */ public function setRatePlan(string $ratePlan): self { $this->options['ratePlan'] = $ratePlan; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`. * * @param string $commandsCallbackMethod The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`. * @return $this Fluent Builder */ public function setCommandsCallbackMethod(string $commandsCallbackMethod): self { $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; return $this; } /** * The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored. * * @param string $commandsCallbackUrl The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored. * @return $this Fluent Builder */ public function setCommandsCallbackUrl(string $commandsCallbackUrl): self { $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; return $this; } /** * The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. * * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. * @return $this Fluent Builder */ public function setSmsFallbackMethod(string $smsFallbackMethod): self { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`. * * @param string $smsFallbackUrl The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`. * @return $this Fluent Builder */ public function setSmsFallbackUrl(string $smsFallbackUrl): self { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. * * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. * @return $this Fluent Builder */ public function setSmsMethod(string $smsMethod): self { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). * * @param string $smsUrl The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/iot/wireless/api/command-resource). * @return $this Fluent Builder */ public function setSmsUrl(string $smsUrl): self { $this->options['smsUrl'] = $smsUrl; return $this; } /** * Deprecated. * * @param string $voiceFallbackMethod Deprecated. * @return $this Fluent Builder */ public function setVoiceFallbackMethod(string $voiceFallbackMethod): self { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * Deprecated. * * @param string $voiceFallbackUrl Deprecated. * @return $this Fluent Builder */ public function setVoiceFallbackUrl(string $voiceFallbackUrl): self { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * Deprecated. * * @param string $voiceMethod Deprecated. * @return $this Fluent Builder */ public function setVoiceMethod(string $voiceMethod): self { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * Deprecated. * * @param string $voiceUrl Deprecated. * @return $this Fluent Builder */ public function setVoiceUrl(string $voiceUrl): self { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * @param string $resetStatus * @return $this Fluent Builder */ public function setResetStatus(string $resetStatus): self { $this->options['resetStatus'] = $resetStatus; return $this; } /** * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/iot/wireless/api/sim-resource#move-sims-between-subaccounts). * * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/iot/wireless/api/sim-resource#move-sims-between-subaccounts). * @return $this Fluent Builder */ public function setAccountSid(string $accountSid): self { $this->options['accountSid'] = $accountSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Wireless.V1.UpdateSimOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/UsageRecordList.php 0000644 00000012520 15021223077 0016132 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class UsageRecordList extends ListResource { /** * Construct the UsageRecordList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/UsageRecords'; } /** * Reads UsageRecordInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UsageRecordInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams UsageRecordInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UsageRecordInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UsageRecordPage Page of UsageRecordInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UsageRecordPage { $options = new Values($options); $params = Values::of([ 'End' => Serialize::iso8601DateTime($options['end']), 'Start' => Serialize::iso8601DateTime($options['start']), 'Granularity' => $options['granularity'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UsageRecordInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UsageRecordPage Page of UsageRecordInstance */ public function getPage(string $targetUrl): UsageRecordPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.UsageRecordList]'; } } sdk/src/Twilio/Rest/Wireless/V1/UsageRecordPage.php 0000644 00000003052 15021223077 0016073 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UsageRecordPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UsageRecordInstance \Twilio\Rest\Wireless\V1\UsageRecordInstance */ public function buildInstance(array $payload): UsageRecordInstance { return new UsageRecordInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1.UsageRecordPage]'; } } sdk/src/Twilio/Rest/Wireless/V1.php 0000644 00000007117 15021223077 0013101 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Wireless * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Wireless; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Wireless\V1\CommandList; use Twilio\Rest\Wireless\V1\RatePlanList; use Twilio\Rest\Wireless\V1\SimList; use Twilio\Rest\Wireless\V1\UsageRecordList; use Twilio\Version; /** * @property CommandList $commands * @property RatePlanList $ratePlans * @property SimList $sims * @property UsageRecordList $usageRecords * @method \Twilio\Rest\Wireless\V1\CommandContext commands(string $sid) * @method \Twilio\Rest\Wireless\V1\RatePlanContext ratePlans(string $sid) * @method \Twilio\Rest\Wireless\V1\SimContext sims(string $sid) */ class V1 extends Version { protected $_commands; protected $_ratePlans; protected $_sims; protected $_usageRecords; /** * Construct the V1 version of Wireless * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getCommands(): CommandList { if (!$this->_commands) { $this->_commands = new CommandList($this); } return $this->_commands; } protected function getRatePlans(): RatePlanList { if (!$this->_ratePlans) { $this->_ratePlans = new RatePlanList($this); } return $this->_ratePlans; } protected function getSims(): SimList { if (!$this->_sims) { $this->_sims = new SimList($this); } return $this->_sims; } protected function getUsageRecords(): UsageRecordList { if (!$this->_usageRecords) { $this->_usageRecords = new UsageRecordList($this); } return $this->_usageRecords; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Wireless.V1]'; } } sdk/src/Twilio/Rest/Pricing/V2/NumberOptions.php 0000644 00000005326 15021223077 0015504 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2; use Twilio\Options; use Twilio\Values; abstract class NumberOptions { /** * @param string $originationNumber The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. * @return FetchNumberOptions Options builder */ public static function fetch( string $originationNumber = Values::NONE ): FetchNumberOptions { return new FetchNumberOptions( $originationNumber ); } } class FetchNumberOptions extends Options { /** * @param string $originationNumber The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. */ public function __construct( string $originationNumber = Values::NONE ) { $this->options['originationNumber'] = $originationNumber; } /** * The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. * * @param string $originationNumber The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. * @return $this Fluent Builder */ public function setOriginationNumber(string $originationNumber): self { $this->options['originationNumber'] = $originationNumber; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Pricing.V2.FetchNumberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/NumberPage.php 0000644 00000003010 15021223077 0014711 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return NumberInstance \Twilio\Rest\Pricing\V2\NumberInstance */ public function buildInstance(array $payload): NumberInstance { return new NumberInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2.NumberPage]'; } } sdk/src/Twilio/Rest/Pricing/V2/NumberContext.php 0000644 00000004773 15021223077 0015502 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class NumberContext extends InstanceContext { /** * Initialize the NumberContext * * @param Version $version Version that contains the resource * @param string $destinationNumber The destination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. */ public function __construct( Version $version, $destinationNumber ) { parent::__construct($version); // Path Solution $this->solution = [ 'destinationNumber' => $destinationNumber, ]; $this->uri = '/Trunking/Numbers/' . \rawurlencode($destinationNumber) .''; } /** * Fetch the NumberInstance * * @param array|Options $options Optional Arguments * @return NumberInstance Fetched NumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): NumberInstance { $options = new Values($options); $params = Values::of([ 'OriginationNumber' => $options['originationNumber'], ]); $payload = $this->version->fetch('GET', $this->uri, $params, []); return new NumberInstance( $this->version, $payload, $this->solution['destinationNumber'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V2.NumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/VoiceInstance.php 0000644 00000003430 15021223077 0015424 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Version; class VoiceInstance extends InstanceResource { /** * Initialize the VoiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2.VoiceInstance]'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberOptions.php 0000644 00000005334 15021223077 0016550 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Options; use Twilio\Values; abstract class NumberOptions { /** * @param string $originationNumber The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. * @return FetchNumberOptions Options builder */ public static function fetch( string $originationNumber = Values::NONE ): FetchNumberOptions { return new FetchNumberOptions( $originationNumber ); } } class FetchNumberOptions extends Options { /** * @param string $originationNumber The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. */ public function __construct( string $originationNumber = Values::NONE ) { $this->options['originationNumber'] = $originationNumber; } /** * The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. * * @param string $originationNumber The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. * @return $this Fluent Builder */ public function setOriginationNumber(string $originationNumber): self { $this->options['originationNumber'] = $originationNumber; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Pricing.V2.FetchNumberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberPage.php 0000644 00000003024 15021223077 0015763 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return NumberInstance \Twilio\Rest\Pricing\V2\Voice\NumberInstance */ public function buildInstance(array $payload): NumberInstance { return new NumberInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2.NumberPage]'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberContext.php 0000644 00000004776 15021223077 0016552 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class NumberContext extends InstanceContext { /** * Initialize the NumberContext * * @param Version $version Version that contains the resource * @param string $destinationNumber The destination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. */ public function __construct( Version $version, $destinationNumber ) { parent::__construct($version); // Path Solution $this->solution = [ 'destinationNumber' => $destinationNumber, ]; $this->uri = '/Voice/Numbers/' . \rawurlencode($destinationNumber) .''; } /** * Fetch the NumberInstance * * @param array|Options $options Optional Arguments * @return NumberInstance Fetched NumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): NumberInstance { $options = new Values($options); $params = Values::of([ 'OriginationNumber' => $options['originationNumber'], ]); $payload = $this->version->fetch('GET', $this->uri, $params, []); return new NumberInstance( $this->version, $payload, $this->solution['destinationNumber'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V2.NumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberList.php 0000644 00000003252 15021223077 0016025 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\ListResource; use Twilio\Version; class NumberList extends ListResource { /** * Construct the NumberList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a NumberContext * * @param string $destinationNumber The destination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. */ public function getContext( string $destinationNumber ): NumberContext { return new NumberContext( $this->version, $destinationNumber ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2.NumberList]'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryInstance.php 0000644 00000007342 15021223077 0017075 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $country * @property string|null $isoCountry * @property string[]|null $outboundPrefixPrices * @property string[]|null $inboundCallPrices * @property string|null $priceUnit * @property string|null $url */ class CountryInstance extends InstanceResource { /** * Initialize the CountryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. */ public function __construct(Version $version, array $payload, string $isoCountry = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'country' => Values::array_get($payload, 'country'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'outboundPrefixPrices' => Values::array_get($payload, 'outbound_prefix_prices'), 'inboundCallPrices' => Values::array_get($payload, 'inbound_call_prices'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['isoCountry' => $isoCountry ?: $this->properties['isoCountry'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CountryContext Context for this CountryInstance */ protected function proxy(): CountryContext { if (!$this->context) { $this->context = new CountryContext( $this->version, $this->solution['isoCountry'] ); } return $this->context; } /** * Fetch the CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CountryInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V2.CountryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberInstance.php 0000644 00000010321 15021223077 0016651 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $destinationNumber * @property string|null $originationNumber * @property string|null $country * @property string|null $isoCountry * @property string[]|null $outboundCallPrices * @property string|null $inboundCallPrice * @property string|null $priceUnit * @property string|null $url */ class NumberInstance extends InstanceResource { /** * Initialize the NumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $destinationNumber The destination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. */ public function __construct(Version $version, array $payload, string $destinationNumber = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'destinationNumber' => Values::array_get($payload, 'destination_number'), 'originationNumber' => Values::array_get($payload, 'origination_number'), 'country' => Values::array_get($payload, 'country'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'outboundCallPrices' => Values::array_get($payload, 'outbound_call_prices'), 'inboundCallPrice' => Values::array_get($payload, 'inbound_call_price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['destinationNumber' => $destinationNumber ?: $this->properties['destinationNumber'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return NumberContext Context for this NumberInstance */ protected function proxy(): NumberContext { if (!$this->context) { $this->context = new NumberContext( $this->version, $this->solution['destinationNumber'] ); } return $this->context; } /** * Fetch the NumberInstance * * @param array|Options $options Optional Arguments * @return NumberInstance Fetched NumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): NumberInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V2.NumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryPage.php 0000644 00000003032 15021223077 0016175 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CountryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CountryInstance \Twilio\Rest\Pricing\V2\Voice\CountryInstance */ public function buildInstance(array $payload): CountryInstance { return new CountryInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2.CountryPage]'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryContext.php 0000644 00000004117 15021223077 0016752 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class CountryContext extends InstanceContext { /** * Initialize the CountryContext * * @param Version $version Version that contains the resource * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. */ public function __construct( Version $version, $isoCountry ) { parent::__construct($version); // Path Solution $this->solution = [ 'isoCountry' => $isoCountry, ]; $this->uri = '/Voice/Countries/' . \rawurlencode($isoCountry) .''; } /** * Fetch the CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CountryInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CountryInstance( $this->version, $payload, $this->solution['isoCountry'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V2.CountryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryList.php 0000644 00000012257 15021223077 0016245 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Voice/Countries'; } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CountryPage Page of CountryInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CountryPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CountryPage Page of CountryInstance */ public function getPage(string $targetUrl): CountryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. */ public function getContext( string $isoCountry ): CountryContext { return new CountryContext( $this->version, $isoCountry ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2.CountryList]'; } } sdk/src/Twilio/Rest/Pricing/V2/NumberList.php 0000644 00000003244 15021223077 0014761 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2; use Twilio\ListResource; use Twilio\Version; class NumberList extends ListResource { /** * Construct the NumberList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a NumberContext * * @param string $destinationNumber The destination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. */ public function getContext( string $destinationNumber ): NumberContext { return new NumberContext( $this->version, $destinationNumber ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2.NumberList]'; } } sdk/src/Twilio/Rest/Pricing/V2/VoiceList.php 0000644 00000006345 15021223077 0014603 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Pricing\V2\Voice\CountryList; use Twilio\Rest\Pricing\V2\Voice\NumberList; /** * @property CountryList $countries * @property NumberList $numbers * @method \Twilio\Rest\Pricing\V2\Voice\CountryContext countries(string $isoCountry) * @method \Twilio\Rest\Pricing\V2\Voice\NumberContext numbers(string $destinationNumber) */ class VoiceList extends ListResource { protected $_countries = null; protected $_numbers = null; /** * Construct the VoiceList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Access the countries */ protected function getCountries(): CountryList { if (!$this->_countries) { $this->_countries = new CountryList( $this->version ); } return $this->_countries; } /** * Access the numbers */ protected function getNumbers(): NumberList { if (!$this->_numbers) { $this->_numbers = new NumberList( $this->version ); } return $this->_numbers; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2.VoiceList]'; } } sdk/src/Twilio/Rest/Pricing/V2/CountryInstance.php 0000644 00000007361 15021223077 0016031 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $country * @property string|null $isoCountry * @property string[]|null $terminatingPrefixPrices * @property string[]|null $originatingCallPrices * @property string|null $priceUnit * @property string|null $url */ class CountryInstance extends InstanceResource { /** * Initialize the CountryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. */ public function __construct(Version $version, array $payload, string $isoCountry = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'country' => Values::array_get($payload, 'country'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'terminatingPrefixPrices' => Values::array_get($payload, 'terminating_prefix_prices'), 'originatingCallPrices' => Values::array_get($payload, 'originating_call_prices'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['isoCountry' => $isoCountry ?: $this->properties['isoCountry'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CountryContext Context for this CountryInstance */ protected function proxy(): CountryContext { if (!$this->context) { $this->context = new CountryContext( $this->version, $this->solution['isoCountry'] ); } return $this->context; } /** * Fetch the CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CountryInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V2.CountryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/VoicePage.php 0000644 00000003002 15021223077 0014527 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class VoicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return VoiceInstance \Twilio\Rest\Pricing\V2\VoiceInstance */ public function buildInstance(array $payload): VoiceInstance { return new VoiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2.VoicePage]'; } } sdk/src/Twilio/Rest/Pricing/V2/NumberInstance.php 0000644 00000010346 15021223077 0015613 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $destinationNumber * @property string|null $originationNumber * @property string|null $country * @property string|null $isoCountry * @property string[]|null $terminatingPrefixPrices * @property string|null $originatingCallPrice * @property string|null $priceUnit * @property string|null $url */ class NumberInstance extends InstanceResource { /** * Initialize the NumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $destinationNumber The destination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. */ public function __construct(Version $version, array $payload, string $destinationNumber = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'destinationNumber' => Values::array_get($payload, 'destination_number'), 'originationNumber' => Values::array_get($payload, 'origination_number'), 'country' => Values::array_get($payload, 'country'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'terminatingPrefixPrices' => Values::array_get($payload, 'terminating_prefix_prices'), 'originatingCallPrice' => Values::array_get($payload, 'originating_call_price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['destinationNumber' => $destinationNumber ?: $this->properties['destinationNumber'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return NumberContext Context for this NumberInstance */ protected function proxy(): NumberContext { if (!$this->context) { $this->context = new NumberContext( $this->version, $this->solution['destinationNumber'] ); } return $this->context; } /** * Fetch the NumberInstance * * @param array|Options $options Optional Arguments * @return NumberInstance Fetched NumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): NumberInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V2.NumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/CountryPage.php 0000644 00000003016 15021223077 0015132 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CountryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CountryInstance \Twilio\Rest\Pricing\V2\CountryInstance */ public function buildInstance(array $payload): CountryInstance { return new CountryInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2.CountryPage]'; } } sdk/src/Twilio/Rest/Pricing/V2/CountryContext.php 0000644 00000004114 15021223077 0015702 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class CountryContext extends InstanceContext { /** * Initialize the CountryContext * * @param Version $version Version that contains the resource * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. */ public function __construct( Version $version, $isoCountry ) { parent::__construct($version); // Path Solution $this->solution = [ 'isoCountry' => $isoCountry, ]; $this->uri = '/Trunking/Countries/' . \rawurlencode($isoCountry) .''; } /** * Fetch the CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CountryInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CountryInstance( $this->version, $payload, $this->solution['isoCountry'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V2.CountryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/CountryList.php 0000644 00000012254 15021223077 0015175 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V2; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Trunking/Countries'; } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CountryPage Page of CountryInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CountryPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CountryPage Page of CountryInstance */ public function getPage(string $targetUrl): CountryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. */ public function getContext( string $isoCountry ): CountryContext { return new CountryContext( $this->version, $isoCountry ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2.CountryList]'; } } sdk/src/Twilio/Rest/Pricing/V2.php 0000644 00000006307 15021223077 0012700 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Pricing\V2\CountryList; use Twilio\Rest\Pricing\V2\NumberList; use Twilio\Rest\Pricing\V2\VoiceList; use Twilio\Version; /** * @property CountryList $countries * @property NumberList $numbers * @property VoiceList $voice * @method \Twilio\Rest\Pricing\V2\CountryContext countries(string $isoCountry) * @method \Twilio\Rest\Pricing\V2\NumberContext numbers(string $destinationNumber) */ class V2 extends Version { protected $_countries; protected $_numbers; protected $_voice; /** * Construct the V2 version of Pricing * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v2'; } protected function getCountries(): CountryList { if (!$this->_countries) { $this->_countries = new CountryList($this); } return $this->_countries; } protected function getNumbers(): NumberList { if (!$this->_numbers) { $this->_numbers = new NumberList($this); } return $this->_numbers; } protected function getVoice(): VoiceList { if (!$this->_voice) { $this->_voice = new VoiceList($this); } return $this->_voice; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V2]'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberInstance.php 0000644 00000003452 15021223077 0016604 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Version; class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.PhoneNumberInstance]'; } } sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryInstance.php 0000644 00000007306 15021223077 0017744 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\Messaging; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $country * @property string|null $isoCountry * @property string[]|null $outboundSmsPrices * @property string[]|null $inboundSmsPrices * @property string|null $priceUnit * @property string|null $url */ class CountryInstance extends InstanceResource { /** * Initialize the CountryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. */ public function __construct(Version $version, array $payload, string $isoCountry = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'country' => Values::array_get($payload, 'country'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'outboundSmsPrices' => Values::array_get($payload, 'outbound_sms_prices'), 'inboundSmsPrices' => Values::array_get($payload, 'inbound_sms_prices'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['isoCountry' => $isoCountry ?: $this->properties['isoCountry'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CountryContext Context for this CountryInstance */ protected function proxy(): CountryContext { if (!$this->context) { $this->context = new CountryContext( $this->version, $this->solution['isoCountry'] ); } return $this->context; } /** * Fetch the CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CountryInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.CountryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryPage.php 0000644 00000003042 15021223077 0017045 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\Messaging; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CountryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CountryInstance \Twilio\Rest\Pricing\V1\Messaging\CountryInstance */ public function buildInstance(array $payload): CountryInstance { return new CountryInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.CountryPage]'; } } sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryContext.php 0000644 00000004103 15021223077 0017614 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\Messaging; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class CountryContext extends InstanceContext { /** * Initialize the CountryContext * * @param Version $version Version that contains the resource * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. */ public function __construct( Version $version, $isoCountry ) { parent::__construct($version); // Path Solution $this->solution = [ 'isoCountry' => $isoCountry, ]; $this->uri = '/Messaging/Countries/' . \rawurlencode($isoCountry) .''; } /** * Fetch the CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CountryInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CountryInstance( $this->version, $payload, $this->solution['isoCountry'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.CountryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryList.php 0000644 00000012243 15021223077 0017107 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\Messaging; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Messaging/Countries'; } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CountryPage Page of CountryInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CountryPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CountryPage Page of CountryInstance */ public function getPage(string $targetUrl): CountryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. */ public function getContext( string $isoCountry ): CountryContext { return new CountryContext( $this->version, $isoCountry ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.CountryList]'; } } sdk/src/Twilio/Rest/Pricing/V1/MessagingInstance.php 0000644 00000003444 15021223077 0016300 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Version; class MessagingInstance extends InstanceResource { /** * Initialize the MessagingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.MessagingInstance]'; } } sdk/src/Twilio/Rest/Pricing/V1/VoiceInstance.php 0000644 00000003430 15021223077 0015423 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Version; class VoiceInstance extends InstanceResource { /** * Initialize the VoiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.VoiceInstance]'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberPage.php 0000644 00000003046 15021223077 0015713 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PhoneNumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return PhoneNumberInstance \Twilio\Rest\Pricing\V1\PhoneNumberInstance */ public function buildInstance(array $payload): PhoneNumberInstance { return new PhoneNumberInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.PhoneNumberPage]'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberPage.php 0000644 00000003024 15021223077 0015762 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return NumberInstance \Twilio\Rest\Pricing\V1\Voice\NumberInstance */ public function buildInstance(array $payload): NumberInstance { return new NumberInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.NumberPage]'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberContext.php 0000644 00000003707 15021223077 0016542 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class NumberContext extends InstanceContext { /** * Initialize the NumberContext * * @param Version $version Version that contains the resource * @param string $number The phone number to fetch. */ public function __construct( Version $version, $number ) { parent::__construct($version); // Path Solution $this->solution = [ 'number' => $number, ]; $this->uri = '/Voice/Numbers/' . \rawurlencode($number) .''; } /** * Fetch the NumberInstance * * @return NumberInstance Fetched NumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NumberInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new NumberInstance( $this->version, $payload, $this->solution['number'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.NumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberList.php 0000644 00000002663 15021223077 0016031 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\ListResource; use Twilio\Version; class NumberList extends ListResource { /** * Construct the NumberList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a NumberContext * * @param string $number The phone number to fetch. */ public function getContext( string $number ): NumberContext { return new NumberContext( $this->version, $number ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.NumberList]'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryInstance.php 0000644 00000007316 15021223077 0017075 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $country * @property string|null $isoCountry * @property string[]|null $outboundPrefixPrices * @property string[]|null $inboundCallPrices * @property string|null $priceUnit * @property string|null $url */ class CountryInstance extends InstanceResource { /** * Initialize the CountryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. */ public function __construct(Version $version, array $payload, string $isoCountry = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'country' => Values::array_get($payload, 'country'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'outboundPrefixPrices' => Values::array_get($payload, 'outbound_prefix_prices'), 'inboundCallPrices' => Values::array_get($payload, 'inbound_call_prices'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['isoCountry' => $isoCountry ?: $this->properties['isoCountry'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CountryContext Context for this CountryInstance */ protected function proxy(): CountryContext { if (!$this->context) { $this->context = new CountryContext( $this->version, $this->solution['isoCountry'] ); } return $this->context; } /** * Fetch the CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CountryInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.CountryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberInstance.php 0000644 00000007251 15021223077 0016660 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $number * @property string|null $country * @property string|null $isoCountry * @property string|null $outboundCallPrice * @property string|null $inboundCallPrice * @property string|null $priceUnit * @property string|null $url */ class NumberInstance extends InstanceResource { /** * Initialize the NumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $number The phone number to fetch. */ public function __construct(Version $version, array $payload, string $number = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'number' => Values::array_get($payload, 'number'), 'country' => Values::array_get($payload, 'country'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'outboundCallPrice' => Values::array_get($payload, 'outbound_call_price'), 'inboundCallPrice' => Values::array_get($payload, 'inbound_call_price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['number' => $number ?: $this->properties['number'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return NumberContext Context for this NumberInstance */ protected function proxy(): NumberContext { if (!$this->context) { $this->context = new NumberContext( $this->version, $this->solution['number'] ); } return $this->context; } /** * Fetch the NumberInstance * * @return NumberInstance Fetched NumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NumberInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.NumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryPage.php 0000644 00000003032 15021223077 0016174 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CountryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CountryInstance \Twilio\Rest\Pricing\V1\Voice\CountryInstance */ public function buildInstance(array $payload): CountryInstance { return new CountryInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.CountryPage]'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryContext.php 0000644 00000004073 15021223077 0016752 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class CountryContext extends InstanceContext { /** * Initialize the CountryContext * * @param Version $version Version that contains the resource * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. */ public function __construct( Version $version, $isoCountry ) { parent::__construct($version); // Path Solution $this->solution = [ 'isoCountry' => $isoCountry, ]; $this->uri = '/Voice/Countries/' . \rawurlencode($isoCountry) .''; } /** * Fetch the CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CountryInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CountryInstance( $this->version, $payload, $this->solution['isoCountry'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.CountryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryList.php 0000644 00000012233 15021223077 0016236 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Voice/Countries'; } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CountryPage Page of CountryInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CountryPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CountryPage Page of CountryInstance */ public function getPage(string $targetUrl): CountryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. */ public function getContext( string $isoCountry ): CountryContext { return new CountryContext( $this->version, $isoCountry ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.CountryList]'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberList.php 0000644 00000005456 15021223077 0015761 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Pricing\V1\PhoneNumber\CountryList; /** * @property CountryList $countries * @method \Twilio\Rest\Pricing\V1\PhoneNumber\CountryContext countries(string $isoCountry) */ class PhoneNumberList extends ListResource { protected $_countries = null; /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Access the countries */ protected function getCountries(): CountryList { if (!$this->_countries) { $this->_countries = new CountryList( $this->version ); } return $this->_countries; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryInstance.php 0000644 00000007106 15021223077 0020247 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\PhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $country * @property string|null $isoCountry * @property string[]|null $phoneNumberPrices * @property string|null $priceUnit * @property string|null $url */ class CountryInstance extends InstanceResource { /** * Initialize the CountryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. */ public function __construct(Version $version, array $payload, string $isoCountry = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'country' => Values::array_get($payload, 'country'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'phoneNumberPrices' => Values::array_get($payload, 'phone_number_prices'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['isoCountry' => $isoCountry ?: $this->properties['isoCountry'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CountryContext Context for this CountryInstance */ protected function proxy(): CountryContext { if (!$this->context) { $this->context = new CountryContext( $this->version, $this->solution['isoCountry'] ); } return $this->context; } /** * Fetch the CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CountryInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.CountryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryPage.php 0000644 00000003046 15021223077 0017356 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\PhoneNumber; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CountryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CountryInstance \Twilio\Rest\Pricing\V1\PhoneNumber\CountryInstance */ public function buildInstance(array $payload): CountryInstance { return new CountryInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.CountryPage]'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryContext.php 0000644 00000004110 15021223077 0020117 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\PhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class CountryContext extends InstanceContext { /** * Initialize the CountryContext * * @param Version $version Version that contains the resource * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. */ public function __construct( Version $version, $isoCountry ) { parent::__construct($version); // Path Solution $this->solution = [ 'isoCountry' => $isoCountry, ]; $this->uri = '/PhoneNumbers/Countries/' . \rawurlencode($isoCountry) .''; } /** * Fetch the CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CountryInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CountryInstance( $this->version, $payload, $this->solution['isoCountry'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.CountryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryList.php 0000644 00000012250 15021223077 0017412 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1\PhoneNumber; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/PhoneNumbers/Countries'; } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CountryPage Page of CountryInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CountryPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CountryPage Page of CountryInstance */ public function getPage(string $targetUrl): CountryPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. */ public function getContext( string $isoCountry ): CountryContext { return new CountryContext( $this->version, $isoCountry ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.CountryList]'; } } sdk/src/Twilio/Rest/Pricing/V1/VoiceList.php 0000644 00000006332 15021223077 0014576 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Pricing\V1\Voice\CountryList; use Twilio\Rest\Pricing\V1\Voice\NumberList; /** * @property CountryList $countries * @property NumberList $numbers * @method \Twilio\Rest\Pricing\V1\Voice\CountryContext countries(string $isoCountry) * @method \Twilio\Rest\Pricing\V1\Voice\NumberContext numbers(string $number) */ class VoiceList extends ListResource { protected $_countries = null; protected $_numbers = null; /** * Construct the VoiceList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Access the countries */ protected function getCountries(): CountryList { if (!$this->_countries) { $this->_countries = new CountryList( $this->version ); } return $this->_countries; } /** * Access the numbers */ protected function getNumbers(): NumberList { if (!$this->_numbers) { $this->_numbers = new NumberList( $this->version ); } return $this->_numbers; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.VoiceList]'; } } sdk/src/Twilio/Rest/Pricing/V1/VoicePage.php 0000644 00000003002 15021223077 0014526 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class VoicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return VoiceInstance \Twilio\Rest\Pricing\V1\VoiceInstance */ public function buildInstance(array $payload): VoiceInstance { return new VoiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.VoicePage]'; } } sdk/src/Twilio/Rest/Pricing/V1/MessagingPage.php 0000644 00000003032 15021223077 0015401 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MessagingInstance \Twilio\Rest\Pricing\V1\MessagingInstance */ public function buildInstance(array $payload): MessagingInstance { return new MessagingInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.MessagingPage]'; } } sdk/src/Twilio/Rest/Pricing/V1/MessagingList.php 0000644 00000005444 15021223077 0015451 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Pricing\V1\Messaging\CountryList; /** * @property CountryList $countries * @method \Twilio\Rest\Pricing\V1\Messaging\CountryContext countries(string $isoCountry) */ class MessagingList extends ListResource { protected $_countries = null; /** * Construct the MessagingList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Access the countries */ protected function getCountries(): CountryList { if (!$this->_countries) { $this->_countries = new CountryList( $this->version ); } return $this->_countries; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1.MessagingList]'; } } sdk/src/Twilio/Rest/Pricing/V1.php 0000644 00000006135 15021223077 0012676 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Pricing * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Pricing; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Pricing\V1\MessagingList; use Twilio\Rest\Pricing\V1\PhoneNumberList; use Twilio\Rest\Pricing\V1\VoiceList; use Twilio\Version; /** * @property MessagingList $messaging * @property PhoneNumberList $phoneNumbers * @property VoiceList $voice */ class V1 extends Version { protected $_messaging; protected $_phoneNumbers; protected $_voice; /** * Construct the V1 version of Pricing * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getMessaging(): MessagingList { if (!$this->_messaging) { $this->_messaging = new MessagingList($this); } return $this->_messaging; } protected function getPhoneNumbers(): PhoneNumberList { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList($this); } return $this->_phoneNumbers; } protected function getVoice(): VoiceList { if (!$this->_voice) { $this->_voice = new VoiceList($this); } return $this->_voice; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing.V1]'; } } sdk/src/Twilio/Rest/Events/V1/SinkContext.php 0000644 00000011603 15021223077 0015014 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Events\V1\Sink\SinkTestList; use Twilio\Rest\Events\V1\Sink\SinkValidateList; /** * @property SinkTestList $sinkTest * @property SinkValidateList $sinkValidate */ class SinkContext extends InstanceContext { protected $_sinkTest; protected $_sinkValidate; /** * Initialize the SinkContext * * @param Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies this Sink. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Sinks/' . \rawurlencode($sid) .''; } /** * Delete the SinkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SinkInstance * * @return SinkInstance Fetched SinkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SinkInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SinkInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the SinkInstance * * @param string $description A human readable description for the Sink **This value should not contain PII.** * @return SinkInstance Updated SinkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $description): SinkInstance { $data = Values::of([ 'Description' => $description, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SinkInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the sinkTest */ protected function getSinkTest(): SinkTestList { if (!$this->_sinkTest) { $this->_sinkTest = new SinkTestList( $this->version, $this->solution['sid'] ); } return $this->_sinkTest; } /** * Access the sinkValidate */ protected function getSinkValidate(): SinkValidateList { if (!$this->_sinkValidate) { $this->_sinkValidate = new SinkValidateList( $this->version, $this->solution['sid'] ); } return $this->_sinkValidate; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Events.V1.SinkContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Events/V1/SubscriptionPage.php 0000644 00000003050 15021223077 0016021 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SubscriptionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SubscriptionInstance \Twilio\Rest\Events\V1\SubscriptionInstance */ public function buildInstance(array $payload): SubscriptionInstance { return new SubscriptionInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SubscriptionPage]'; } } sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventPage.php 0000644 00000003170 15021223077 0021113 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1\Subscription; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SubscribedEventPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SubscribedEventInstance \Twilio\Rest\Events\V1\Subscription\SubscribedEventInstance */ public function buildInstance(array $payload): SubscribedEventInstance { return new SubscribedEventInstance($this->version, $payload, $this->solution['subscriptionSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SubscribedEventPage]'; } } sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventContext.php 0000644 00000006557 15021223077 0021677 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1\Subscription; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class SubscribedEventContext extends InstanceContext { /** * Initialize the SubscribedEventContext * * @param Version $version Version that contains the resource * @param string $subscriptionSid The unique SID identifier of the Subscription. * @param string $type Type of event being subscribed to. */ public function __construct( Version $version, $subscriptionSid, $type ) { parent::__construct($version); // Path Solution $this->solution = [ 'subscriptionSid' => $subscriptionSid, 'type' => $type, ]; $this->uri = '/Subscriptions/' . \rawurlencode($subscriptionSid) .'/SubscribedEvents/' . \rawurlencode($type) .''; } /** * Delete the SubscribedEventInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SubscribedEventInstance * * @return SubscribedEventInstance Fetched SubscribedEventInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SubscribedEventInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SubscribedEventInstance( $this->version, $payload, $this->solution['subscriptionSid'], $this->solution['type'] ); } /** * Update the SubscribedEventInstance * * @param array|Options $options Optional Arguments * @return SubscribedEventInstance Updated SubscribedEventInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SubscribedEventInstance { $options = new Values($options); $data = Values::of([ 'SchemaVersion' => $options['schemaVersion'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SubscribedEventInstance( $this->version, $payload, $this->solution['subscriptionSid'], $this->solution['type'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Events.V1.SubscribedEventContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventInstance.php 0000644 00000010626 15021223077 0022007 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1\Subscription; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $type * @property int|null $schemaVersion * @property string|null $subscriptionSid * @property string|null $url */ class SubscribedEventInstance extends InstanceResource { /** * Initialize the SubscribedEventInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $subscriptionSid The unique SID identifier of the Subscription. * @param string $type Type of event being subscribed to. */ public function __construct(Version $version, array $payload, string $subscriptionSid, string $type = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'type' => Values::array_get($payload, 'type'), 'schemaVersion' => Values::array_get($payload, 'schema_version'), 'subscriptionSid' => Values::array_get($payload, 'subscription_sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['subscriptionSid' => $subscriptionSid, 'type' => $type ?: $this->properties['type'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SubscribedEventContext Context for this SubscribedEventInstance */ protected function proxy(): SubscribedEventContext { if (!$this->context) { $this->context = new SubscribedEventContext( $this->version, $this->solution['subscriptionSid'], $this->solution['type'] ); } return $this->context; } /** * Delete the SubscribedEventInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SubscribedEventInstance * * @return SubscribedEventInstance Fetched SubscribedEventInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SubscribedEventInstance { return $this->proxy()->fetch(); } /** * Update the SubscribedEventInstance * * @param array|Options $options Optional Arguments * @return SubscribedEventInstance Updated SubscribedEventInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SubscribedEventInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Events.V1.SubscribedEventInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventList.php 0000644 00000014612 15021223077 0021155 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1\Subscription; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SubscribedEventList extends ListResource { /** * Construct the SubscribedEventList * * @param Version $version Version that contains the resource * @param string $subscriptionSid The unique SID identifier of the Subscription. */ public function __construct( Version $version, string $subscriptionSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'subscriptionSid' => $subscriptionSid, ]; $this->uri = '/Subscriptions/' . \rawurlencode($subscriptionSid) .'/SubscribedEvents'; } /** * Create the SubscribedEventInstance * * @param string $type Type of event being subscribed to. * @param array|Options $options Optional Arguments * @return SubscribedEventInstance Created SubscribedEventInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): SubscribedEventInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'SchemaVersion' => $options['schemaVersion'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SubscribedEventInstance( $this->version, $payload, $this->solution['subscriptionSid'] ); } /** * Reads SubscribedEventInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SubscribedEventInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SubscribedEventInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SubscribedEventInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SubscribedEventPage Page of SubscribedEventInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SubscribedEventPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SubscribedEventPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SubscribedEventInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SubscribedEventPage Page of SubscribedEventInstance */ public function getPage(string $targetUrl): SubscribedEventPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SubscribedEventPage($this->version, $response, $this->solution); } /** * Constructs a SubscribedEventContext * * @param string $type Type of event being subscribed to. */ public function getContext( string $type ): SubscribedEventContext { return new SubscribedEventContext( $this->version, $this->solution['subscriptionSid'], $type ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SubscribedEventList]'; } } sdk/src/Twilio/Rest/Events/V1/Subscription/SubscribedEventOptions.php 0000644 00000006563 15021223077 0021703 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1\Subscription; use Twilio\Options; use Twilio\Values; abstract class SubscribedEventOptions { /** * @param int $schemaVersion The schema version that the Subscription should use. * @return CreateSubscribedEventOptions Options builder */ public static function create( int $schemaVersion = Values::INT_NONE ): CreateSubscribedEventOptions { return new CreateSubscribedEventOptions( $schemaVersion ); } /** * @param int $schemaVersion The schema version that the Subscription should use. * @return UpdateSubscribedEventOptions Options builder */ public static function update( int $schemaVersion = Values::INT_NONE ): UpdateSubscribedEventOptions { return new UpdateSubscribedEventOptions( $schemaVersion ); } } class CreateSubscribedEventOptions extends Options { /** * @param int $schemaVersion The schema version that the Subscription should use. */ public function __construct( int $schemaVersion = Values::INT_NONE ) { $this->options['schemaVersion'] = $schemaVersion; } /** * The schema version that the Subscription should use. * * @param int $schemaVersion The schema version that the Subscription should use. * @return $this Fluent Builder */ public function setSchemaVersion(int $schemaVersion): self { $this->options['schemaVersion'] = $schemaVersion; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Events.V1.CreateSubscribedEventOptions ' . $options . ']'; } } class UpdateSubscribedEventOptions extends Options { /** * @param int $schemaVersion The schema version that the Subscription should use. */ public function __construct( int $schemaVersion = Values::INT_NONE ) { $this->options['schemaVersion'] = $schemaVersion; } /** * The schema version that the Subscription should use. * * @param int $schemaVersion The schema version that the Subscription should use. * @return $this Fluent Builder */ public function setSchemaVersion(int $schemaVersion): self { $this->options['schemaVersion'] = $schemaVersion; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Events.V1.UpdateSubscribedEventOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Events/V1/SchemaList.php 0000644 00000002750 15021223077 0014602 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\ListResource; use Twilio\Version; class SchemaList extends ListResource { /** * Construct the SchemaList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a SchemaContext * * @param string $id The unique identifier of the schema. Each schema can have multiple versions, that share the same id. */ public function getContext( string $id ): SchemaContext { return new SchemaContext( $this->version, $id ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SchemaList]'; } } sdk/src/Twilio/Rest/Events/V1/EventTypeOptions.php 0000644 00000004051 15021223077 0016041 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Options; use Twilio\Values; abstract class EventTypeOptions { /** * @param string $schemaId A string parameter filtering the results to return only the Event Types using a given schema. * @return ReadEventTypeOptions Options builder */ public static function read( string $schemaId = Values::NONE ): ReadEventTypeOptions { return new ReadEventTypeOptions( $schemaId ); } } class ReadEventTypeOptions extends Options { /** * @param string $schemaId A string parameter filtering the results to return only the Event Types using a given schema. */ public function __construct( string $schemaId = Values::NONE ) { $this->options['schemaId'] = $schemaId; } /** * A string parameter filtering the results to return only the Event Types using a given schema. * * @param string $schemaId A string parameter filtering the results to return only the Event Types using a given schema. * @return $this Fluent Builder */ public function setSchemaId(string $schemaId): self { $this->options['schemaId'] = $schemaId; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Events.V1.ReadEventTypeOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Events/V1/SubscriptionContext.php 0000644 00000011472 15021223077 0016600 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Events\V1\Subscription\SubscribedEventList; /** * @property SubscribedEventList $subscribedEvents * @method \Twilio\Rest\Events\V1\Subscription\SubscribedEventContext subscribedEvents(string $type) */ class SubscriptionContext extends InstanceContext { protected $_subscribedEvents; /** * Initialize the SubscriptionContext * * @param Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies this Subscription. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Subscriptions/' . \rawurlencode($sid) .''; } /** * Delete the SubscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SubscriptionInstance * * @return SubscriptionInstance Fetched SubscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SubscriptionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SubscriptionInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the SubscriptionInstance * * @param array|Options $options Optional Arguments * @return SubscriptionInstance Updated SubscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SubscriptionInstance { $options = new Values($options); $data = Values::of([ 'Description' => $options['description'], 'SinkSid' => $options['sinkSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SubscriptionInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the subscribedEvents */ protected function getSubscribedEvents(): SubscribedEventList { if (!$this->_subscribedEvents) { $this->_subscribedEvents = new SubscribedEventList( $this->version, $this->solution['sid'] ); } return $this->_subscribedEvents; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Events.V1.SubscriptionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Events/V1/SubscriptionList.php 0000644 00000015223 15021223077 0016065 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class SubscriptionList extends ListResource { /** * Construct the SubscriptionList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Subscriptions'; } /** * Create the SubscriptionInstance * * @param string $description A human readable description for the Subscription **This value should not contain PII.** * @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. * @param array[] $types An array of objects containing the subscribed Event Types * @return SubscriptionInstance Created SubscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $description, string $sinkSid, array $types): SubscriptionInstance { $data = Values::of([ 'Description' => $description, 'SinkSid' => $sinkSid, 'Types' => Serialize::map($types,function ($e) { return Serialize::jsonObject($e); }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SubscriptionInstance( $this->version, $payload ); } /** * Reads SubscriptionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SubscriptionInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SubscriptionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SubscriptionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SubscriptionPage Page of SubscriptionInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SubscriptionPage { $options = new Values($options); $params = Values::of([ 'SinkSid' => $options['sinkSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SubscriptionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SubscriptionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SubscriptionPage Page of SubscriptionInstance */ public function getPage(string $targetUrl): SubscriptionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SubscriptionPage($this->version, $response, $this->solution); } /** * Constructs a SubscriptionContext * * @param string $sid A 34 character string that uniquely identifies this Subscription. */ public function getContext( string $sid ): SubscriptionContext { return new SubscriptionContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SubscriptionList]'; } } sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionContext.php 0000644 00000004427 15021223077 0020064 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1\Schema; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class SchemaVersionContext extends InstanceContext { /** * Initialize the SchemaVersionContext * * @param Version $version Version that contains the resource * @param string $id The unique identifier of the schema. Each schema can have multiple versions, that share the same id. * @param int $schemaVersion The version of the schema */ public function __construct( Version $version, $id, $schemaVersion ) { parent::__construct($version); // Path Solution $this->solution = [ 'id' => $id, 'schemaVersion' => $schemaVersion, ]; $this->uri = '/Schemas/' . \rawurlencode($id) .'/Versions/' . \rawurlencode($schemaVersion) .''; } /** * Fetch the SchemaVersionInstance * * @return SchemaVersionInstance Fetched SchemaVersionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SchemaVersionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SchemaVersionInstance( $this->version, $payload, $this->solution['id'], $this->solution['schemaVersion'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Events.V1.SchemaVersionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionPage.php 0000644 00000003123 15021223077 0017304 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1\Schema; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SchemaVersionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SchemaVersionInstance \Twilio\Rest\Events\V1\Schema\SchemaVersionInstance */ public function buildInstance(array $payload): SchemaVersionInstance { return new SchemaVersionInstance($this->version, $payload, $this->solution['id']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SchemaVersionPage]'; } } sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionList.php 0000644 00000012675 15021223077 0017357 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1\Schema; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SchemaVersionList extends ListResource { /** * Construct the SchemaVersionList * * @param Version $version Version that contains the resource * @param string $id The unique identifier of the schema. Each schema can have multiple versions, that share the same id. */ public function __construct( Version $version, string $id ) { parent::__construct($version); // Path Solution $this->solution = [ 'id' => $id, ]; $this->uri = '/Schemas/' . \rawurlencode($id) .'/Versions'; } /** * Reads SchemaVersionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SchemaVersionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SchemaVersionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SchemaVersionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SchemaVersionPage Page of SchemaVersionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SchemaVersionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SchemaVersionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SchemaVersionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SchemaVersionPage Page of SchemaVersionInstance */ public function getPage(string $targetUrl): SchemaVersionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SchemaVersionPage($this->version, $response, $this->solution); } /** * Constructs a SchemaVersionContext * * @param int $schemaVersion The version of the schema */ public function getContext( int $schemaVersion ): SchemaVersionContext { return new SchemaVersionContext( $this->version, $this->solution['id'], $schemaVersion ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SchemaVersionList]'; } } sdk/src/Twilio/Rest/Events/V1/Schema/SchemaVersionInstance.php 0000644 00000007370 15021223077 0020204 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1\Schema; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $id * @property int|null $schemaVersion * @property \DateTime|null $dateCreated * @property string|null $url * @property string|null $raw */ class SchemaVersionInstance extends InstanceResource { /** * Initialize the SchemaVersionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $id The unique identifier of the schema. Each schema can have multiple versions, that share the same id. * @param int $schemaVersion The version of the schema */ public function __construct(Version $version, array $payload, string $id, int $schemaVersion = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'id' => Values::array_get($payload, 'id'), 'schemaVersion' => Values::array_get($payload, 'schema_version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), 'raw' => Values::array_get($payload, 'raw'), ]; $this->solution = ['id' => $id, 'schemaVersion' => $schemaVersion ?: $this->properties['schemaVersion'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SchemaVersionContext Context for this SchemaVersionInstance */ protected function proxy(): SchemaVersionContext { if (!$this->context) { $this->context = new SchemaVersionContext( $this->version, $this->solution['id'], $this->solution['schemaVersion'] ); } return $this->context; } /** * Fetch the SchemaVersionInstance * * @return SchemaVersionInstance Fetched SchemaVersionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SchemaVersionInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Events.V1.SchemaVersionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Events/V1/SubscriptionOptions.php 0000644 00000010424 15021223077 0016603 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Options; use Twilio\Values; abstract class SubscriptionOptions { /** * @param string $sinkSid The SID of the sink that the list of Subscriptions should be filtered by. * @return ReadSubscriptionOptions Options builder */ public static function read( string $sinkSid = Values::NONE ): ReadSubscriptionOptions { return new ReadSubscriptionOptions( $sinkSid ); } /** * @param string $description A human readable description for the Subscription. * @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. * @return UpdateSubscriptionOptions Options builder */ public static function update( string $description = Values::NONE, string $sinkSid = Values::NONE ): UpdateSubscriptionOptions { return new UpdateSubscriptionOptions( $description, $sinkSid ); } } class ReadSubscriptionOptions extends Options { /** * @param string $sinkSid The SID of the sink that the list of Subscriptions should be filtered by. */ public function __construct( string $sinkSid = Values::NONE ) { $this->options['sinkSid'] = $sinkSid; } /** * The SID of the sink that the list of Subscriptions should be filtered by. * * @param string $sinkSid The SID of the sink that the list of Subscriptions should be filtered by. * @return $this Fluent Builder */ public function setSinkSid(string $sinkSid): self { $this->options['sinkSid'] = $sinkSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Events.V1.ReadSubscriptionOptions ' . $options . ']'; } } class UpdateSubscriptionOptions extends Options { /** * @param string $description A human readable description for the Subscription. * @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. */ public function __construct( string $description = Values::NONE, string $sinkSid = Values::NONE ) { $this->options['description'] = $description; $this->options['sinkSid'] = $sinkSid; } /** * A human readable description for the Subscription. * * @param string $description A human readable description for the Subscription. * @return $this Fluent Builder */ public function setDescription(string $description): self { $this->options['description'] = $description; return $this; } /** * The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. * * @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. * @return $this Fluent Builder */ public function setSinkSid(string $sinkSid): self { $this->options['sinkSid'] = $sinkSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Events.V1.UpdateSubscriptionOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Events/V1/EventTypeContext.php 0000644 00000003732 15021223077 0016037 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class EventTypeContext extends InstanceContext { /** * Initialize the EventTypeContext * * @param Version $version Version that contains the resource * @param string $type A string that uniquely identifies this Event Type. */ public function __construct( Version $version, $type ) { parent::__construct($version); // Path Solution $this->solution = [ 'type' => $type, ]; $this->uri = '/Types/' . \rawurlencode($type) .''; } /** * Fetch the EventTypeInstance * * @return EventTypeInstance Fetched EventTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EventTypeInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new EventTypeInstance( $this->version, $payload, $this->solution['type'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Events.V1.EventTypeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Events/V1/EventTypePage.php 0000644 00000003026 15021223077 0015263 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EventTypePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return EventTypeInstance \Twilio\Rest\Events\V1\EventTypeInstance */ public function buildInstance(array $payload): EventTypeInstance { return new EventTypeInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.EventTypePage]'; } } sdk/src/Twilio/Rest/Events/V1/SchemaInstance.php 0000644 00000007413 15021223077 0015434 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Events\V1\Schema\SchemaVersionList; /** * @property string|null $id * @property string|null $url * @property array|null $links * @property \DateTime|null $latestVersionDateCreated * @property int|null $latestVersion */ class SchemaInstance extends InstanceResource { protected $_versions; /** * Initialize the SchemaInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $id The unique identifier of the schema. Each schema can have multiple versions, that share the same id. */ public function __construct(Version $version, array $payload, string $id = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'id' => Values::array_get($payload, 'id'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'latestVersionDateCreated' => Deserialize::dateTime(Values::array_get($payload, 'latest_version_date_created')), 'latestVersion' => Values::array_get($payload, 'latest_version'), ]; $this->solution = ['id' => $id ?: $this->properties['id'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SchemaContext Context for this SchemaInstance */ protected function proxy(): SchemaContext { if (!$this->context) { $this->context = new SchemaContext( $this->version, $this->solution['id'] ); } return $this->context; } /** * Fetch the SchemaInstance * * @return SchemaInstance Fetched SchemaInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SchemaInstance { return $this->proxy()->fetch(); } /** * Access the versions */ protected function getVersions(): SchemaVersionList { return $this->proxy()->versions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Events.V1.SchemaInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Events/V1/SinkOptions.php 0000644 00000005522 15021223077 0015026 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Options; use Twilio\Values; abstract class SinkOptions { /** * @param bool $inUse A boolean query parameter filtering the results to return sinks used/not used by a subscription. * @param string $status A String query parameter filtering the results by status `initialized`, `validating`, `active` or `failed`. * @return ReadSinkOptions Options builder */ public static function read( bool $inUse = Values::BOOL_NONE, string $status = Values::NONE ): ReadSinkOptions { return new ReadSinkOptions( $inUse, $status ); } } class ReadSinkOptions extends Options { /** * @param bool $inUse A boolean query parameter filtering the results to return sinks used/not used by a subscription. * @param string $status A String query parameter filtering the results by status `initialized`, `validating`, `active` or `failed`. */ public function __construct( bool $inUse = Values::BOOL_NONE, string $status = Values::NONE ) { $this->options['inUse'] = $inUse; $this->options['status'] = $status; } /** * A boolean query parameter filtering the results to return sinks used/not used by a subscription. * * @param bool $inUse A boolean query parameter filtering the results to return sinks used/not used by a subscription. * @return $this Fluent Builder */ public function setInUse(bool $inUse): self { $this->options['inUse'] = $inUse; return $this; } /** * A String query parameter filtering the results by status `initialized`, `validating`, `active` or `failed`. * * @param string $status A String query parameter filtering the results by status `initialized`, `validating`, `active` or `failed`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Events.V1.ReadSinkOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Events/V1/Sink/SinkValidateList.php 0000644 00000004152 15021223077 0016662 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1\Sink; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class SinkValidateList extends ListResource { /** * Construct the SinkValidateList * * @param Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies the Sink being validated. */ public function __construct( Version $version, string $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Sinks/' . \rawurlencode($sid) .'/Validate'; } /** * Create the SinkValidateInstance * * @param string $testId A 34 character string that uniquely identifies the test event for a Sink being validated. * @return SinkValidateInstance Created SinkValidateInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $testId): SinkValidateInstance { $data = Values::of([ 'TestId' => $testId, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SinkValidateInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SinkValidateList]'; } } sdk/src/Twilio/Rest/Events/V1/Sink/SinkTestPage.php 0000644 00000003062 15021223077 0016010 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1\Sink; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SinkTestPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SinkTestInstance \Twilio\Rest\Events\V1\Sink\SinkTestInstance */ public function buildInstance(array $payload): SinkTestInstance { return new SinkTestInstance($this->version, $payload, $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SinkTestPage]'; } } sdk/src/Twilio/Rest/Events/V1/Sink/SinkTestList.php 0000644 00000003515 15021223077 0016052 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1\Sink; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; class SinkTestList extends ListResource { /** * Construct the SinkTestList * * @param Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies the Sink to be Tested. */ public function __construct( Version $version, string $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Sinks/' . \rawurlencode($sid) .'/Test'; } /** * Create the SinkTestInstance * * @return SinkTestInstance Created SinkTestInstance * @throws TwilioException When an HTTP error occurs. */ public function create(): SinkTestInstance { $payload = $this->version->create('POST', $this->uri, [], []); return new SinkTestInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SinkTestList]'; } } sdk/src/Twilio/Rest/Events/V1/Sink/SinkValidateInstance.php 0000644 00000004163 15021223077 0017515 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1\Sink; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $result */ class SinkValidateInstance extends InstanceResource { /** * Initialize the SinkValidateInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies the Sink being validated. */ public function __construct(Version $version, array $payload, string $sid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'result' => Values::array_get($payload, 'result'), ]; $this->solution = ['sid' => $sid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SinkValidateInstance]'; } } sdk/src/Twilio/Rest/Events/V1/Sink/SinkValidatePage.php 0000644 00000003112 15021223077 0016616 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1\Sink; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SinkValidatePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SinkValidateInstance \Twilio\Rest\Events\V1\Sink\SinkValidateInstance */ public function buildInstance(array $payload): SinkValidateInstance { return new SinkValidateInstance($this->version, $payload, $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SinkValidatePage]'; } } sdk/src/Twilio/Rest/Events/V1/Sink/SinkTestInstance.php 0000644 00000004144 15021223077 0016702 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1\Sink; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $result */ class SinkTestInstance extends InstanceResource { /** * Initialize the SinkTestInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies the Sink to be Tested. */ public function __construct(Version $version, array $payload, string $sid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'result' => Values::array_get($payload, 'result'), ]; $this->solution = ['sid' => $sid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SinkTestInstance]'; } } sdk/src/Twilio/Rest/Events/V1/EventTypeList.php 0000644 00000012652 15021223077 0015327 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class EventTypeList extends ListResource { /** * Construct the EventTypeList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Types'; } /** * Reads EventTypeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EventTypeInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams EventTypeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EventTypeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EventTypePage Page of EventTypeInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EventTypePage { $options = new Values($options); $params = Values::of([ 'SchemaId' => $options['schemaId'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EventTypePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EventTypeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EventTypePage Page of EventTypeInstance */ public function getPage(string $targetUrl): EventTypePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EventTypePage($this->version, $response, $this->solution); } /** * Constructs a EventTypeContext * * @param string $type A string that uniquely identifies this Event Type. */ public function getContext( string $type ): EventTypeContext { return new EventTypeContext( $this->version, $type ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.EventTypeList]'; } } sdk/src/Twilio/Rest/Events/V1/SubscriptionInstance.php 0000644 00000011444 15021223077 0016717 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Events\V1\Subscription\SubscribedEventList; /** * @property string|null $accountSid * @property string|null $sid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $description * @property string|null $sinkSid * @property string|null $url * @property array|null $links */ class SubscriptionInstance extends InstanceResource { protected $_subscribedEvents; /** * Initialize the SubscriptionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies this Subscription. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'description' => Values::array_get($payload, 'description'), 'sinkSid' => Values::array_get($payload, 'sink_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SubscriptionContext Context for this SubscriptionInstance */ protected function proxy(): SubscriptionContext { if (!$this->context) { $this->context = new SubscriptionContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the SubscriptionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SubscriptionInstance * * @return SubscriptionInstance Fetched SubscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SubscriptionInstance { return $this->proxy()->fetch(); } /** * Update the SubscriptionInstance * * @param array|Options $options Optional Arguments * @return SubscriptionInstance Updated SubscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SubscriptionInstance { return $this->proxy()->update($options); } /** * Access the subscribedEvents */ protected function getSubscribedEvents(): SubscribedEventList { return $this->proxy()->subscribedEvents; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Events.V1.SubscriptionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Events/V1/EventTypeInstance.php 0000644 00000007350 15021223077 0016157 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $type * @property string|null $schemaId * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $description * @property string|null $url * @property array|null $links */ class EventTypeInstance extends InstanceResource { /** * Initialize the EventTypeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $type A string that uniquely identifies this Event Type. */ public function __construct(Version $version, array $payload, string $type = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'type' => Values::array_get($payload, 'type'), 'schemaId' => Values::array_get($payload, 'schema_id'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'description' => Values::array_get($payload, 'description'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['type' => $type ?: $this->properties['type'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EventTypeContext Context for this EventTypeInstance */ protected function proxy(): EventTypeContext { if (!$this->context) { $this->context = new EventTypeContext( $this->version, $this->solution['type'] ); } return $this->context; } /** * Fetch the EventTypeInstance * * @return EventTypeInstance Fetched EventTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EventTypeInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Events.V1.EventTypeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Events/V1/SinkPage.php 0000644 00000002770 15021223077 0014251 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SinkPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SinkInstance \Twilio\Rest\Events\V1\SinkInstance */ public function buildInstance(array $payload): SinkInstance { return new SinkInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SinkPage]'; } } sdk/src/Twilio/Rest/Events/V1/SinkList.php 0000644 00000014646 15021223077 0014315 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class SinkList extends ListResource { /** * Construct the SinkList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Sinks'; } /** * Create the SinkInstance * * @param string $description A human readable description for the Sink **This value should not contain PII.** * @param array $sinkConfiguration The information required for Twilio to connect to the provided Sink encoded as JSON. * @param string $sinkType * @return SinkInstance Created SinkInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $description, array $sinkConfiguration, string $sinkType): SinkInstance { $data = Values::of([ 'Description' => $description, 'SinkConfiguration' => Serialize::jsonObject($sinkConfiguration), 'SinkType' => $sinkType, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SinkInstance( $this->version, $payload ); } /** * Reads SinkInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SinkInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams SinkInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SinkInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SinkPage Page of SinkInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SinkPage { $options = new Values($options); $params = Values::of([ 'InUse' => Serialize::booleanToString($options['inUse']), 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SinkPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SinkInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SinkPage Page of SinkInstance */ public function getPage(string $targetUrl): SinkPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SinkPage($this->version, $response, $this->solution); } /** * Constructs a SinkContext * * @param string $sid A 34 character string that uniquely identifies this Sink. */ public function getContext( string $sid ): SinkContext { return new SinkContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SinkList]'; } } sdk/src/Twilio/Rest/Events/V1/SchemaPage.php 0000644 00000003004 15021223077 0014534 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SchemaPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SchemaInstance \Twilio\Rest\Events\V1\SchemaInstance */ public function buildInstance(array $payload): SchemaInstance { return new SchemaInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1.SchemaPage]'; } } sdk/src/Twilio/Rest/Events/V1/SchemaContext.php 0000644 00000007226 15021223077 0015316 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Events\V1\Schema\SchemaVersionList; /** * @property SchemaVersionList $versions * @method \Twilio\Rest\Events\V1\Schema\SchemaVersionContext versions(string $schemaVersion) */ class SchemaContext extends InstanceContext { protected $_versions; /** * Initialize the SchemaContext * * @param Version $version Version that contains the resource * @param string $id The unique identifier of the schema. Each schema can have multiple versions, that share the same id. */ public function __construct( Version $version, $id ) { parent::__construct($version); // Path Solution $this->solution = [ 'id' => $id, ]; $this->uri = '/Schemas/' . \rawurlencode($id) .''; } /** * Fetch the SchemaInstance * * @return SchemaInstance Fetched SchemaInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SchemaInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SchemaInstance( $this->version, $payload, $this->solution['id'] ); } /** * Access the versions */ protected function getVersions(): SchemaVersionList { if (!$this->_versions) { $this->_versions = new SchemaVersionList( $this->version, $this->solution['id'] ); } return $this->_versions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Events.V1.SchemaContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Events/V1/SinkInstance.php 0000644 00000011761 15021223077 0015141 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Events\V1\Sink\SinkTestList; use Twilio\Rest\Events\V1\Sink\SinkValidateList; /** * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $description * @property string|null $sid * @property array|null $sinkConfiguration * @property string $sinkType * @property string $status * @property string|null $url * @property array|null $links */ class SinkInstance extends InstanceResource { protected $_sinkTest; protected $_sinkValidate; /** * Initialize the SinkInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies this Sink. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'description' => Values::array_get($payload, 'description'), 'sid' => Values::array_get($payload, 'sid'), 'sinkConfiguration' => Values::array_get($payload, 'sink_configuration'), 'sinkType' => Values::array_get($payload, 'sink_type'), 'status' => Values::array_get($payload, 'status'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SinkContext Context for this SinkInstance */ protected function proxy(): SinkContext { if (!$this->context) { $this->context = new SinkContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the SinkInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SinkInstance * * @return SinkInstance Fetched SinkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SinkInstance { return $this->proxy()->fetch(); } /** * Update the SinkInstance * * @param string $description A human readable description for the Sink **This value should not contain PII.** * @return SinkInstance Updated SinkInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $description): SinkInstance { return $this->proxy()->update($description); } /** * Access the sinkTest */ protected function getSinkTest(): SinkTestList { return $this->proxy()->sinkTest; } /** * Access the sinkValidate */ protected function getSinkValidate(): SinkValidateList { return $this->proxy()->sinkValidate; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Events.V1.SinkInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Events/V1.php 0000644 00000007240 15021223077 0012545 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Events * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Events; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Events\V1\EventTypeList; use Twilio\Rest\Events\V1\SchemaList; use Twilio\Rest\Events\V1\SinkList; use Twilio\Rest\Events\V1\SubscriptionList; use Twilio\Version; /** * @property EventTypeList $eventTypes * @property SchemaList $schemas * @property SinkList $sinks * @property SubscriptionList $subscriptions * @method \Twilio\Rest\Events\V1\EventTypeContext eventTypes(string $type) * @method \Twilio\Rest\Events\V1\SchemaContext schemas(string $id) * @method \Twilio\Rest\Events\V1\SinkContext sinks(string $sid) * @method \Twilio\Rest\Events\V1\SubscriptionContext subscriptions(string $sid) */ class V1 extends Version { protected $_eventTypes; protected $_schemas; protected $_sinks; protected $_subscriptions; /** * Construct the V1 version of Events * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getEventTypes(): EventTypeList { if (!$this->_eventTypes) { $this->_eventTypes = new EventTypeList($this); } return $this->_eventTypes; } protected function getSchemas(): SchemaList { if (!$this->_schemas) { $this->_schemas = new SchemaList($this); } return $this->_schemas; } protected function getSinks(): SinkList { if (!$this->_sinks) { $this->_sinks = new SinkList($this); } return $this->_sinks; } protected function getSubscriptions(): SubscriptionList { if (!$this->_subscriptions) { $this->_subscriptions = new SubscriptionList($this); } return $this->_subscriptions; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Events.V1]'; } } sdk/src/Twilio/Rest/Conversations/V1/UserOptions.php 0000644 00000023532 15021223077 0016432 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $friendlyName The string that you assigned to describe the resource. * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateUserOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateUserOptions { return new CreateUserOptions( $friendlyName, $attributes, $roleSid, $xTwilioWebhookEnabled ); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return DeleteUserOptions Options builder */ public static function delete( string $xTwilioWebhookEnabled = Values::NONE ): DeleteUserOptions { return new DeleteUserOptions( $xTwilioWebhookEnabled ); } /** * @param string $friendlyName The string that you assigned to describe the resource. * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateUserOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateUserOptions { return new UpdateUserOptions( $friendlyName, $attributes, $roleSid, $xTwilioWebhookEnabled ); } } class CreateUserOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the resource. * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; $this->options['roleSid'] = $roleSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateUserOptions ' . $options . ']'; } } class DeleteUserOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteUserOptions ' . $options . ']'; } } class UpdateUserOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the resource. * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; $this->options['roleSid'] = $roleSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/UserContext.php 0000644 00000012305 15021223077 0016417 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Conversations\V1\User\UserConversationList; /** * @property UserConversationList $userConversations * @method \Twilio\Rest\Conversations\V1\User\UserConversationContext userConversations(string $conversationSid) */ class UserContext extends InstanceContext { protected $_userConversations; /** * Initialize the UserContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Users/' . \rawurlencode($sid) .''; } /** * Delete the UserInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'Attributes' => $options['attributes'], 'RoleSid' => $options['roleSid'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new UserInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the userConversations */ protected function getUserConversations(): UserConversationList { if (!$this->_userConversations) { $this->_userConversations = new UserConversationList( $this->version, $this->solution['sid'] ); } return $this->_userConversations; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.UserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationList.php 0000644 00000017212 15021223077 0021107 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class AddressConfigurationList extends ListResource { /** * Construct the AddressConfigurationList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Configuration/Addresses'; } /** * Create the AddressConfigurationInstance * * @param string $type * @param string $address The unique address to be configured. The address can be a whatsapp address or phone number * @param array|Options $options Optional Arguments * @return AddressConfigurationInstance Created AddressConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, string $address, array $options = []): AddressConfigurationInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'Address' => $address, 'FriendlyName' => $options['friendlyName'], 'AutoCreation.Enabled' => Serialize::booleanToString($options['autoCreationEnabled']), 'AutoCreation.Type' => $options['autoCreationType'], 'AutoCreation.ConversationServiceSid' => $options['autoCreationConversationServiceSid'], 'AutoCreation.WebhookUrl' => $options['autoCreationWebhookUrl'], 'AutoCreation.WebhookMethod' => $options['autoCreationWebhookMethod'], 'AutoCreation.WebhookFilters' => Serialize::map($options['autoCreationWebhookFilters'], function ($e) { return $e; }), 'AutoCreation.StudioFlowSid' => $options['autoCreationStudioFlowSid'], 'AutoCreation.StudioRetryCount' => $options['autoCreationStudioRetryCount'], 'AddressCountry' => $options['addressCountry'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AddressConfigurationInstance( $this->version, $payload ); } /** * Reads AddressConfigurationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AddressConfigurationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams AddressConfigurationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AddressConfigurationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AddressConfigurationPage Page of AddressConfigurationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AddressConfigurationPage { $options = new Values($options); $params = Values::of([ 'Type' => $options['type'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AddressConfigurationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AddressConfigurationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AddressConfigurationPage Page of AddressConfigurationInstance */ public function getPage(string $targetUrl): AddressConfigurationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AddressConfigurationPage($this->version, $response, $this->solution); } /** * Constructs a AddressConfigurationContext * * @param string $sid The SID of the Address Configuration resource. This value can be either the `sid` or the `address` of the configuration */ public function getContext( string $sid ): AddressConfigurationContext { return new AddressConfigurationContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.AddressConfigurationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/UserOptions.php 0000644 00000023542 15021223077 0020033 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $friendlyName The string that you assigned to describe the resource. * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateUserOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateUserOptions { return new CreateUserOptions( $friendlyName, $attributes, $roleSid, $xTwilioWebhookEnabled ); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return DeleteUserOptions Options builder */ public static function delete( string $xTwilioWebhookEnabled = Values::NONE ): DeleteUserOptions { return new DeleteUserOptions( $xTwilioWebhookEnabled ); } /** * @param string $friendlyName The string that you assigned to describe the resource. * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateUserOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateUserOptions { return new UpdateUserOptions( $friendlyName, $attributes, $roleSid, $xTwilioWebhookEnabled ); } } class CreateUserOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the resource. * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; $this->options['roleSid'] = $roleSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateUserOptions ' . $options . ']'; } } class DeleteUserOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteUserOptions ' . $options . ']'; } } class UpdateUserOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the resource. * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; $this->options['roleSid'] = $roleSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/UserContext.php 0000644 00000013250 15021223077 0020017 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Conversations\V1\Service\User\UserConversationList; /** * @property UserConversationList $userConversations * @method \Twilio\Rest\Conversations\V1\Service\User\UserConversationContext userConversations(string $conversationSid) */ class UserContext extends InstanceContext { protected $_userConversations; /** * Initialize the UserContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the User resource is associated with. * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. */ public function __construct( Version $version, $chatServiceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Users/' . \rawurlencode($sid) .''; } /** * Delete the UserInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['sid'] ); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'Attributes' => $options['attributes'], 'RoleSid' => $options['roleSid'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new UserInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['sid'] ); } /** * Access the userConversations */ protected function getUserConversations(): UserConversationList { if (!$this->_userConversations) { $this->_userConversations = new UserConversationList( $this->version, $this->solution['chatServiceSid'], $this->solution['sid'] ); } return $this->_userConversations; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.UserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationList.php 0000644 00000007670 15021223077 0021210 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Conversations\V1\Service\Configuration\NotificationList; use Twilio\Rest\Conversations\V1\Service\Configuration\WebhookList; /** * @property NotificationList $notifications * @property WebhookList $webhooks * @method \Twilio\Rest\Conversations\V1\Service\Configuration\NotificationContext notifications() * @method \Twilio\Rest\Conversations\V1\Service\Configuration\WebhookContext webhooks() */ class ConfigurationList extends ListResource { protected $_notifications = null; protected $_webhooks = null; /** * Construct the ConfigurationList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Service configuration resource to fetch. */ public function __construct( Version $version, string $chatServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, ]; } /** * Constructs a ConfigurationContext */ public function getContext( ): ConfigurationContext { return new ConfigurationContext( $this->version, $this->solution['chatServiceSid'] ); } /** * Access the notifications */ protected function getNotifications(): NotificationList { if (!$this->_notifications) { $this->_notifications = new NotificationList( $this->version, $this->solution['chatServiceSid'] ); } return $this->_notifications; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version, $this->solution['chatServiceSid'] ); } return $this->_webhooks; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ConfigurationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationPage.php 0000644 00000003271 15021223077 0023204 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ParticipantConversationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ParticipantConversationInstance \Twilio\Rest\Conversations\V1\Service\ParticipantConversationInstance */ public function buildInstance(array $payload): ParticipantConversationInstance { return new ParticipantConversationInstance($this->version, $payload, $this->solution['chatServiceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ParticipantConversationPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/BindingPage.php 0000644 00000003131 15021223077 0017700 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BindingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return BindingInstance \Twilio\Rest\Conversations\V1\Service\BindingInstance */ public function buildInstance(array $payload): BindingInstance { return new BindingInstance($this->version, $payload, $this->solution['chatServiceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.BindingPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/BindingInstance.php 0000644 00000011337 15021223077 0020577 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $credentialSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $endpoint * @property string|null $identity * @property string $bindingType * @property string[]|null $messageTypes * @property string|null $url */ class BindingInstance extends InstanceResource { /** * Initialize the BindingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to delete the Binding resource from. * @param string $sid The SID of the Binding resource to delete. */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'credentialSid' => Values::array_get($payload, 'credential_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endpoint' => Values::array_get($payload, 'endpoint'), 'identity' => Values::array_get($payload, 'identity'), 'bindingType' => Values::array_get($payload, 'binding_type'), 'messageTypes' => Values::array_get($payload, 'message_types'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BindingContext Context for this BindingInstance */ protected function proxy(): BindingContext { if (!$this->context) { $this->context = new BindingContext( $this->version, $this->solution['chatServiceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the BindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.BindingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationInstance.php 0000644 00000010567 15021223077 0024102 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $participantSid * @property string|null $participantUserSid * @property string|null $participantIdentity * @property array|null $participantMessagingBinding * @property string|null $conversationSid * @property string|null $conversationUniqueName * @property string|null $conversationFriendlyName * @property string|null $conversationAttributes * @property \DateTime|null $conversationDateCreated * @property \DateTime|null $conversationDateUpdated * @property string|null $conversationCreatedBy * @property string $conversationState * @property array|null $conversationTimers * @property array|null $links */ class ParticipantConversationInstance extends InstanceResource { /** * Initialize the ParticipantConversationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant Conversations resource is associated with. */ public function __construct(Version $version, array $payload, string $chatServiceSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'participantUserSid' => Values::array_get($payload, 'participant_user_sid'), 'participantIdentity' => Values::array_get($payload, 'participant_identity'), 'participantMessagingBinding' => Values::array_get($payload, 'participant_messaging_binding'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'conversationUniqueName' => Values::array_get($payload, 'conversation_unique_name'), 'conversationFriendlyName' => Values::array_get($payload, 'conversation_friendly_name'), 'conversationAttributes' => Values::array_get($payload, 'conversation_attributes'), 'conversationDateCreated' => Deserialize::dateTime(Values::array_get($payload, 'conversation_date_created')), 'conversationDateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'conversation_date_updated')), 'conversationCreatedBy' => Values::array_get($payload, 'conversation_created_by'), 'conversationState' => Values::array_get($payload, 'conversation_state'), 'conversationTimers' => Values::array_get($payload, 'conversation_timers'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ParticipantConversationInstance]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/RoleInstance.php 0000644 00000012267 15021223077 0020131 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $friendlyName * @property string $type * @property string[]|null $permissions * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to create the Role resource under. * @param string $sid The SID of the Role resource to delete. */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoleContext Context for this RoleInstance */ protected function proxy(): RoleContext { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['chatServiceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/RoleContext.php 0000644 00000007253 15021223077 0020010 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to create the Role resource under. * @param string $sid The SID of the Role resource to delete. */ public function __construct( Version $version, $chatServiceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Roles/' . \rawurlencode($sid) .''; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoleInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['sid'] ); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of([ 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.RoleContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationList.php 0000644 00000013414 15021223077 0023243 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ParticipantConversationList extends ListResource { /** * Construct the ParticipantConversationList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant Conversations resource is associated with. */ public function __construct( Version $version, string $chatServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/ParticipantConversations'; } /** * Reads ParticipantConversationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantConversationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ParticipantConversationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ParticipantConversationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ParticipantConversationPage Page of ParticipantConversationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ParticipantConversationPage { $options = new Values($options); $params = Values::of([ 'Identity' => $options['identity'], 'Address' => $options['address'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ParticipantConversationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantConversationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ParticipantConversationPage Page of ParticipantConversationInstance */ public function getPage(string $targetUrl): ParticipantConversationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantConversationPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ParticipantConversationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookInstance.php 0000644 00000010270 15021223077 0023425 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $preWebhookUrl * @property string|null $postWebhookUrl * @property string[]|null $filters * @property string $method * @property string|null $url */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. */ public function __construct(Version $version, array $payload, string $chatServiceSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'filters' => Values::array_get($payload, 'filters'), 'method' => Values::array_get($payload, 'method'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WebhookContext Context for this WebhookInstance */ protected function proxy(): WebhookContext { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['chatServiceSid'] ); } return $this->context; } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationInstance.php 0000644 00000010477 15021223077 0024466 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $chatServiceSid * @property array|null $newMessage * @property array|null $addedToConversation * @property array|null $removedFromConversation * @property bool|null $logEnabled * @property string|null $url */ class NotificationInstance extends InstanceResource { /** * Initialize the NotificationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Configuration applies to. */ public function __construct(Version $version, array $payload, string $chatServiceSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'newMessage' => Values::array_get($payload, 'new_message'), 'addedToConversation' => Values::array_get($payload, 'added_to_conversation'), 'removedFromConversation' => Values::array_get($payload, 'removed_from_conversation'), 'logEnabled' => Values::array_get($payload, 'log_enabled'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return NotificationContext Context for this NotificationInstance */ protected function proxy(): NotificationContext { if (!$this->context) { $this->context = new NotificationContext( $this->version, $this->solution['chatServiceSid'] ); } return $this->context; } /** * Fetch the NotificationInstance * * @return NotificationInstance Fetched NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NotificationInstance { return $this->proxy()->fetch(); } /** * Update the NotificationInstance * * @param array|Options $options Optional Arguments * @return NotificationInstance Updated NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): NotificationInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.NotificationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookContext.php 0000644 00000006175 15021223077 0023316 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. */ public function __construct( Version $version, $chatServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Configuration/Webhooks'; } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new WebhookInstance( $this->version, $payload, $this->solution['chatServiceSid'] ); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'PreWebhookUrl' => $options['preWebhookUrl'], 'PostWebhookUrl' => $options['postWebhookUrl'], 'Filters' => Serialize::map($options['filters'], function ($e) { return $e; }), 'Method' => $options['method'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['chatServiceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.WebhookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookOptions.php 0000644 00000014360 15021223077 0023320 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Options; use Twilio\Values; abstract class WebhookOptions { /** * @param string $preWebhookUrl The absolute url the pre-event webhook request should be sent to. * @param string $postWebhookUrl The absolute url the post-event webhook request should be sent to. * @param string[] $filters The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`, `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or `onConversationStateUpdated`. * @param string $method The HTTP method to be used when sending a webhook request. One of `GET` or `POST`. * @return UpdateWebhookOptions Options builder */ public static function update( string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, array $filters = Values::ARRAY_NONE, string $method = Values::NONE ): UpdateWebhookOptions { return new UpdateWebhookOptions( $preWebhookUrl, $postWebhookUrl, $filters, $method ); } } class UpdateWebhookOptions extends Options { /** * @param string $preWebhookUrl The absolute url the pre-event webhook request should be sent to. * @param string $postWebhookUrl The absolute url the post-event webhook request should be sent to. * @param string[] $filters The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`, `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or `onConversationStateUpdated`. * @param string $method The HTTP method to be used when sending a webhook request. One of `GET` or `POST`. */ public function __construct( string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, array $filters = Values::ARRAY_NONE, string $method = Values::NONE ) { $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['filters'] = $filters; $this->options['method'] = $method; } /** * The absolute url the pre-event webhook request should be sent to. * * @param string $preWebhookUrl The absolute url the pre-event webhook request should be sent to. * @return $this Fluent Builder */ public function setPreWebhookUrl(string $preWebhookUrl): self { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The absolute url the post-event webhook request should be sent to. * * @param string $postWebhookUrl The absolute url the post-event webhook request should be sent to. * @return $this Fluent Builder */ public function setPostWebhookUrl(string $postWebhookUrl): self { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`, `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or `onConversationStateUpdated`. * * @param string[] $filters The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`, `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or `onConversationStateUpdated`. * @return $this Fluent Builder */ public function setFilters(array $filters): self { $this->options['filters'] = $filters; return $this; } /** * The HTTP method to be used when sending a webhook request. One of `GET` or `POST`. * * @param string $method The HTTP method to be used when sending a webhook request. One of `GET` or `POST`. * @return $this Fluent Builder */ public function setMethod(string $method): self { $this->options['method'] = $method; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationContext.php 0000644 00000010411 15021223077 0024332 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class NotificationContext extends InstanceContext { /** * Initialize the NotificationContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Configuration applies to. */ public function __construct( Version $version, $chatServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Configuration/Notifications'; } /** * Fetch the NotificationInstance * * @return NotificationInstance Fetched NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): NotificationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new NotificationInstance( $this->version, $payload, $this->solution['chatServiceSid'] ); } /** * Update the NotificationInstance * * @param array|Options $options Optional Arguments * @return NotificationInstance Updated NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): NotificationInstance { $options = new Values($options); $data = Values::of([ 'LogEnabled' => Serialize::booleanToString($options['logEnabled']), 'NewMessage.Enabled' => Serialize::booleanToString($options['newMessageEnabled']), 'NewMessage.Template' => $options['newMessageTemplate'], 'NewMessage.Sound' => $options['newMessageSound'], 'NewMessage.BadgeCountEnabled' => Serialize::booleanToString($options['newMessageBadgeCountEnabled']), 'AddedToConversation.Enabled' => Serialize::booleanToString($options['addedToConversationEnabled']), 'AddedToConversation.Template' => $options['addedToConversationTemplate'], 'AddedToConversation.Sound' => $options['addedToConversationSound'], 'RemovedFromConversation.Enabled' => Serialize::booleanToString($options['removedFromConversationEnabled']), 'RemovedFromConversation.Template' => $options['removedFromConversationTemplate'], 'RemovedFromConversation.Sound' => $options['removedFromConversationSound'], 'NewMessage.WithMedia.Enabled' => Serialize::booleanToString($options['newMessageWithMediaEnabled']), 'NewMessage.WithMedia.Template' => $options['newMessageWithMediaTemplate'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new NotificationInstance( $this->version, $payload, $this->solution['chatServiceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.NotificationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookPage.php 0000644 00000003165 15021223077 0022542 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WebhookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return WebhookInstance \Twilio\Rest\Conversations\V1\Service\Configuration\WebhookInstance */ public function buildInstance(array $payload): WebhookInstance { return new WebhookInstance($this->version, $payload, $this->solution['chatServiceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.WebhookPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookList.php 0000644 00000003260 15021223077 0022575 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\ListResource; use Twilio\Version; class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. */ public function __construct( Version $version, string $chatServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, ]; } /** * Constructs a WebhookContext */ public function getContext( ): WebhookContext { return new WebhookContext( $this->version, $this->solution['chatServiceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.WebhookList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationOptions.php 0000644 00000037032 15021223077 0024351 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Options; use Twilio\Values; abstract class NotificationOptions { /** * @param bool $logEnabled Weather the notification logging is enabled. * @param bool $newMessageEnabled Whether to send a notification when a new message is added to a conversation. The default is `false`. * @param string $newMessageTemplate The template to use to create the notification text displayed when a new message is added to a conversation and `new_message.enabled` is `true`. * @param string $newMessageSound The name of the sound to play when a new message is added to a conversation and `new_message.enabled` is `true`. * @param bool $newMessageBadgeCountEnabled Whether the new message badge is enabled. The default is `false`. * @param bool $addedToConversationEnabled Whether to send a notification when a participant is added to a conversation. The default is `false`. * @param string $addedToConversationTemplate The template to use to create the notification text displayed when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. * @param string $addedToConversationSound The name of the sound to play when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. * @param bool $removedFromConversationEnabled Whether to send a notification to a user when they are removed from a conversation. The default is `false`. * @param string $removedFromConversationTemplate The template to use to create the notification text displayed to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. * @param string $removedFromConversationSound The name of the sound to play to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. * @param bool $newMessageWithMediaEnabled Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is `false`. * @param string $newMessageWithMediaTemplate The template to use to create the notification text displayed when a new message with media/file attachments is added to a conversation and `new_message.attachments.enabled` is `true`. * @return UpdateNotificationOptions Options builder */ public static function update( bool $logEnabled = Values::BOOL_NONE, bool $newMessageEnabled = Values::BOOL_NONE, string $newMessageTemplate = Values::NONE, string $newMessageSound = Values::NONE, bool $newMessageBadgeCountEnabled = Values::BOOL_NONE, bool $addedToConversationEnabled = Values::BOOL_NONE, string $addedToConversationTemplate = Values::NONE, string $addedToConversationSound = Values::NONE, bool $removedFromConversationEnabled = Values::BOOL_NONE, string $removedFromConversationTemplate = Values::NONE, string $removedFromConversationSound = Values::NONE, bool $newMessageWithMediaEnabled = Values::BOOL_NONE, string $newMessageWithMediaTemplate = Values::NONE ): UpdateNotificationOptions { return new UpdateNotificationOptions( $logEnabled, $newMessageEnabled, $newMessageTemplate, $newMessageSound, $newMessageBadgeCountEnabled, $addedToConversationEnabled, $addedToConversationTemplate, $addedToConversationSound, $removedFromConversationEnabled, $removedFromConversationTemplate, $removedFromConversationSound, $newMessageWithMediaEnabled, $newMessageWithMediaTemplate ); } } class UpdateNotificationOptions extends Options { /** * @param bool $logEnabled Weather the notification logging is enabled. * @param bool $newMessageEnabled Whether to send a notification when a new message is added to a conversation. The default is `false`. * @param string $newMessageTemplate The template to use to create the notification text displayed when a new message is added to a conversation and `new_message.enabled` is `true`. * @param string $newMessageSound The name of the sound to play when a new message is added to a conversation and `new_message.enabled` is `true`. * @param bool $newMessageBadgeCountEnabled Whether the new message badge is enabled. The default is `false`. * @param bool $addedToConversationEnabled Whether to send a notification when a participant is added to a conversation. The default is `false`. * @param string $addedToConversationTemplate The template to use to create the notification text displayed when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. * @param string $addedToConversationSound The name of the sound to play when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. * @param bool $removedFromConversationEnabled Whether to send a notification to a user when they are removed from a conversation. The default is `false`. * @param string $removedFromConversationTemplate The template to use to create the notification text displayed to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. * @param string $removedFromConversationSound The name of the sound to play to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. * @param bool $newMessageWithMediaEnabled Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is `false`. * @param string $newMessageWithMediaTemplate The template to use to create the notification text displayed when a new message with media/file attachments is added to a conversation and `new_message.attachments.enabled` is `true`. */ public function __construct( bool $logEnabled = Values::BOOL_NONE, bool $newMessageEnabled = Values::BOOL_NONE, string $newMessageTemplate = Values::NONE, string $newMessageSound = Values::NONE, bool $newMessageBadgeCountEnabled = Values::BOOL_NONE, bool $addedToConversationEnabled = Values::BOOL_NONE, string $addedToConversationTemplate = Values::NONE, string $addedToConversationSound = Values::NONE, bool $removedFromConversationEnabled = Values::BOOL_NONE, string $removedFromConversationTemplate = Values::NONE, string $removedFromConversationSound = Values::NONE, bool $newMessageWithMediaEnabled = Values::BOOL_NONE, string $newMessageWithMediaTemplate = Values::NONE ) { $this->options['logEnabled'] = $logEnabled; $this->options['newMessageEnabled'] = $newMessageEnabled; $this->options['newMessageTemplate'] = $newMessageTemplate; $this->options['newMessageSound'] = $newMessageSound; $this->options['newMessageBadgeCountEnabled'] = $newMessageBadgeCountEnabled; $this->options['addedToConversationEnabled'] = $addedToConversationEnabled; $this->options['addedToConversationTemplate'] = $addedToConversationTemplate; $this->options['addedToConversationSound'] = $addedToConversationSound; $this->options['removedFromConversationEnabled'] = $removedFromConversationEnabled; $this->options['removedFromConversationTemplate'] = $removedFromConversationTemplate; $this->options['removedFromConversationSound'] = $removedFromConversationSound; $this->options['newMessageWithMediaEnabled'] = $newMessageWithMediaEnabled; $this->options['newMessageWithMediaTemplate'] = $newMessageWithMediaTemplate; } /** * Weather the notification logging is enabled. * * @param bool $logEnabled Weather the notification logging is enabled. * @return $this Fluent Builder */ public function setLogEnabled(bool $logEnabled): self { $this->options['logEnabled'] = $logEnabled; return $this; } /** * Whether to send a notification when a new message is added to a conversation. The default is `false`. * * @param bool $newMessageEnabled Whether to send a notification when a new message is added to a conversation. The default is `false`. * @return $this Fluent Builder */ public function setNewMessageEnabled(bool $newMessageEnabled): self { $this->options['newMessageEnabled'] = $newMessageEnabled; return $this; } /** * The template to use to create the notification text displayed when a new message is added to a conversation and `new_message.enabled` is `true`. * * @param string $newMessageTemplate The template to use to create the notification text displayed when a new message is added to a conversation and `new_message.enabled` is `true`. * @return $this Fluent Builder */ public function setNewMessageTemplate(string $newMessageTemplate): self { $this->options['newMessageTemplate'] = $newMessageTemplate; return $this; } /** * The name of the sound to play when a new message is added to a conversation and `new_message.enabled` is `true`. * * @param string $newMessageSound The name of the sound to play when a new message is added to a conversation and `new_message.enabled` is `true`. * @return $this Fluent Builder */ public function setNewMessageSound(string $newMessageSound): self { $this->options['newMessageSound'] = $newMessageSound; return $this; } /** * Whether the new message badge is enabled. The default is `false`. * * @param bool $newMessageBadgeCountEnabled Whether the new message badge is enabled. The default is `false`. * @return $this Fluent Builder */ public function setNewMessageBadgeCountEnabled(bool $newMessageBadgeCountEnabled): self { $this->options['newMessageBadgeCountEnabled'] = $newMessageBadgeCountEnabled; return $this; } /** * Whether to send a notification when a participant is added to a conversation. The default is `false`. * * @param bool $addedToConversationEnabled Whether to send a notification when a participant is added to a conversation. The default is `false`. * @return $this Fluent Builder */ public function setAddedToConversationEnabled(bool $addedToConversationEnabled): self { $this->options['addedToConversationEnabled'] = $addedToConversationEnabled; return $this; } /** * The template to use to create the notification text displayed when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. * * @param string $addedToConversationTemplate The template to use to create the notification text displayed when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. * @return $this Fluent Builder */ public function setAddedToConversationTemplate(string $addedToConversationTemplate): self { $this->options['addedToConversationTemplate'] = $addedToConversationTemplate; return $this; } /** * The name of the sound to play when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. * * @param string $addedToConversationSound The name of the sound to play when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. * @return $this Fluent Builder */ public function setAddedToConversationSound(string $addedToConversationSound): self { $this->options['addedToConversationSound'] = $addedToConversationSound; return $this; } /** * Whether to send a notification to a user when they are removed from a conversation. The default is `false`. * * @param bool $removedFromConversationEnabled Whether to send a notification to a user when they are removed from a conversation. The default is `false`. * @return $this Fluent Builder */ public function setRemovedFromConversationEnabled(bool $removedFromConversationEnabled): self { $this->options['removedFromConversationEnabled'] = $removedFromConversationEnabled; return $this; } /** * The template to use to create the notification text displayed to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. * * @param string $removedFromConversationTemplate The template to use to create the notification text displayed to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. * @return $this Fluent Builder */ public function setRemovedFromConversationTemplate(string $removedFromConversationTemplate): self { $this->options['removedFromConversationTemplate'] = $removedFromConversationTemplate; return $this; } /** * The name of the sound to play to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. * * @param string $removedFromConversationSound The name of the sound to play to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. * @return $this Fluent Builder */ public function setRemovedFromConversationSound(string $removedFromConversationSound): self { $this->options['removedFromConversationSound'] = $removedFromConversationSound; return $this; } /** * Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is `false`. * * @param bool $newMessageWithMediaEnabled Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is `false`. * @return $this Fluent Builder */ public function setNewMessageWithMediaEnabled(bool $newMessageWithMediaEnabled): self { $this->options['newMessageWithMediaEnabled'] = $newMessageWithMediaEnabled; return $this; } /** * The template to use to create the notification text displayed when a new message with media/file attachments is added to a conversation and `new_message.attachments.enabled` is `true`. * * @param string $newMessageWithMediaTemplate The template to use to create the notification text displayed when a new message with media/file attachments is added to a conversation and `new_message.attachments.enabled` is `true`. * @return $this Fluent Builder */ public function setNewMessageWithMediaTemplate(string $newMessageWithMediaTemplate): self { $this->options['newMessageWithMediaTemplate'] = $newMessageWithMediaTemplate; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateNotificationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationList.php 0000644 00000003310 15021223077 0023621 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\ListResource; use Twilio\Version; class NotificationList extends ListResource { /** * Construct the NotificationList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Configuration applies to. */ public function __construct( Version $version, string $chatServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, ]; } /** * Constructs a NotificationContext */ public function getContext( ): NotificationContext { return new NotificationContext( $this->version, $this->solution['chatServiceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.NotificationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationPage.php 0000644 00000003223 15021223077 0023565 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Configuration; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NotificationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return NotificationInstance \Twilio\Rest\Conversations\V1\Service\Configuration\NotificationInstance */ public function buildInstance(array $payload): NotificationInstance { return new NotificationInstance($this->version, $payload, $this->solution['chatServiceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.NotificationPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationOptions.php 0000644 00000015535 15021223077 0021727 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Options; use Twilio\Values; abstract class ConfigurationOptions { /** * @param string $defaultConversationCreatorRoleSid The conversation-level role assigned to a conversation creator when they join a new conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * @param string $defaultConversationRoleSid The conversation-level role assigned to users when they are added to a conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * @param string $defaultChatServiceRoleSid The service-level role assigned to users when they are added to the service. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * @param bool $reachabilityEnabled Whether the [Reachability Indicator](https://www.twilio.com/docs/conversations/reachability) is enabled for this Conversations Service. The default is `false`. * @return UpdateConfigurationOptions Options builder */ public static function update( string $defaultConversationCreatorRoleSid = Values::NONE, string $defaultConversationRoleSid = Values::NONE, string $defaultChatServiceRoleSid = Values::NONE, bool $reachabilityEnabled = Values::BOOL_NONE ): UpdateConfigurationOptions { return new UpdateConfigurationOptions( $defaultConversationCreatorRoleSid, $defaultConversationRoleSid, $defaultChatServiceRoleSid, $reachabilityEnabled ); } } class UpdateConfigurationOptions extends Options { /** * @param string $defaultConversationCreatorRoleSid The conversation-level role assigned to a conversation creator when they join a new conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * @param string $defaultConversationRoleSid The conversation-level role assigned to users when they are added to a conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * @param string $defaultChatServiceRoleSid The service-level role assigned to users when they are added to the service. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * @param bool $reachabilityEnabled Whether the [Reachability Indicator](https://www.twilio.com/docs/conversations/reachability) is enabled for this Conversations Service. The default is `false`. */ public function __construct( string $defaultConversationCreatorRoleSid = Values::NONE, string $defaultConversationRoleSid = Values::NONE, string $defaultChatServiceRoleSid = Values::NONE, bool $reachabilityEnabled = Values::BOOL_NONE ) { $this->options['defaultConversationCreatorRoleSid'] = $defaultConversationCreatorRoleSid; $this->options['defaultConversationRoleSid'] = $defaultConversationRoleSid; $this->options['defaultChatServiceRoleSid'] = $defaultChatServiceRoleSid; $this->options['reachabilityEnabled'] = $reachabilityEnabled; } /** * The conversation-level role assigned to a conversation creator when they join a new conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * * @param string $defaultConversationCreatorRoleSid The conversation-level role assigned to a conversation creator when they join a new conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * @return $this Fluent Builder */ public function setDefaultConversationCreatorRoleSid(string $defaultConversationCreatorRoleSid): self { $this->options['defaultConversationCreatorRoleSid'] = $defaultConversationCreatorRoleSid; return $this; } /** * The conversation-level role assigned to users when they are added to a conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * * @param string $defaultConversationRoleSid The conversation-level role assigned to users when they are added to a conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * @return $this Fluent Builder */ public function setDefaultConversationRoleSid(string $defaultConversationRoleSid): self { $this->options['defaultConversationRoleSid'] = $defaultConversationRoleSid; return $this; } /** * The service-level role assigned to users when they are added to the service. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * * @param string $defaultChatServiceRoleSid The service-level role assigned to users when they are added to the service. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. * @return $this Fluent Builder */ public function setDefaultChatServiceRoleSid(string $defaultChatServiceRoleSid): self { $this->options['defaultChatServiceRoleSid'] = $defaultChatServiceRoleSid; return $this; } /** * Whether the [Reachability Indicator](https://www.twilio.com/docs/conversations/reachability) is enabled for this Conversations Service. The default is `false`. * * @param bool $reachabilityEnabled Whether the [Reachability Indicator](https://www.twilio.com/docs/conversations/reachability) is enabled for this Conversations Service. The default is `false`. * @return $this Fluent Builder */ public function setReachabilityEnabled(bool $reachabilityEnabled): self { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateConfigurationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationInstance.php 0000644 00000014533 15021223077 0021700 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Conversations\V1\Service\Conversation\WebhookList; use Twilio\Rest\Conversations\V1\Service\Conversation\ParticipantList; use Twilio\Rest\Conversations\V1\Service\Conversation\MessageList; /** * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $messagingServiceSid * @property string|null $sid * @property string|null $friendlyName * @property string|null $uniqueName * @property string|null $attributes * @property string $state * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property array|null $timers * @property string|null $url * @property array|null $links * @property array|null $bindings */ class ConversationInstance extends InstanceResource { protected $_webhooks; protected $_participants; protected $_messages; /** * Initialize the ConversationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Conversation resource is associated with. * @param string $sid A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'state' => Values::array_get($payload, 'state'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'timers' => Values::array_get($payload, 'timers'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'bindings' => Values::array_get($payload, 'bindings'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ConversationContext Context for this ConversationInstance */ protected function proxy(): ConversationContext { if (!$this->context) { $this->context = new ConversationContext( $this->version, $this->solution['chatServiceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ConversationInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the ConversationInstance * * @return ConversationInstance Fetched ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConversationInstance { return $this->proxy()->fetch(); } /** * Update the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Updated ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConversationInstance { return $this->proxy()->update($options); } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Access the participants */ protected function getParticipants(): ParticipantList { return $this->proxy()->participants; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ConversationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageInstance.php 0000644 00000014355 15021223077 0023266 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Conversations\V1\Service\Conversation\Message\DeliveryReceiptList; /** * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $conversationSid * @property string|null $sid * @property int|null $index * @property string|null $author * @property string|null $body * @property array[]|null $media * @property string|null $attributes * @property string|null $participantSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property array|null $delivery * @property string|null $url * @property array|null $links * @property string|null $contentSid */ class MessageInstance extends InstanceResource { protected $_deliveryReceipts; /** * Initialize the MessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with. * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $conversationSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'sid' => Values::array_get($payload, 'sid'), 'index' => Values::array_get($payload, 'index'), 'author' => Values::array_get($payload, 'author'), 'body' => Values::array_get($payload, 'body'), 'media' => Values::array_get($payload, 'media'), 'attributes' => Values::array_get($payload, 'attributes'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'delivery' => Values::array_get($payload, 'delivery'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'contentSid' => Values::array_get($payload, 'content_sid'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessageContext Context for this MessageInstance */ protected function proxy(): MessageContext { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { return $this->proxy()->update($options); } /** * Access the deliveryReceipts */ protected function getDeliveryReceipts(): DeliveryReceiptList { return $this->proxy()->deliveryReceipts; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookInstance.php 0000644 00000012300 15021223077 0023264 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $conversationSid * @property string|null $target * @property string|null $url * @property array|null $configuration * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with. * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this webhook. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $conversationSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'target' => Values::array_get($payload, 'target'), 'url' => Values::array_get($payload, 'url'), 'configuration' => Values::array_get($payload, 'configuration'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WebhookContext Context for this WebhookInstance */ protected function proxy(): WebhookContext { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageContext.php 0000644 00000014576 15021223077 0023153 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Conversations\V1\Service\Conversation\Message\DeliveryReceiptList; /** * @property DeliveryReceiptList $deliveryReceipts * @method \Twilio\Rest\Conversations\V1\Service\Conversation\Message\DeliveryReceiptContext deliveryReceipts(string $sid) */ class MessageContext extends InstanceContext { protected $_deliveryReceipts; /** * Initialize the MessageContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with. * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct( Version $version, $chatServiceSid, $conversationSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($conversationSid) .'/Messages/' . \rawurlencode($sid) .''; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessageInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Author' => $options['author'], 'Body' => $options['body'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'Subject' => $options['subject'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new MessageInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Access the deliveryReceipts */ protected function getDeliveryReceipts(): DeliveryReceiptList { if (!$this->_deliveryReceipts) { $this->_deliveryReceipts = new DeliveryReceiptList( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->_deliveryReceipts; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptList.php 0000644 00000014552 15021223077 0025533 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation\Message; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DeliveryReceiptList extends ListResource { /** * Construct the DeliveryReceiptList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Message resource is associated with. * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. * @param string $messageSid The SID of the message within a [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) the delivery receipt belongs to. */ public function __construct( Version $version, string $chatServiceSid, string $conversationSid, string $messageSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'messageSid' => $messageSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($conversationSid) .'/Messages/' . \rawurlencode($messageSid) .'/Receipts'; } /** * Reads DeliveryReceiptInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeliveryReceiptInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DeliveryReceiptInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DeliveryReceiptInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DeliveryReceiptPage Page of DeliveryReceiptInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DeliveryReceiptPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DeliveryReceiptPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeliveryReceiptInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DeliveryReceiptPage Page of DeliveryReceiptInstance */ public function getPage(string $targetUrl): DeliveryReceiptPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DeliveryReceiptPage($this->version, $response, $this->solution); } /** * Constructs a DeliveryReceiptContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): DeliveryReceiptContext { return new DeliveryReceiptContext( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['messageSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.DeliveryReceiptList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptContext.php 0000644 00000006155 15021223077 0026244 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation\Message; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class DeliveryReceiptContext extends InstanceContext { /** * Initialize the DeliveryReceiptContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Message resource is associated with. * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. * @param string $messageSid The SID of the message within a [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) the delivery receipt belongs to. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct( Version $version, $chatServiceSid, $conversationSid, $messageSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'messageSid' => $messageSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($conversationSid) .'/Messages/' . \rawurlencode($messageSid) .'/Receipts/' . \rawurlencode($sid) .''; } /** * Fetch the DeliveryReceiptInstance * * @return DeliveryReceiptInstance Fetched DeliveryReceiptInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeliveryReceiptInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new DeliveryReceiptInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['messageSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.DeliveryReceiptContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptPage.php 0000644 00000003366 15021223077 0025475 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation\Message; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DeliveryReceiptPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DeliveryReceiptInstance \Twilio\Rest\Conversations\V1\Service\Conversation\Message\DeliveryReceiptInstance */ public function buildInstance(array $payload): DeliveryReceiptInstance { return new DeliveryReceiptInstance($this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['messageSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.DeliveryReceiptPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptInstance.php 0000644 00000012411 15021223077 0026354 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation\Message; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $conversationSid * @property string|null $messageSid * @property string|null $sid * @property string|null $channelMessageSid * @property string|null $participantSid * @property string $status * @property int|null $errorCode * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class DeliveryReceiptInstance extends InstanceResource { /** * Initialize the DeliveryReceiptInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Message resource is associated with. * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. * @param string $messageSid The SID of the message within a [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) the delivery receipt belongs to. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $conversationSid, string $messageSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'messageSid' => Values::array_get($payload, 'message_sid'), 'sid' => Values::array_get($payload, 'sid'), 'channelMessageSid' => Values::array_get($payload, 'channel_message_sid'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'status' => Values::array_get($payload, 'status'), 'errorCode' => Values::array_get($payload, 'error_code'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'messageSid' => $messageSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DeliveryReceiptContext Context for this DeliveryReceiptInstance */ protected function proxy(): DeliveryReceiptContext { if (!$this->context) { $this->context = new DeliveryReceiptContext( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['messageSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the DeliveryReceiptInstance * * @return DeliveryReceiptInstance Fetched DeliveryReceiptInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeliveryReceiptInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.DeliveryReceiptInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookContext.php 0000644 00000010360 15021223077 0023150 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with. * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this webhook. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct( Version $version, $chatServiceSid, $conversationSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($conversationSid) .'/Webhooks/' . \rawurlencode($sid) .''; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new WebhookInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function ($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.WebhookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookOptions.php 0000644 00000025110 15021223077 0023156 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Options; use Twilio\Values; abstract class WebhookOptions { /** * @param string $configurationUrl The absolute url the webhook request should be sent to. * @param string $configurationMethod * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. * @param int $configurationReplayAfter The message index for which and it's successors the webhook will be replayed. Not set by default * @return CreateWebhookOptions Options builder */ public static function create( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationReplayAfter = Values::INT_NONE ): CreateWebhookOptions { return new CreateWebhookOptions( $configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationReplayAfter ); } /** * @param string $configurationUrl The absolute url the webhook request should be sent to. * @param string $configurationMethod * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. * @return UpdateWebhookOptions Options builder */ public static function update( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE ): UpdateWebhookOptions { return new UpdateWebhookOptions( $configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid ); } } class CreateWebhookOptions extends Options { /** * @param string $configurationUrl The absolute url the webhook request should be sent to. * @param string $configurationMethod * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. * @param int $configurationReplayAfter The message index for which and it's successors the webhook will be replayed. Not set by default */ public function __construct( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationReplayAfter = Values::INT_NONE ) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationReplayAfter'] = $configurationReplayAfter; } /** * The absolute url the webhook request should be sent to. * * @param string $configurationUrl The absolute url the webhook request should be sent to. * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The list of events, firing webhook event for this Conversation. * * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * The list of keywords, firing webhook event for this Conversation. * * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The studio flow SID, where the webhook should be sent to. * * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The message index for which and it's successors the webhook will be replayed. Not set by default * * @param int $configurationReplayAfter The message index for which and it's successors the webhook will be replayed. Not set by default * @return $this Fluent Builder */ public function setConfigurationReplayAfter(int $configurationReplayAfter): self { $this->options['configurationReplayAfter'] = $configurationReplayAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateWebhookOptions ' . $options . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $configurationUrl The absolute url the webhook request should be sent to. * @param string $configurationMethod * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. */ public function __construct( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE ) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; } /** * The absolute url the webhook request should be sent to. * * @param string $configurationUrl The absolute url the webhook request should be sent to. * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The list of events, firing webhook event for this Conversation. * * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * The list of keywords, firing webhook event for this Conversation. * * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The studio flow SID, where the webhook should be sent to. * * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantOptions.php 0000644 00000060552 15021223077 0024047 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Options; use Twilio\Values; abstract class ParticipantOptions { /** * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. * @param string $messagingBindingAddress The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with `proxy_address`) is only null when the participant is interacting from an SDK endpoint (see the `identity` field). * @param string $messagingBindingProxyAddress The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the `identity` field). * @param \DateTime $dateCreated The date on which this resource was created. * @param \DateTime $dateUpdated The date on which this resource was last updated. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateParticipantOptions Options builder */ public static function create( string $identity = Values::NONE, string $messagingBindingAddress = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateParticipantOptions { return new CreateParticipantOptions( $identity, $messagingBindingAddress, $messagingBindingProxyAddress, $dateCreated, $dateUpdated, $attributes, $messagingBindingProjectedAddress, $roleSid, $xTwilioWebhookEnabled ); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return DeleteParticipantOptions Options builder */ public static function delete( string $xTwilioWebhookEnabled = Values::NONE ): DeleteParticipantOptions { return new DeleteParticipantOptions( $xTwilioWebhookEnabled ); } /** * @param \DateTime $dateCreated The date on which this resource was created. * @param \DateTime $dateUpdated The date on which this resource was last updated. * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateParticipantOptions Options builder */ public static function update( \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $identity = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, int $lastReadMessageIndex = Values::INT_NONE, string $lastReadTimestamp = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateParticipantOptions { return new UpdateParticipantOptions( $dateCreated, $dateUpdated, $identity, $attributes, $roleSid, $messagingBindingProxyAddress, $messagingBindingProjectedAddress, $lastReadMessageIndex, $lastReadTimestamp, $xTwilioWebhookEnabled ); } } class CreateParticipantOptions extends Options { /** * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. * @param string $messagingBindingAddress The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with `proxy_address`) is only null when the participant is interacting from an SDK endpoint (see the `identity` field). * @param string $messagingBindingProxyAddress The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the `identity` field). * @param \DateTime $dateCreated The date on which this resource was created. * @param \DateTime $dateUpdated The date on which this resource was last updated. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $identity = Values::NONE, string $messagingBindingAddress = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['identity'] = $identity; $this->options['messagingBindingAddress'] = $messagingBindingAddress; $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; $this->options['roleSid'] = $roleSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. * * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with `proxy_address`) is only null when the participant is interacting from an SDK endpoint (see the `identity` field). * * @param string $messagingBindingAddress The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with `proxy_address`) is only null when the participant is interacting from an SDK endpoint (see the `identity` field). * @return $this Fluent Builder */ public function setMessagingBindingAddress(string $messagingBindingAddress): self { $this->options['messagingBindingAddress'] = $messagingBindingAddress; return $this; } /** * The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the `identity` field). * * @param string $messagingBindingProxyAddress The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the `identity` field). * @return $this Fluent Builder */ public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self { $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; return $this; } /** * The date on which this resource was created. * * @param \DateTime $dateCreated The date on which this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date on which this resource was last updated. * * @param \DateTime $dateUpdated The date on which this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The address of the Twilio phone number that is used in Group MMS. * * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. * @return $this Fluent Builder */ public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self { $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; return $this; } /** * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateParticipantOptions ' . $options . ']'; } } class DeleteParticipantOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteParticipantOptions ' . $options . ']'; } } class UpdateParticipantOptions extends Options { /** * @param \DateTime $dateCreated The date on which this resource was created. * @param \DateTime $dateUpdated The date on which this resource was last updated. * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $identity = Values::NONE, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, int $lastReadMessageIndex = Values::INT_NONE, string $lastReadTimestamp = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['identity'] = $identity; $this->options['attributes'] = $attributes; $this->options['roleSid'] = $roleSid; $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; $this->options['lastReadTimestamp'] = $lastReadTimestamp; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The date on which this resource was created. * * @param \DateTime $dateCreated The date on which this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date on which this resource was last updated. * * @param \DateTime $dateUpdated The date on which this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. * * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the [Conversation SDK](https://www.twilio.com/docs/conversations/sdk-overview) to communicate. Limited to 256 characters. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set `{}` will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. * * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. * @return $this Fluent Builder */ public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self { $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; return $this; } /** * The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. * * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. * @return $this Fluent Builder */ public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self { $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; return $this; } /** * Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @return $this Fluent Builder */ public function setLastReadMessageIndex(int $lastReadMessageIndex): self { $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; return $this; } /** * Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @return $this Fluent Builder */ public function setLastReadTimestamp(string $lastReadTimestamp): self { $this->options['lastReadTimestamp'] = $lastReadTimestamp; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateParticipantOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantInstance.php 0000644 00000013504 15021223077 0024153 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $conversationSid * @property string|null $sid * @property string|null $identity * @property string|null $attributes * @property array|null $messagingBinding * @property string|null $roleSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property int|null $lastReadMessageIndex * @property string|null $lastReadTimestamp */ class ParticipantInstance extends InstanceResource { /** * Initialize the ParticipantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with. * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this participant. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $conversationSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'sid' => Values::array_get($payload, 'sid'), 'identity' => Values::array_get($payload, 'identity'), 'attributes' => Values::array_get($payload, 'attributes'), 'messagingBinding' => Values::array_get($payload, 'messaging_binding'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), 'lastReadTimestamp' => Values::array_get($payload, 'last_read_timestamp'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ParticipantContext Context for this ParticipantInstance */ protected function proxy(): ParticipantContext { if (!$this->context) { $this->context = new ParticipantContext( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ParticipantInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { return $this->proxy()->fetch(); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ParticipantInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantContext.php 0000644 00000011600 15021223077 0024026 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class ParticipantContext extends InstanceContext { /** * Initialize the ParticipantContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with. * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this participant. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct( Version $version, $chatServiceSid, $conversationSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($conversationSid) .'/Participants/' . \rawurlencode($sid) .''; } /** * Delete the ParticipantInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ParticipantInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ParticipantInstance { $options = new Values($options); $data = Values::of([ 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Identity' => $options['identity'], 'Attributes' => $options['attributes'], 'RoleSid' => $options['roleSid'], 'MessagingBinding.ProxyAddress' => $options['messagingBindingProxyAddress'], 'MessagingBinding.ProjectedAddress' => $options['messagingBindingProjectedAddress'], 'LastReadMessageIndex' => $options['lastReadMessageIndex'], 'LastReadTimestamp' => $options['lastReadTimestamp'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new ParticipantInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ParticipantContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantPage.php 0000644 00000003257 15021223077 0023267 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ParticipantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ParticipantInstance \Twilio\Rest\Conversations\V1\Service\Conversation\ParticipantInstance */ public function buildInstance(array $payload): ParticipantInstance { return new ParticipantInstance($this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ParticipantPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookPage.php 0000644 00000003227 15021223077 0022404 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WebhookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return WebhookInstance \Twilio\Rest\Conversations\V1\Service\Conversation\WebhookInstance */ public function buildInstance(array $payload): WebhookInstance { return new WebhookInstance($this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.WebhookPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookList.php 0000644 00000016425 15021223077 0022447 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with. * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this webhook. */ public function __construct( Version $version, string $chatServiceSid, string $conversationSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($conversationSid) .'/Webhooks'; } /** * Create the WebhookInstance * * @param string $target * @param array|Options $options Optional Arguments * @return WebhookInstance Created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $target, array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'Target' => $target, 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function ($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.ReplayAfter' => $options['configurationReplayAfter'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'] ); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WebhookPage Page of WebhookInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WebhookPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WebhookPage Page of WebhookInstance */ public function getPage(string $targetUrl): WebhookPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Constructs a WebhookContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): WebhookContext { return new WebhookContext( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.WebhookList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessagePage.php 0000644 00000003227 15021223077 0022372 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MessageInstance \Twilio\Rest\Conversations\V1\Service\Conversation\MessageInstance */ public function buildInstance(array $payload): MessageInstance { return new MessageInstance($this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.MessagePage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantList.php 0000644 00000016731 15021223077 0023327 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with. * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this participant. */ public function __construct( Version $version, string $chatServiceSid, string $conversationSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($conversationSid) .'/Participants'; } /** * Create the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Created ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ParticipantInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $options['identity'], 'MessagingBinding.Address' => $options['messagingBindingAddress'], 'MessagingBinding.ProxyAddress' => $options['messagingBindingProxyAddress'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'MessagingBinding.ProjectedAddress' => $options['messagingBindingProjectedAddress'], 'RoleSid' => $options['roleSid'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new ParticipantInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'] ); } /** * Reads ParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ParticipantPage Page of ParticipantInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ParticipantPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ParticipantPage Page of ParticipantInstance */ public function getPage(string $targetUrl): ParticipantPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Constructs a ParticipantContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): ParticipantContext { return new ParticipantContext( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ParticipantList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageOptions.php 0000644 00000045520 15021223077 0023153 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @param string $body The content of the message, can be up to 1,600 characters long. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $mediaSid The Media SID to be attached to the new Message. * @param string $contentSid The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. * @param string $contentVariables A structurally valid JSON string that contains values to resolve Rich Content template variables. * @param string $subject The subject of the message, can be up to 256 characters long. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateMessageOptions Options builder */ public static function create( string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $mediaSid = Values::NONE, string $contentSid = Values::NONE, string $contentVariables = Values::NONE, string $subject = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateMessageOptions { return new CreateMessageOptions( $author, $body, $dateCreated, $dateUpdated, $attributes, $mediaSid, $contentSid, $contentVariables, $subject, $xTwilioWebhookEnabled ); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return DeleteMessageOptions Options builder */ public static function delete( string $xTwilioWebhookEnabled = Values::NONE ): DeleteMessageOptions { return new DeleteMessageOptions( $xTwilioWebhookEnabled ); } /** * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. * @return ReadMessageOptions Options builder */ public static function read( string $order = Values::NONE ): ReadMessageOptions { return new ReadMessageOptions( $order ); } /** * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @param string $body The content of the message, can be up to 1,600 characters long. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $subject The subject of the message, can be up to 256 characters long. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateMessageOptions Options builder */ public static function update( string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $subject = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateMessageOptions { return new UpdateMessageOptions( $author, $body, $dateCreated, $dateUpdated, $attributes, $subject, $xTwilioWebhookEnabled ); } } class CreateMessageOptions extends Options { /** * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @param string $body The content of the message, can be up to 1,600 characters long. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $mediaSid The Media SID to be attached to the new Message. * @param string $contentSid The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. * @param string $contentVariables A structurally valid JSON string that contains values to resolve Rich Content template variables. * @param string $subject The subject of the message, can be up to 256 characters long. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $mediaSid = Values::NONE, string $contentSid = Values::NONE, string $contentVariables = Values::NONE, string $subject = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['author'] = $author; $this->options['body'] = $body; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['mediaSid'] = $mediaSid; $this->options['contentSid'] = $contentSid; $this->options['contentVariables'] = $contentVariables; $this->options['subject'] = $subject; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The channel specific identifier of the message's author. Defaults to `system`. * * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @return $this Fluent Builder */ public function setAuthor(string $author): self { $this->options['author'] = $author; return $this; } /** * The content of the message, can be up to 1,600 characters long. * * @param string $body The content of the message, can be up to 1,600 characters long. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. `null` if the message has not been edited. * * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The Media SID to be attached to the new Message. * * @param string $mediaSid The Media SID to be attached to the new Message. * @return $this Fluent Builder */ public function setMediaSid(string $mediaSid): self { $this->options['mediaSid'] = $mediaSid; return $this; } /** * The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. * * @param string $contentSid The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. * @return $this Fluent Builder */ public function setContentSid(string $contentSid): self { $this->options['contentSid'] = $contentSid; return $this; } /** * A structurally valid JSON string that contains values to resolve Rich Content template variables. * * @param string $contentVariables A structurally valid JSON string that contains values to resolve Rich Content template variables. * @return $this Fluent Builder */ public function setContentVariables(string $contentVariables): self { $this->options['contentVariables'] = $contentVariables; return $this; } /** * The subject of the message, can be up to 256 characters long. * * @param string $subject The subject of the message, can be up to 256 characters long. * @return $this Fluent Builder */ public function setSubject(string $subject): self { $this->options['subject'] = $subject; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateMessageOptions ' . $options . ']'; } } class DeleteMessageOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteMessageOptions ' . $options . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. */ public function __construct( string $order = Values::NONE ) { $this->options['order'] = $order; } /** * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. * * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadMessageOptions ' . $options . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @param string $body The content of the message, can be up to 1,600 characters long. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $subject The subject of the message, can be up to 256 characters long. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $subject = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['author'] = $author; $this->options['body'] = $body; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['subject'] = $subject; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The channel specific identifier of the message's author. Defaults to `system`. * * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @return $this Fluent Builder */ public function setAuthor(string $author): self { $this->options['author'] = $author; return $this; } /** * The content of the message, can be up to 1,600 characters long. * * @param string $body The content of the message, can be up to 1,600 characters long. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. `null` if the message has not been edited. * * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The subject of the message, can be up to 256 characters long. * * @param string $subject The subject of the message, can be up to 256 characters long. * @return $this Fluent Builder */ public function setSubject(string $subject): self { $this->options['subject'] = $subject; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateMessageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/Conversation/MessageList.php 0000644 00000017156 15021223077 0022437 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Participant resource is associated with. * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. */ public function __construct( Version $version, string $chatServiceSid, string $conversationSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($conversationSid) .'/Messages'; } /** * Create the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Author' => $options['author'], 'Body' => $options['body'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'MediaSid' => $options['mediaSid'], 'ContentSid' => $options['contentSid'], 'ContentVariables' => $options['contentVariables'], 'Subject' => $options['subject'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new MessageInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'] ); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagePage Page of MessageInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagePage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagePage Page of MessageInstance */ public function getPage(string $targetUrl): MessagePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): MessageContext { return new MessageContext( $this->version, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.MessageList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationOptions.php 0000644 00000075153 15021223077 0021574 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Options; use Twilio\Values; abstract class ConversationOptions { /** * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $state * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateConversationOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $messagingServiceSid = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $state = Values::NONE, string $timersInactive = Values::NONE, string $timersClosed = Values::NONE, string $bindingsEmailAddress = Values::NONE, string $bindingsEmailName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateConversationOptions { return new CreateConversationOptions( $friendlyName, $uniqueName, $attributes, $messagingServiceSid, $dateCreated, $dateUpdated, $state, $timersInactive, $timersClosed, $bindingsEmailAddress, $bindingsEmailName, $xTwilioWebhookEnabled ); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return DeleteConversationOptions Options builder */ public static function delete( string $xTwilioWebhookEnabled = Values::NONE ): DeleteConversationOptions { return new DeleteConversationOptions( $xTwilioWebhookEnabled ); } /** * @param string $startDate Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. * @param string $endDate Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` * @return ReadConversationOptions Options builder */ public static function read( string $startDate = Values::NONE, string $endDate = Values::NONE, string $state = Values::NONE ): ReadConversationOptions { return new ReadConversationOptions( $startDate, $endDate, $state ); } /** * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @param string $state * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateConversationOptions Options builder */ public static function update( string $friendlyName = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $messagingServiceSid = Values::NONE, string $state = Values::NONE, string $timersInactive = Values::NONE, string $timersClosed = Values::NONE, string $uniqueName = Values::NONE, string $bindingsEmailAddress = Values::NONE, string $bindingsEmailName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateConversationOptions { return new UpdateConversationOptions( $friendlyName, $dateCreated, $dateUpdated, $attributes, $messagingServiceSid, $state, $timersInactive, $timersClosed, $uniqueName, $bindingsEmailAddress, $bindingsEmailName, $xTwilioWebhookEnabled ); } } class CreateConversationOptions extends Options { /** * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $state * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $messagingServiceSid = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $state = Values::NONE, string $timersInactive = Values::NONE, string $timersClosed = Values::NONE, string $bindingsEmailAddress = Values::NONE, string $bindingsEmailName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['state'] = $state; $this->options['timersInactive'] = $timersInactive; $this->options['timersClosed'] = $timersClosed; $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; $this->options['bindingsEmailName'] = $bindingsEmailName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The human-readable name of this conversation, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * @param string $state * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @return $this Fluent Builder */ public function setTimersInactive(string $timersInactive): self { $this->options['timersInactive'] = $timersInactive; return $this; } /** * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @return $this Fluent Builder */ public function setTimersClosed(string $timersClosed): self { $this->options['timersClosed'] = $timersClosed; return $this; } /** * The default email address that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailAddress(string $bindingsEmailAddress): self { $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; return $this; } /** * The default name that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailName(string $bindingsEmailName): self { $this->options['bindingsEmailName'] = $bindingsEmailName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateConversationOptions ' . $options . ']'; } } class DeleteConversationOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteConversationOptions ' . $options . ']'; } } class ReadConversationOptions extends Options { /** * @param string $startDate Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. * @param string $endDate Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */ public function __construct( string $startDate = Values::NONE, string $endDate = Values::NONE, string $state = Values::NONE ) { $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['state'] = $state; } /** * Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. * * @param string $startDate Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. * @return $this Fluent Builder */ public function setStartDate(string $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. * * @param string $endDate Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. * @return $this Fluent Builder */ public function setEndDate(string $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` * * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadConversationOptions ' . $options . ']'; } } class UpdateConversationOptions extends Options { /** * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @param string $state * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $messagingServiceSid = Values::NONE, string $state = Values::NONE, string $timersInactive = Values::NONE, string $timersClosed = Values::NONE, string $uniqueName = Values::NONE, string $bindingsEmailAddress = Values::NONE, string $bindingsEmailName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['state'] = $state; $this->options['timersInactive'] = $timersInactive; $this->options['timersClosed'] = $timersClosed; $this->options['uniqueName'] = $uniqueName; $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; $this->options['bindingsEmailName'] = $bindingsEmailName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The human-readable name of this conversation, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * @param string $state * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @return $this Fluent Builder */ public function setTimersInactive(string $timersInactive): self { $this->options['timersInactive'] = $timersInactive; return $this; } /** * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @return $this Fluent Builder */ public function setTimersClosed(string $timersClosed): self { $this->options['timersClosed'] = $timersClosed; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The default email address that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailAddress(string $bindingsEmailAddress): self { $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; return $this; } /** * The default name that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailName(string $bindingsEmailName): self { $this->options['bindingsEmailName'] = $bindingsEmailName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateConversationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/RolePage.php 0000644 00000003107 15021223077 0017232 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RolePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RoleInstance \Twilio\Rest\Conversations\V1\Service\RoleInstance */ public function buildInstance(array $payload): RoleInstance { return new RoleInstance($this->version, $payload, $this->solution['chatServiceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.RolePage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationContext.php 0000644 00000017071 15021223077 0021560 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Conversations\V1\Service\Conversation\WebhookList; use Twilio\Rest\Conversations\V1\Service\Conversation\ParticipantList; use Twilio\Rest\Conversations\V1\Service\Conversation\MessageList; /** * @property WebhookList $webhooks * @property ParticipantList $participants * @property MessageList $messages * @method \Twilio\Rest\Conversations\V1\Service\Conversation\ParticipantContext participants(string $sid) * @method \Twilio\Rest\Conversations\V1\Service\Conversation\MessageContext messages(string $sid) * @method \Twilio\Rest\Conversations\V1\Service\Conversation\WebhookContext webhooks(string $sid) */ class ConversationContext extends InstanceContext { protected $_webhooks; protected $_participants; protected $_messages; /** * Initialize the ConversationContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Conversation resource is associated with. * @param string $sid A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. */ public function __construct( Version $version, $chatServiceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations/' . \rawurlencode($sid) .''; } /** * Delete the ConversationInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the ConversationInstance * * @return ConversationInstance Fetched ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConversationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConversationInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['sid'] ); } /** * Update the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Updated ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConversationInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'MessagingServiceSid' => $options['messagingServiceSid'], 'State' => $options['state'], 'Timers.Inactive' => $options['timersInactive'], 'Timers.Closed' => $options['timersClosed'], 'UniqueName' => $options['uniqueName'], 'Bindings.Email.Address' => $options['bindingsEmailAddress'], 'Bindings.Email.Name' => $options['bindingsEmailName'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new ConversationInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['sid'] ); } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version, $this->solution['chatServiceSid'], $this->solution['sid'] ); } return $this->_webhooks; } /** * Access the participants */ protected function getParticipants(): ParticipantList { if (!$this->_participants) { $this->_participants = new ParticipantList( $this->version, $this->solution['chatServiceSid'], $this->solution['sid'] ); } return $this->_participants; } /** * Access the messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['chatServiceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ConversationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationContext.php 0000644 00000006316 15021223077 0021715 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class ConfigurationContext extends InstanceContext { /** * Initialize the ConfigurationContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the Service configuration resource to fetch. */ public function __construct( Version $version, $chatServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Configuration'; } /** * Fetch the ConfigurationInstance * * @return ConfigurationInstance Fetched ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConfigurationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConfigurationInstance( $this->version, $payload, $this->solution['chatServiceSid'] ); } /** * Update the ConfigurationInstance * * @param array|Options $options Optional Arguments * @return ConfigurationInstance Updated ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConfigurationInstance { $options = new Values($options); $data = Values::of([ 'DefaultConversationCreatorRoleSid' => $options['defaultConversationCreatorRoleSid'], 'DefaultConversationRoleSid' => $options['defaultConversationRoleSid'], 'DefaultChatServiceRoleSid' => $options['defaultChatServiceRoleSid'], 'ReachabilityEnabled' => Serialize::booleanToString($options['reachabilityEnabled']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ConfigurationInstance( $this->version, $payload, $this->solution['chatServiceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ConfigurationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationInstance.php 0000644 00000010547 15021223077 0022036 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $chatServiceSid * @property string|null $defaultConversationCreatorRoleSid * @property string|null $defaultConversationRoleSid * @property string|null $defaultChatServiceRoleSid * @property string|null $url * @property array|null $links * @property bool|null $reachabilityEnabled */ class ConfigurationInstance extends InstanceResource { /** * Initialize the ConfigurationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the Service configuration resource to fetch. */ public function __construct(Version $version, array $payload, string $chatServiceSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'defaultConversationCreatorRoleSid' => Values::array_get($payload, 'default_conversation_creator_role_sid'), 'defaultConversationRoleSid' => Values::array_get($payload, 'default_conversation_role_sid'), 'defaultChatServiceRoleSid' => Values::array_get($payload, 'default_chat_service_role_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ConfigurationContext Context for this ConfigurationInstance */ protected function proxy(): ConfigurationContext { if (!$this->context) { $this->context = new ConfigurationContext( $this->version, $this->solution['chatServiceSid'] ); } return $this->context; } /** * Fetch the ConfigurationInstance * * @return ConfigurationInstance Fetched ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConfigurationInstance { return $this->proxy()->fetch(); } /** * Update the ConfigurationInstance * * @param array|Options $options Optional Arguments * @return ConfigurationInstance Updated ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConfigurationInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ConfigurationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationPage.php 0000644 00000003167 15021223077 0021011 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConversationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ConversationInstance \Twilio\Rest\Conversations\V1\Service\ConversationInstance */ public function buildInstance(array $payload): ConversationInstance { return new ConversationInstance($this->version, $payload, $this->solution['chatServiceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ConversationPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/BindingList.php 0000644 00000013633 15021223077 0017747 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class BindingList extends ListResource { /** * Construct the BindingList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to delete the Binding resource from. */ public function __construct( Version $version, string $chatServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Bindings'; } /** * Reads BindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BindingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams BindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BindingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BindingPage Page of BindingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BindingPage { $options = new Values($options); $params = Values::of([ 'BindingType' => $options['bindingType'], 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BindingPage Page of BindingInstance */ public function getPage(string $targetUrl): BindingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BindingPage($this->version, $response, $this->solution); } /** * Constructs a BindingContext * * @param string $sid The SID of the Binding resource to delete. */ public function getContext( string $sid ): BindingContext { return new BindingContext( $this->version, $this->solution['chatServiceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.BindingList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ParticipantConversationOptions.php 0000644 00000010157 15021223077 0023764 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Options; use Twilio\Values; abstract class ParticipantConversationOptions { /** * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @param string $address A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. * @return ReadParticipantConversationOptions Options builder */ public static function read( string $identity = Values::NONE, string $address = Values::NONE ): ReadParticipantConversationOptions { return new ReadParticipantConversationOptions( $identity, $address ); } } class ReadParticipantConversationOptions extends Options { /** * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @param string $address A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. */ public function __construct( string $identity = Values::NONE, string $address = Values::NONE ) { $this->options['identity'] = $identity; $this->options['address'] = $address; } /** * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. * * @param string $address A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. * @return $this Fluent Builder */ public function setAddress(string $address): self { $this->options['address'] = $address; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadParticipantConversationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/UserPage.php 0000644 00000003107 15021223077 0017247 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserInstance \Twilio\Rest\Conversations\V1\Service\UserInstance */ public function buildInstance(array $payload): UserInstance { return new UserInstance($this->version, $payload, $this->solution['chatServiceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.UserPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/BindingContext.php 0000644 00000005143 15021223077 0020455 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class BindingContext extends InstanceContext { /** * Initialize the BindingContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to delete the Binding resource from. * @param string $sid The SID of the Binding resource to delete. */ public function __construct( Version $version, $chatServiceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Bindings/' . \rawurlencode($sid) .''; } /** * Delete the BindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new BindingInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.BindingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConfigurationPage.php 0000644 00000003175 15021223077 0021145 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConfigurationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ConfigurationInstance \Twilio\Rest\Conversations\V1\Service\ConfigurationInstance */ public function buildInstance(array $payload): ConfigurationInstance { return new ConfigurationInstance($this->version, $payload, $this->solution['chatServiceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ConfigurationPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationContext.php 0000644 00000010524 15021223077 0023331 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class UserConversationContext extends InstanceContext { /** * Initialize the UserConversationContext * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Conversation resource is associated with. * @param string $userSid The unique SID identifier of the [User resource](https://www.twilio.com/docs/conversations/api/user-resource). This value can be either the `sid` or the `identity` of the User resource. * @param string $conversationSid The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). */ public function __construct( Version $version, $chatServiceSid, $userSid, $conversationSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'userSid' => $userSid, 'conversationSid' => $conversationSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Users/' . \rawurlencode($userSid) .'/Conversations/' . \rawurlencode($conversationSid) .''; } /** * Delete the UserConversationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the UserConversationInstance * * @return UserConversationInstance Fetched UserConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserConversationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserConversationInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['userSid'], $this->solution['conversationSid'] ); } /** * Update the UserConversationInstance * * @param array|Options $options Optional Arguments * @return UserConversationInstance Updated UserConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserConversationInstance { $options = new Values($options); $data = Values::of([ 'NotificationLevel' => $options['notificationLevel'], 'LastReadTimestamp' => Serialize::iso8601DateTime($options['lastReadTimestamp']), 'LastReadMessageIndex' => $options['lastReadMessageIndex'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new UserConversationInstance( $this->version, $payload, $this->solution['chatServiceSid'], $this->solution['userSid'], $this->solution['conversationSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.UserConversationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationList.php 0000644 00000014306 15021223077 0022622 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\User; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserConversationList extends ListResource { /** * Construct the UserConversationList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Conversation resource is associated with. * @param string $userSid The unique SID identifier of the [User resource](https://www.twilio.com/docs/conversations/api/user-resource). This value can be either the `sid` or the `identity` of the User resource. */ public function __construct( Version $version, string $chatServiceSid, string $userSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Users/' . \rawurlencode($userSid) .'/Conversations'; } /** * Reads UserConversationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserConversationInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserConversationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserConversationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserConversationPage Page of UserConversationInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserConversationPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserConversationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserConversationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserConversationPage Page of UserConversationInstance */ public function getPage(string $targetUrl): UserConversationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserConversationPage($this->version, $response, $this->solution); } /** * Constructs a UserConversationContext * * @param string $conversationSid The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). */ public function getContext( string $conversationSid ): UserConversationContext { return new UserConversationContext( $this->version, $this->solution['chatServiceSid'], $this->solution['userSid'], $conversationSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.UserConversationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationPage.php 0000644 00000003265 15021223077 0022565 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\User; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserConversationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserConversationInstance \Twilio\Rest\Conversations\V1\Service\User\UserConversationInstance */ public function buildInstance(array $payload): UserConversationInstance { return new UserConversationInstance($this->version, $payload, $this->solution['chatServiceSid'], $this->solution['userSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.UserConversationPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationOptions.php 0000644 00000007215 15021223077 0023343 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\User; use Twilio\Options; use Twilio\Values; abstract class UserConversationOptions { /** * @param string $notificationLevel * @param \DateTime $lastReadTimestamp The date of the last message read in conversation by the user, given in ISO 8601 format. * @param int $lastReadMessageIndex The index of the last Message in the Conversation that the Participant has read. * @return UpdateUserConversationOptions Options builder */ public static function update( string $notificationLevel = Values::NONE, \DateTime $lastReadTimestamp = null, int $lastReadMessageIndex = Values::INT_NONE ): UpdateUserConversationOptions { return new UpdateUserConversationOptions( $notificationLevel, $lastReadTimestamp, $lastReadMessageIndex ); } } class UpdateUserConversationOptions extends Options { /** * @param string $notificationLevel * @param \DateTime $lastReadTimestamp The date of the last message read in conversation by the user, given in ISO 8601 format. * @param int $lastReadMessageIndex The index of the last Message in the Conversation that the Participant has read. */ public function __construct( string $notificationLevel = Values::NONE, \DateTime $lastReadTimestamp = null, int $lastReadMessageIndex = Values::INT_NONE ) { $this->options['notificationLevel'] = $notificationLevel; $this->options['lastReadTimestamp'] = $lastReadTimestamp; $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; } /** * @param string $notificationLevel * @return $this Fluent Builder */ public function setNotificationLevel(string $notificationLevel): self { $this->options['notificationLevel'] = $notificationLevel; return $this; } /** * The date of the last message read in conversation by the user, given in ISO 8601 format. * * @param \DateTime $lastReadTimestamp The date of the last message read in conversation by the user, given in ISO 8601 format. * @return $this Fluent Builder */ public function setLastReadTimestamp(\DateTime $lastReadTimestamp): self { $this->options['lastReadTimestamp'] = $lastReadTimestamp; return $this; } /** * The index of the last Message in the Conversation that the Participant has read. * * @param int $lastReadMessageIndex The index of the last Message in the Conversation that the Participant has read. * @return $this Fluent Builder */ public function setLastReadMessageIndex(int $lastReadMessageIndex): self { $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateUserConversationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/User/UserConversationInstance.php 0000644 00000015143 15021223077 0023453 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $conversationSid * @property int|null $unreadMessagesCount * @property int|null $lastReadMessageIndex * @property string|null $participantSid * @property string|null $userSid * @property string|null $friendlyName * @property string $conversationState * @property array|null $timers * @property string|null $attributes * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy * @property string $notificationLevel * @property string|null $uniqueName * @property string|null $url * @property array|null $links */ class UserConversationInstance extends InstanceResource { /** * Initialize the UserConversationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Conversation resource is associated with. * @param string $userSid The unique SID identifier of the [User resource](https://www.twilio.com/docs/conversations/api/user-resource). This value can be either the `sid` or the `identity` of the User resource. * @param string $conversationSid The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $userSid, string $conversationSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'userSid' => Values::array_get($payload, 'user_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'conversationState' => Values::array_get($payload, 'conversation_state'), 'timers' => Values::array_get($payload, 'timers'), 'attributes' => Values::array_get($payload, 'attributes'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'notificationLevel' => Values::array_get($payload, 'notification_level'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'userSid' => $userSid, 'conversationSid' => $conversationSid ?: $this->properties['conversationSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserConversationContext Context for this UserConversationInstance */ protected function proxy(): UserConversationContext { if (!$this->context) { $this->context = new UserConversationContext( $this->version, $this->solution['chatServiceSid'], $this->solution['userSid'], $this->solution['conversationSid'] ); } return $this->context; } /** * Delete the UserConversationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserConversationInstance * * @return UserConversationInstance Fetched UserConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserConversationInstance { return $this->proxy()->fetch(); } /** * Update the UserConversationInstance * * @param array|Options $options Optional Arguments * @return UserConversationInstance Updated UserConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserConversationInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.UserConversationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/UserList.php 0000644 00000015403 15021223077 0017310 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the User resource is associated with. */ public function __construct( Version $version, string $chatServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Users'; } /** * Create the UserInstance * * @param string $identity The application-defined string that uniquely identifies the resource's User within the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource). This value is often a username or an email address, and is case-sensitive. * @param array|Options $options Optional Arguments * @return UserInstance Created UserInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'FriendlyName' => $options['friendlyName'], 'Attributes' => $options['attributes'], 'RoleSid' => $options['roleSid'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new UserInstance( $this->version, $payload, $this->solution['chatServiceSid'] ); } /** * Reads UserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserPage Page of UserInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserPage Page of UserInstance */ public function getPage(string $targetUrl): UserPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserPage($this->version, $response, $this->solution); } /** * Constructs a UserContext * * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. */ public function getContext( string $sid ): UserContext { return new UserContext( $this->version, $this->solution['chatServiceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.UserList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/RoleList.php 0000644 00000015135 15021223077 0017275 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class RoleList extends ListResource { /** * Construct the RoleList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to create the Role resource under. */ public function __construct( Version $version, string $chatServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $type * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type`. * @return RoleInstance Created RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $permission): RoleInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['chatServiceSid'] ); } /** * Reads RoleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoleInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RolePage Page of RoleInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RolePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RolePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RolePage Page of RoleInstance */ public function getPage(string $targetUrl): RolePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RolePage($this->version, $response, $this->solution); } /** * Constructs a RoleContext * * @param string $sid The SID of the Role resource to delete. */ public function getContext( string $sid ): RoleContext { return new RoleContext( $this->version, $this->solution['chatServiceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.RoleList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/ConversationList.php 0000644 00000017311 15021223077 0021044 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ConversationList extends ListResource { /** * Construct the ConversationList * * @param Version $version Version that contains the resource * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Conversation resource is associated with. */ public function __construct( Version $version, string $chatServiceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'chatServiceSid' => $chatServiceSid, ]; $this->uri = '/Services/' . \rawurlencode($chatServiceSid) .'/Conversations'; } /** * Create the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Created ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ConversationInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'MessagingServiceSid' => $options['messagingServiceSid'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'State' => $options['state'], 'Timers.Inactive' => $options['timersInactive'], 'Timers.Closed' => $options['timersClosed'], 'Bindings.Email.Address' => $options['bindingsEmailAddress'], 'Bindings.Email.Name' => $options['bindingsEmailName'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new ConversationInstance( $this->version, $payload, $this->solution['chatServiceSid'] ); } /** * Reads ConversationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConversationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ConversationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ConversationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConversationPage Page of ConversationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ConversationPage { $options = new Values($options); $params = Values::of([ 'StartDate' => $options['startDate'], 'EndDate' => $options['endDate'], 'State' => $options['state'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ConversationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConversationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ConversationPage Page of ConversationInstance */ public function getPage(string $targetUrl): ConversationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConversationPage($this->version, $response, $this->solution); } /** * Constructs a ConversationContext * * @param string $sid A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. */ public function getContext( string $sid ): ConversationContext { return new ConversationContext( $this->version, $this->solution['chatServiceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ConversationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/UserInstance.php 0000644 00000013243 15021223077 0020141 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Conversations\V1\Service\User\UserConversationList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $roleSid * @property string|null $identity * @property string|null $friendlyName * @property string|null $attributes * @property bool|null $isOnline * @property bool|null $isNotifiable * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class UserInstance extends InstanceResource { protected $_userConversations; /** * Initialize the UserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $chatServiceSid The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the User resource is associated with. * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. */ public function __construct(Version $version, array $payload, string $chatServiceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'identity' => Values::array_get($payload, 'identity'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'isOnline' => Values::array_get($payload, 'is_online'), 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserContext Context for this UserInstance */ protected function proxy(): UserContext { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['chatServiceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UserInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { return $this->proxy()->update($options); } /** * Access the userConversations */ protected function getUserConversations(): UserConversationList { return $this->proxy()->userConversations; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Service/BindingOptions.php 0000644 00000007577 15021223077 0020501 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Service; use Twilio\Options; use Twilio\Values; abstract class BindingOptions { /** * @param string $bindingType The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * @param string[] $identity The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details. * @return ReadBindingOptions Options builder */ public static function read( array $bindingType = Values::ARRAY_NONE, array $identity = Values::ARRAY_NONE ): ReadBindingOptions { return new ReadBindingOptions( $bindingType, $identity ); } } class ReadBindingOptions extends Options { /** * @param string $bindingType The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * @param string[] $identity The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details. */ public function __construct( array $bindingType = Values::ARRAY_NONE, array $identity = Values::ARRAY_NONE ) { $this->options['bindingType'] = $bindingType; $this->options['identity'] = $identity; } /** * The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * * @param string $bindingType The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * @return $this Fluent Builder */ public function setBindingType(array $bindingType): self { $this->options['bindingType'] = $bindingType; return $this; } /** * The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details. * * @param string[] $identity The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details. * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadBindingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConfigurationList.php 0000644 00000006026 15021223077 0017602 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Conversations\V1\Configuration\WebhookList; /** * @property WebhookList $webhooks * @method \Twilio\Rest\Conversations\V1\Configuration\WebhookContext webhooks() */ class ConfigurationList extends ListResource { protected $_webhooks = null; /** * Construct the ConfigurationList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a ConfigurationContext */ public function getContext( ): ConfigurationContext { return new ConfigurationContext( $this->version ); } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version ); } return $this->_webhooks; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ConfigurationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationPage.php 0000644 00000003206 15021223077 0021602 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ParticipantConversationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ParticipantConversationInstance \Twilio\Rest\Conversations\V1\ParticipantConversationInstance */ public function buildInstance(array $payload): ParticipantConversationInstance { return new ParticipantConversationInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ParticipantConversationPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationInstance.php 0000644 00000010154 15021223077 0022472 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $participantSid * @property string|null $participantUserSid * @property string|null $participantIdentity * @property array|null $participantMessagingBinding * @property string|null $conversationSid * @property string|null $conversationUniqueName * @property string|null $conversationFriendlyName * @property string|null $conversationAttributes * @property \DateTime|null $conversationDateCreated * @property \DateTime|null $conversationDateUpdated * @property string|null $conversationCreatedBy * @property string $conversationState * @property array|null $conversationTimers * @property array|null $links */ class ParticipantConversationInstance extends InstanceResource { /** * Initialize the ParticipantConversationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'participantUserSid' => Values::array_get($payload, 'participant_user_sid'), 'participantIdentity' => Values::array_get($payload, 'participant_identity'), 'participantMessagingBinding' => Values::array_get($payload, 'participant_messaging_binding'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'conversationUniqueName' => Values::array_get($payload, 'conversation_unique_name'), 'conversationFriendlyName' => Values::array_get($payload, 'conversation_friendly_name'), 'conversationAttributes' => Values::array_get($payload, 'conversation_attributes'), 'conversationDateCreated' => Deserialize::dateTime(Values::array_get($payload, 'conversation_date_created')), 'conversationDateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'conversation_date_updated')), 'conversationCreatedBy' => Values::array_get($payload, 'conversation_created_by'), 'conversationState' => Values::array_get($payload, 'conversation_state'), 'conversationTimers' => Values::array_get($payload, 'conversation_timers'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ParticipantConversationInstance]'; } } sdk/src/Twilio/Rest/Conversations/V1/RoleInstance.php 0000644 00000011621 15021223077 0016522 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $friendlyName * @property string $type * @property string[]|null $permissions * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Role resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoleContext Context for this RoleInstance */ protected function proxy(): RoleContext { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ServiceInstance.php 0000644 00000012712 15021223077 0017223 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Conversations\V1\Service\UserList; use Twilio\Rest\Conversations\V1\Service\BindingList; use Twilio\Rest\Conversations\V1\Service\ParticipantConversationList; use Twilio\Rest\Conversations\V1\Service\ConversationList; use Twilio\Rest\Conversations\V1\Service\RoleList; use Twilio\Rest\Conversations\V1\Service\ConfigurationList; /** * @property string|null $accountSid * @property string|null $sid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class ServiceInstance extends InstanceResource { protected $_users; protected $_bindings; protected $_participantConversations; protected $_conversations; protected $_roles; protected $_configuration; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Access the users */ protected function getUsers(): UserList { return $this->proxy()->users; } /** * Access the bindings */ protected function getBindings(): BindingList { return $this->proxy()->bindings; } /** * Access the participantConversations */ protected function getParticipantConversations(): ParticipantConversationList { return $this->proxy()->participantConversations; } /** * Access the conversations */ protected function getConversations(): ConversationList { return $this->proxy()->conversations; } /** * Access the roles */ protected function getRoles(): RoleList { return $this->proxy()->roles; } /** * Access the configuration */ protected function getConfiguration(): ConfigurationList { return $this->proxy()->configuration; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ServiceList.php 0000644 00000013401 15021223077 0016366 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName The human-readable name of this service, limited to 256 characters. Optional. * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): ServiceInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Conversations/V1/RoleContext.php 0000644 00000006416 15021223077 0016410 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Role resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Roles/' . \rawurlencode($sid) .''; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoleInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the RoleInstance * * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of([ 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.RoleContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationList.php 0000644 00000012645 15021223077 0021650 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ParticipantConversationList extends ListResource { /** * Construct the ParticipantConversationList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/ParticipantConversations'; } /** * Reads ParticipantConversationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantConversationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ParticipantConversationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ParticipantConversationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ParticipantConversationPage Page of ParticipantConversationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ParticipantConversationPage { $options = new Values($options); $params = Values::of([ 'Identity' => $options['identity'], 'Address' => $options['address'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ParticipantConversationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantConversationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ParticipantConversationPage Page of ParticipantConversationInstance */ public function getPage(string $targetUrl): ParticipantConversationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantConversationPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ParticipantConversationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookInstance.php 0000644 00000007562 15021223077 0022037 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Configuration; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string $method * @property string[]|null $filters * @property string|null $preWebhookUrl * @property string|null $postWebhookUrl * @property string $target * @property string|null $url */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'method' => Values::array_get($payload, 'method'), 'filters' => Values::array_get($payload, 'filters'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'target' => Values::array_get($payload, 'target'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = []; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WebhookContext Context for this WebhookInstance */ protected function proxy(): WebhookContext { if (!$this->context) { $this->context = new WebhookContext( $this->version ); } return $this->context; } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookContext.php 0000644 00000005433 15021223077 0021712 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Configuration; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Configuration/Webhooks'; } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new WebhookInstance( $this->version, $payload ); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'Method' => $options['method'], 'Filters' => Serialize::map($options['filters'], function ($e) { return $e; }), 'PreWebhookUrl' => $options['preWebhookUrl'], 'PostWebhookUrl' => $options['postWebhookUrl'], 'Target' => $options['target'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.WebhookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookOptions.php 0000644 00000012405 15021223077 0021716 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Configuration; use Twilio\Options; use Twilio\Values; abstract class WebhookOptions { /** * @param string $method The HTTP method to be used when sending a webhook request. * @param string[] $filters The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` * @param string $preWebhookUrl The absolute url the pre-event webhook request should be sent to. * @param string $postWebhookUrl The absolute url the post-event webhook request should be sent to. * @param string $target * @return UpdateWebhookOptions Options builder */ public static function update( string $method = Values::NONE, array $filters = Values::ARRAY_NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $target = Values::NONE ): UpdateWebhookOptions { return new UpdateWebhookOptions( $method, $filters, $preWebhookUrl, $postWebhookUrl, $target ); } } class UpdateWebhookOptions extends Options { /** * @param string $method The HTTP method to be used when sending a webhook request. * @param string[] $filters The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` * @param string $preWebhookUrl The absolute url the pre-event webhook request should be sent to. * @param string $postWebhookUrl The absolute url the post-event webhook request should be sent to. * @param string $target */ public function __construct( string $method = Values::NONE, array $filters = Values::ARRAY_NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $target = Values::NONE ) { $this->options['method'] = $method; $this->options['filters'] = $filters; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['target'] = $target; } /** * The HTTP method to be used when sending a webhook request. * * @param string $method The HTTP method to be used when sending a webhook request. * @return $this Fluent Builder */ public function setMethod(string $method): self { $this->options['method'] = $method; return $this; } /** * The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` * * @param string[] $filters The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` * @return $this Fluent Builder */ public function setFilters(array $filters): self { $this->options['filters'] = $filters; return $this; } /** * The absolute url the pre-event webhook request should be sent to. * * @param string $preWebhookUrl The absolute url the pre-event webhook request should be sent to. * @return $this Fluent Builder */ public function setPreWebhookUrl(string $preWebhookUrl): self { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The absolute url the post-event webhook request should be sent to. * * @param string $postWebhookUrl The absolute url the post-event webhook request should be sent to. * @return $this Fluent Builder */ public function setPostWebhookUrl(string $postWebhookUrl): self { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * @param string $target * @return $this Fluent Builder */ public function setTarget(string $target): self { $this->options['target'] = $target; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookPage.php 0000644 00000003102 15021223077 0021131 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Configuration; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WebhookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return WebhookInstance \Twilio\Rest\Conversations\V1\Configuration\WebhookInstance */ public function buildInstance(array $payload): WebhookInstance { return new WebhookInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.WebhookPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Configuration/WebhookList.php 0000644 00000002550 15021223077 0021176 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Configuration; use Twilio\ListResource; use Twilio\Version; class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a WebhookContext */ public function getContext( ): WebhookContext { return new WebhookContext( $this->version ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.WebhookList]'; } } sdk/src/Twilio/Rest/Conversations/V1/ConfigurationOptions.php 0000644 00000013403 15021223077 0020317 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Options; use Twilio\Values; abstract class ConfigurationOptions { /** * @param string $defaultChatServiceSid The SID of the default [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to use when creating a conversation. * @param string $defaultMessagingServiceSid The SID of the default [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to use when creating a conversation. * @param string $defaultInactiveTimer Default ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @param string $defaultClosedTimer Default ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @return UpdateConfigurationOptions Options builder */ public static function update( string $defaultChatServiceSid = Values::NONE, string $defaultMessagingServiceSid = Values::NONE, string $defaultInactiveTimer = Values::NONE, string $defaultClosedTimer = Values::NONE ): UpdateConfigurationOptions { return new UpdateConfigurationOptions( $defaultChatServiceSid, $defaultMessagingServiceSid, $defaultInactiveTimer, $defaultClosedTimer ); } } class UpdateConfigurationOptions extends Options { /** * @param string $defaultChatServiceSid The SID of the default [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to use when creating a conversation. * @param string $defaultMessagingServiceSid The SID of the default [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to use when creating a conversation. * @param string $defaultInactiveTimer Default ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @param string $defaultClosedTimer Default ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. */ public function __construct( string $defaultChatServiceSid = Values::NONE, string $defaultMessagingServiceSid = Values::NONE, string $defaultInactiveTimer = Values::NONE, string $defaultClosedTimer = Values::NONE ) { $this->options['defaultChatServiceSid'] = $defaultChatServiceSid; $this->options['defaultMessagingServiceSid'] = $defaultMessagingServiceSid; $this->options['defaultInactiveTimer'] = $defaultInactiveTimer; $this->options['defaultClosedTimer'] = $defaultClosedTimer; } /** * The SID of the default [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to use when creating a conversation. * * @param string $defaultChatServiceSid The SID of the default [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to use when creating a conversation. * @return $this Fluent Builder */ public function setDefaultChatServiceSid(string $defaultChatServiceSid): self { $this->options['defaultChatServiceSid'] = $defaultChatServiceSid; return $this; } /** * The SID of the default [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to use when creating a conversation. * * @param string $defaultMessagingServiceSid The SID of the default [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to use when creating a conversation. * @return $this Fluent Builder */ public function setDefaultMessagingServiceSid(string $defaultMessagingServiceSid): self { $this->options['defaultMessagingServiceSid'] = $defaultMessagingServiceSid; return $this; } /** * Default ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * * @param string $defaultInactiveTimer Default ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @return $this Fluent Builder */ public function setDefaultInactiveTimer(string $defaultInactiveTimer): self { $this->options['defaultInactiveTimer'] = $defaultInactiveTimer; return $this; } /** * Default ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * * @param string $defaultClosedTimer Default ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @return $this Fluent Builder */ public function setDefaultClosedTimer(string $defaultClosedTimer): self { $this->options['defaultClosedTimer'] = $defaultClosedTimer; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateConfigurationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConversationInstance.php 0000644 00000014022 15021223077 0020271 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Conversations\V1\Conversation\ParticipantList; use Twilio\Rest\Conversations\V1\Conversation\WebhookList; use Twilio\Rest\Conversations\V1\Conversation\MessageList; /** * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $messagingServiceSid * @property string|null $sid * @property string|null $friendlyName * @property string|null $uniqueName * @property string|null $attributes * @property string $state * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property array|null $timers * @property string|null $url * @property array|null $links * @property array|null $bindings */ class ConversationInstance extends InstanceResource { protected $_participants; protected $_webhooks; protected $_messages; /** * Initialize the ConversationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'state' => Values::array_get($payload, 'state'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'timers' => Values::array_get($payload, 'timers'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'bindings' => Values::array_get($payload, 'bindings'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ConversationContext Context for this ConversationInstance */ protected function proxy(): ConversationContext { if (!$this->context) { $this->context = new ConversationContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ConversationInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the ConversationInstance * * @return ConversationInstance Fetched ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConversationInstance { return $this->proxy()->fetch(); } /** * Update the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Updated ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConversationInstance { return $this->proxy()->update($options); } /** * Access the participants */ protected function getParticipants(): ParticipantList { return $this->proxy()->participants; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ConversationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationContext.php 0000644 00000010067 15021223077 0021621 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class AddressConfigurationContext extends InstanceContext { /** * Initialize the AddressConfigurationContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Address Configuration resource. This value can be either the `sid` or the `address` of the configuration */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Configuration/Addresses/' . \rawurlencode($sid) .''; } /** * Delete the AddressConfigurationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the AddressConfigurationInstance * * @return AddressConfigurationInstance Fetched AddressConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AddressConfigurationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AddressConfigurationInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the AddressConfigurationInstance * * @param array|Options $options Optional Arguments * @return AddressConfigurationInstance Updated AddressConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AddressConfigurationInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'AutoCreation.Enabled' => Serialize::booleanToString($options['autoCreationEnabled']), 'AutoCreation.Type' => $options['autoCreationType'], 'AutoCreation.ConversationServiceSid' => $options['autoCreationConversationServiceSid'], 'AutoCreation.WebhookUrl' => $options['autoCreationWebhookUrl'], 'AutoCreation.WebhookMethod' => $options['autoCreationWebhookMethod'], 'AutoCreation.WebhookFilters' => Serialize::map($options['autoCreationWebhookFilters'], function ($e) { return $e; }), 'AutoCreation.StudioFlowSid' => $options['autoCreationStudioFlowSid'], 'AutoCreation.StudioRetryCount' => $options['autoCreationStudioRetryCount'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new AddressConfigurationInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.AddressConfigurationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/CredentialContext.php 0000644 00000006641 15021223077 0017561 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($sid) .''; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { $options = new Values($options); $data = Values::of([ 'Type' => $options['type'], 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.CredentialContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageInstance.php 0000644 00000013473 15021223077 0021666 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Conversations\V1\Conversation\Message\DeliveryReceiptList; /** * @property string|null $accountSid * @property string|null $conversationSid * @property string|null $sid * @property int|null $index * @property string|null $author * @property string|null $body * @property array[]|null $media * @property string|null $attributes * @property string|null $participantSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $delivery * @property array|null $links * @property string|null $contentSid */ class MessageInstance extends InstanceResource { protected $_deliveryReceipts; /** * Initialize the MessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct(Version $version, array $payload, string $conversationSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'sid' => Values::array_get($payload, 'sid'), 'index' => Values::array_get($payload, 'index'), 'author' => Values::array_get($payload, 'author'), 'body' => Values::array_get($payload, 'body'), 'media' => Values::array_get($payload, 'media'), 'attributes' => Values::array_get($payload, 'attributes'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'delivery' => Values::array_get($payload, 'delivery'), 'links' => Values::array_get($payload, 'links'), 'contentSid' => Values::array_get($payload, 'content_sid'), ]; $this->solution = ['conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessageContext Context for this MessageInstance */ protected function proxy(): MessageContext { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { return $this->proxy()->update($options); } /** * Access the deliveryReceipts */ protected function getDeliveryReceipts(): DeliveryReceiptList { return $this->proxy()->deliveryReceipts; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookInstance.php 0000644 00000011426 15021223077 0021674 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $conversationSid * @property string|null $target * @property string|null $url * @property array|null $configuration * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this webhook. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct(Version $version, array $payload, string $conversationSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'target' => Values::array_get($payload, 'target'), 'url' => Values::array_get($payload, 'url'), 'configuration' => Values::array_get($payload, 'configuration'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WebhookContext Context for this WebhookInstance */ protected function proxy(): WebhookContext { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageContext.php 0000644 00000013624 15021223077 0021544 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Conversations\V1\Conversation\Message\DeliveryReceiptList; /** * @property DeliveryReceiptList $deliveryReceipts * @method \Twilio\Rest\Conversations\V1\Conversation\Message\DeliveryReceiptContext deliveryReceipts(string $sid) */ class MessageContext extends InstanceContext { protected $_deliveryReceipts; /** * Initialize the MessageContext * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct( Version $version, $conversationSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) .'/Messages/' . \rawurlencode($sid) .''; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessageInstance( $this->version, $payload, $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Author' => $options['author'], 'Body' => $options['body'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'Subject' => $options['subject'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new MessageInstance( $this->version, $payload, $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Access the deliveryReceipts */ protected function getDeliveryReceipts(): DeliveryReceiptList { if (!$this->_deliveryReceipts) { $this->_deliveryReceipts = new DeliveryReceiptList( $this->version, $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->_deliveryReceipts; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptList.php 0000644 00000013746 15021223077 0024137 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation\Message; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DeliveryReceiptList extends ListResource { /** * Construct the DeliveryReceiptList * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. * @param string $messageSid The SID of the message within a [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) the delivery receipt belongs to. */ public function __construct( Version $version, string $conversationSid, string $messageSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'conversationSid' => $conversationSid, 'messageSid' => $messageSid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) .'/Messages/' . \rawurlencode($messageSid) .'/Receipts'; } /** * Reads DeliveryReceiptInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeliveryReceiptInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DeliveryReceiptInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DeliveryReceiptInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DeliveryReceiptPage Page of DeliveryReceiptInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DeliveryReceiptPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DeliveryReceiptPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeliveryReceiptInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DeliveryReceiptPage Page of DeliveryReceiptInstance */ public function getPage(string $targetUrl): DeliveryReceiptPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DeliveryReceiptPage($this->version, $response, $this->solution); } /** * Constructs a DeliveryReceiptContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): DeliveryReceiptContext { return new DeliveryReceiptContext( $this->version, $this->solution['conversationSid'], $this->solution['messageSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.DeliveryReceiptList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptContext.php 0000644 00000005371 15021223077 0024643 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation\Message; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class DeliveryReceiptContext extends InstanceContext { /** * Initialize the DeliveryReceiptContext * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. * @param string $messageSid The SID of the message within a [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) the delivery receipt belongs to. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct( Version $version, $conversationSid, $messageSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'conversationSid' => $conversationSid, 'messageSid' => $messageSid, 'sid' => $sid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) .'/Messages/' . \rawurlencode($messageSid) .'/Receipts/' . \rawurlencode($sid) .''; } /** * Fetch the DeliveryReceiptInstance * * @return DeliveryReceiptInstance Fetched DeliveryReceiptInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeliveryReceiptInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new DeliveryReceiptInstance( $this->version, $payload, $this->solution['conversationSid'], $this->solution['messageSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.DeliveryReceiptContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptPage.php 0000644 00000003303 15021223077 0024064 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation\Message; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DeliveryReceiptPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DeliveryReceiptInstance \Twilio\Rest\Conversations\V1\Conversation\Message\DeliveryReceiptInstance */ public function buildInstance(array $payload): DeliveryReceiptInstance { return new DeliveryReceiptInstance($this->version, $payload, $this->solution['conversationSid'], $this->solution['messageSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.DeliveryReceiptPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptInstance.php 0000644 00000011543 15021223077 0024761 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation\Message; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $conversationSid * @property string|null $sid * @property string|null $messageSid * @property string|null $channelMessageSid * @property string|null $participantSid * @property string $status * @property int|null $errorCode * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class DeliveryReceiptInstance extends InstanceResource { /** * Initialize the DeliveryReceiptInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. * @param string $messageSid The SID of the message within a [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) the delivery receipt belongs to. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct(Version $version, array $payload, string $conversationSid, string $messageSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'sid' => Values::array_get($payload, 'sid'), 'messageSid' => Values::array_get($payload, 'message_sid'), 'channelMessageSid' => Values::array_get($payload, 'channel_message_sid'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'status' => Values::array_get($payload, 'status'), 'errorCode' => Values::array_get($payload, 'error_code'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['conversationSid' => $conversationSid, 'messageSid' => $messageSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DeliveryReceiptContext Context for this DeliveryReceiptInstance */ protected function proxy(): DeliveryReceiptContext { if (!$this->context) { $this->context = new DeliveryReceiptContext( $this->version, $this->solution['conversationSid'], $this->solution['messageSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the DeliveryReceiptInstance * * @return DeliveryReceiptInstance Fetched DeliveryReceiptInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DeliveryReceiptInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.DeliveryReceiptInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookContext.php 0000644 00000007511 15021223077 0021554 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this webhook. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct( Version $version, $conversationSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) .'/Webhooks/' . \rawurlencode($sid) .''; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new WebhookInstance( $this->version, $payload, $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function ($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.WebhookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookOptions.php 0000644 00000025100 15021223077 0021555 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Options; use Twilio\Values; abstract class WebhookOptions { /** * @param string $configurationUrl The absolute url the webhook request should be sent to. * @param string $configurationMethod * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. * @param int $configurationReplayAfter The message index for which and it's successors the webhook will be replayed. Not set by default * @return CreateWebhookOptions Options builder */ public static function create( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationReplayAfter = Values::INT_NONE ): CreateWebhookOptions { return new CreateWebhookOptions( $configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationReplayAfter ); } /** * @param string $configurationUrl The absolute url the webhook request should be sent to. * @param string $configurationMethod * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. * @return UpdateWebhookOptions Options builder */ public static function update( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE ): UpdateWebhookOptions { return new UpdateWebhookOptions( $configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid ); } } class CreateWebhookOptions extends Options { /** * @param string $configurationUrl The absolute url the webhook request should be sent to. * @param string $configurationMethod * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. * @param int $configurationReplayAfter The message index for which and it's successors the webhook will be replayed. Not set by default */ public function __construct( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationReplayAfter = Values::INT_NONE ) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationReplayAfter'] = $configurationReplayAfter; } /** * The absolute url the webhook request should be sent to. * * @param string $configurationUrl The absolute url the webhook request should be sent to. * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The list of events, firing webhook event for this Conversation. * * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * The list of keywords, firing webhook event for this Conversation. * * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The studio flow SID, where the webhook should be sent to. * * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The message index for which and it's successors the webhook will be replayed. Not set by default * * @param int $configurationReplayAfter The message index for which and it's successors the webhook will be replayed. Not set by default * @return $this Fluent Builder */ public function setConfigurationReplayAfter(int $configurationReplayAfter): self { $this->options['configurationReplayAfter'] = $configurationReplayAfter; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateWebhookOptions ' . $options . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $configurationUrl The absolute url the webhook request should be sent to. * @param string $configurationMethod * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. */ public function __construct( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE ) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; } /** * The absolute url the webhook request should be sent to. * * @param string $configurationUrl The absolute url the webhook request should be sent to. * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The list of events, firing webhook event for this Conversation. * * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * The list of keywords, firing webhook event for this Conversation. * * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The studio flow SID, where the webhook should be sent to. * * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantOptions.php 0000644 00000060216 15021223077 0022444 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Options; use Twilio\Values; abstract class ParticipantOptions { /** * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @param string $messagingBindingAddress The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). * @param string $messagingBindingProxyAddress The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity. * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateParticipantOptions Options builder */ public static function create( string $identity = Values::NONE, string $messagingBindingAddress = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateParticipantOptions { return new CreateParticipantOptions( $identity, $messagingBindingAddress, $messagingBindingProxyAddress, $dateCreated, $dateUpdated, $attributes, $messagingBindingProjectedAddress, $roleSid, $xTwilioWebhookEnabled ); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return DeleteParticipantOptions Options builder */ public static function delete( string $xTwilioWebhookEnabled = Values::NONE ): DeleteParticipantOptions { return new DeleteParticipantOptions( $xTwilioWebhookEnabled ); } /** * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateParticipantOptions Options builder */ public static function update( \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, string $identity = Values::NONE, int $lastReadMessageIndex = Values::INT_NONE, string $lastReadTimestamp = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateParticipantOptions { return new UpdateParticipantOptions( $dateCreated, $dateUpdated, $attributes, $roleSid, $messagingBindingProxyAddress, $messagingBindingProjectedAddress, $identity, $lastReadMessageIndex, $lastReadTimestamp, $xTwilioWebhookEnabled ); } } class CreateParticipantOptions extends Options { /** * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @param string $messagingBindingAddress The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). * @param string $messagingBindingProxyAddress The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity. * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $identity = Values::NONE, string $messagingBindingAddress = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, string $roleSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['identity'] = $identity; $this->options['messagingBindingAddress'] = $messagingBindingAddress; $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; $this->options['roleSid'] = $roleSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). * * @param string $messagingBindingAddress The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). * @return $this Fluent Builder */ public function setMessagingBindingAddress(string $messagingBindingAddress): self { $this->options['messagingBindingAddress'] = $messagingBindingAddress; return $this; } /** * The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). * * @param string $messagingBindingProxyAddress The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). * @return $this Fluent Builder */ public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self { $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity. * * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity. * @return $this Fluent Builder */ public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self { $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; return $this; } /** * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateParticipantOptions ' . $options . ']'; } } class DeleteParticipantOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteParticipantOptions ' . $options . ']'; } } class UpdateParticipantOptions extends Options { /** * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $roleSid = Values::NONE, string $messagingBindingProxyAddress = Values::NONE, string $messagingBindingProjectedAddress = Values::NONE, string $identity = Values::NONE, int $lastReadMessageIndex = Values::INT_NONE, string $lastReadTimestamp = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['roleSid'] = $roleSid; $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; $this->options['identity'] = $identity; $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; $this->options['lastReadTimestamp'] = $lastReadTimestamp; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. * * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. * @return $this Fluent Builder */ public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self { $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; return $this; } /** * The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. * * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. * @return $this Fluent Builder */ public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self { $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; return $this; } /** * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @return $this Fluent Builder */ public function setLastReadMessageIndex(int $lastReadMessageIndex): self { $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; return $this; } /** * Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. * @return $this Fluent Builder */ public function setLastReadTimestamp(string $lastReadTimestamp): self { $this->options['lastReadTimestamp'] = $lastReadTimestamp; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateParticipantOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantInstance.php 0000644 00000012632 15021223077 0022554 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $conversationSid * @property string|null $sid * @property string|null $identity * @property string|null $attributes * @property array|null $messagingBinding * @property string|null $roleSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property int|null $lastReadMessageIndex * @property string|null $lastReadTimestamp */ class ParticipantInstance extends InstanceResource { /** * Initialize the ParticipantInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this participant. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct(Version $version, array $payload, string $conversationSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'sid' => Values::array_get($payload, 'sid'), 'identity' => Values::array_get($payload, 'identity'), 'attributes' => Values::array_get($payload, 'attributes'), 'messagingBinding' => Values::array_get($payload, 'messaging_binding'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), 'lastReadTimestamp' => Values::array_get($payload, 'last_read_timestamp'), ]; $this->solution = ['conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ParticipantContext Context for this ParticipantInstance */ protected function proxy(): ParticipantContext { if (!$this->context) { $this->context = new ParticipantContext( $this->version, $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ParticipantInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { return $this->proxy()->fetch(); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ParticipantInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php 0000644 00000010731 15021223077 0022432 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class ParticipantContext extends InstanceContext { /** * Initialize the ParticipantContext * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this participant. * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct( Version $version, $conversationSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'conversationSid' => $conversationSid, 'sid' => $sid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) .'/Participants/' . \rawurlencode($sid) .''; } /** * Delete the ParticipantInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ParticipantInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ParticipantInstance( $this->version, $payload, $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ParticipantInstance { $options = new Values($options); $data = Values::of([ 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'RoleSid' => $options['roleSid'], 'MessagingBinding.ProxyAddress' => $options['messagingBindingProxyAddress'], 'MessagingBinding.ProjectedAddress' => $options['messagingBindingProjectedAddress'], 'Identity' => $options['identity'], 'LastReadMessageIndex' => $options['lastReadMessageIndex'], 'LastReadTimestamp' => $options['lastReadTimestamp'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new ParticipantInstance( $this->version, $payload, $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ParticipantContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantPage.php 0000644 00000003174 15021223077 0021665 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ParticipantPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ParticipantInstance \Twilio\Rest\Conversations\V1\Conversation\ParticipantInstance */ public function buildInstance(array $payload): ParticipantInstance { return new ParticipantInstance($this->version, $payload, $this->solution['conversationSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ParticipantPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookPage.php 0000644 00000003144 15021223077 0021002 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WebhookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return WebhookInstance \Twilio\Rest\Conversations\V1\Conversation\WebhookInstance */ public function buildInstance(array $payload): WebhookInstance { return new WebhookInstance($this->version, $payload, $this->solution['conversationSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.WebhookPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookList.php 0000644 00000015536 15021223077 0021051 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this webhook. */ public function __construct( Version $version, string $conversationSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'conversationSid' => $conversationSid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) .'/Webhooks'; } /** * Create the WebhookInstance * * @param string $target * @param array|Options $options Optional Arguments * @return WebhookInstance Created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $target, array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'Target' => $target, 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function ($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.ReplayAfter' => $options['configurationReplayAfter'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['conversationSid'] ); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WebhookPage Page of WebhookInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WebhookPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WebhookPage Page of WebhookInstance */ public function getPage(string $targetUrl): WebhookPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Constructs a WebhookContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): WebhookContext { return new WebhookContext( $this->version, $this->solution['conversationSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.WebhookList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessagePage.php 0000644 00000003144 15021223077 0020770 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MessageInstance \Twilio\Rest\Conversations\V1\Conversation\MessageInstance */ public function buildInstance(array $payload): MessageInstance { return new MessageInstance($this->version, $payload, $this->solution['conversationSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.MessagePage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantList.php 0000644 00000016042 15021223077 0021722 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this participant. */ public function __construct( Version $version, string $conversationSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'conversationSid' => $conversationSid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) .'/Participants'; } /** * Create the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Created ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ParticipantInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $options['identity'], 'MessagingBinding.Address' => $options['messagingBindingAddress'], 'MessagingBinding.ProxyAddress' => $options['messagingBindingProxyAddress'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'MessagingBinding.ProjectedAddress' => $options['messagingBindingProjectedAddress'], 'RoleSid' => $options['roleSid'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new ParticipantInstance( $this->version, $payload, $this->solution['conversationSid'] ); } /** * Reads ParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ParticipantPage Page of ParticipantInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ParticipantPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ParticipantPage Page of ParticipantInstance */ public function getPage(string $targetUrl): ParticipantPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Constructs a ParticipantContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): ParticipantContext { return new ParticipantContext( $this->version, $this->solution['conversationSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ParticipantList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageOptions.php 0000644 00000045510 15021223077 0021552 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @param string $body The content of the message, can be up to 1,600 characters long. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $mediaSid The Media SID to be attached to the new Message. * @param string $contentSid The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. * @param string $contentVariables A structurally valid JSON string that contains values to resolve Rich Content template variables. * @param string $subject The subject of the message, can be up to 256 characters long. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateMessageOptions Options builder */ public static function create( string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $mediaSid = Values::NONE, string $contentSid = Values::NONE, string $contentVariables = Values::NONE, string $subject = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateMessageOptions { return new CreateMessageOptions( $author, $body, $dateCreated, $dateUpdated, $attributes, $mediaSid, $contentSid, $contentVariables, $subject, $xTwilioWebhookEnabled ); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return DeleteMessageOptions Options builder */ public static function delete( string $xTwilioWebhookEnabled = Values::NONE ): DeleteMessageOptions { return new DeleteMessageOptions( $xTwilioWebhookEnabled ); } /** * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. * @return ReadMessageOptions Options builder */ public static function read( string $order = Values::NONE ): ReadMessageOptions { return new ReadMessageOptions( $order ); } /** * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @param string $body The content of the message, can be up to 1,600 characters long. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $subject The subject of the message, can be up to 256 characters long. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateMessageOptions Options builder */ public static function update( string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $subject = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateMessageOptions { return new UpdateMessageOptions( $author, $body, $dateCreated, $dateUpdated, $attributes, $subject, $xTwilioWebhookEnabled ); } } class CreateMessageOptions extends Options { /** * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @param string $body The content of the message, can be up to 1,600 characters long. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $mediaSid The Media SID to be attached to the new Message. * @param string $contentSid The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. * @param string $contentVariables A structurally valid JSON string that contains values to resolve Rich Content template variables. * @param string $subject The subject of the message, can be up to 256 characters long. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $mediaSid = Values::NONE, string $contentSid = Values::NONE, string $contentVariables = Values::NONE, string $subject = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['author'] = $author; $this->options['body'] = $body; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['mediaSid'] = $mediaSid; $this->options['contentSid'] = $contentSid; $this->options['contentVariables'] = $contentVariables; $this->options['subject'] = $subject; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The channel specific identifier of the message's author. Defaults to `system`. * * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @return $this Fluent Builder */ public function setAuthor(string $author): self { $this->options['author'] = $author; return $this; } /** * The content of the message, can be up to 1,600 characters long. * * @param string $body The content of the message, can be up to 1,600 characters long. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. `null` if the message has not been edited. * * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The Media SID to be attached to the new Message. * * @param string $mediaSid The Media SID to be attached to the new Message. * @return $this Fluent Builder */ public function setMediaSid(string $mediaSid): self { $this->options['mediaSid'] = $mediaSid; return $this; } /** * The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. * * @param string $contentSid The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. * @return $this Fluent Builder */ public function setContentSid(string $contentSid): self { $this->options['contentSid'] = $contentSid; return $this; } /** * A structurally valid JSON string that contains values to resolve Rich Content template variables. * * @param string $contentVariables A structurally valid JSON string that contains values to resolve Rich Content template variables. * @return $this Fluent Builder */ public function setContentVariables(string $contentVariables): self { $this->options['contentVariables'] = $contentVariables; return $this; } /** * The subject of the message, can be up to 256 characters long. * * @param string $subject The subject of the message, can be up to 256 characters long. * @return $this Fluent Builder */ public function setSubject(string $subject): self { $this->options['subject'] = $subject; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateMessageOptions ' . $options . ']'; } } class DeleteMessageOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteMessageOptions ' . $options . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. */ public function __construct( string $order = Values::NONE ) { $this->options['order'] = $order; } /** * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. * * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadMessageOptions ' . $options . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @param string $body The content of the message, can be up to 1,600 characters long. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $subject The subject of the message, can be up to 256 characters long. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $author = Values::NONE, string $body = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $subject = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['author'] = $author; $this->options['body'] = $body; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['subject'] = $subject; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The channel specific identifier of the message's author. Defaults to `system`. * * @param string $author The channel specific identifier of the message's author. Defaults to `system`. * @return $this Fluent Builder */ public function setAuthor(string $author): self { $this->options['author'] = $author; return $this; } /** * The content of the message, can be up to 1,600 characters long. * * @param string $body The content of the message, can be up to 1,600 characters long. * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. `null` if the message has not been edited. * * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The subject of the message, can be up to 256 characters long. * * @param string $subject The subject of the message, can be up to 256 characters long. * @return $this Fluent Builder */ public function setSubject(string $subject): self { $this->options['subject'] = $subject; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateMessageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageList.php 0000644 00000016267 15021223077 0021041 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $conversationSid The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message. */ public function __construct( Version $version, string $conversationSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'conversationSid' => $conversationSid, ]; $this->uri = '/Conversations/' . \rawurlencode($conversationSid) .'/Messages'; } /** * Create the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Author' => $options['author'], 'Body' => $options['body'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'MediaSid' => $options['mediaSid'], 'ContentSid' => $options['contentSid'], 'ContentVariables' => $options['contentVariables'], 'Subject' => $options['subject'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new MessageInstance( $this->version, $payload, $this->solution['conversationSid'] ); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagePage Page of MessageInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagePage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagePage Page of MessageInstance */ public function getPage(string $targetUrl): MessagePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): MessageContext { return new MessageContext( $this->version, $this->solution['conversationSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.MessageList]'; } } sdk/src/Twilio/Rest/Conversations/V1/ConversationOptions.php 0000644 00000070173 15021223077 0020171 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Options; use Twilio\Values; abstract class ConversationOptions { /** * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $state * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateConversationOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $messagingServiceSid = Values::NONE, string $attributes = Values::NONE, string $state = Values::NONE, string $timersInactive = Values::NONE, string $timersClosed = Values::NONE, string $bindingsEmailAddress = Values::NONE, string $bindingsEmailName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateConversationOptions { return new CreateConversationOptions( $friendlyName, $uniqueName, $dateCreated, $dateUpdated, $messagingServiceSid, $attributes, $state, $timersInactive, $timersClosed, $bindingsEmailAddress, $bindingsEmailName, $xTwilioWebhookEnabled ); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return DeleteConversationOptions Options builder */ public static function delete( string $xTwilioWebhookEnabled = Values::NONE ): DeleteConversationOptions { return new DeleteConversationOptions( $xTwilioWebhookEnabled ); } /** * @param string $startDate Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. * @param string $endDate End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` * @return ReadConversationOptions Options builder */ public static function read( string $startDate = Values::NONE, string $endDate = Values::NONE, string $state = Values::NONE ): ReadConversationOptions { return new ReadConversationOptions( $startDate, $endDate, $state ); } /** * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @param string $state * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateConversationOptions Options builder */ public static function update( string $friendlyName = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $messagingServiceSid = Values::NONE, string $state = Values::NONE, string $timersInactive = Values::NONE, string $timersClosed = Values::NONE, string $uniqueName = Values::NONE, string $bindingsEmailAddress = Values::NONE, string $bindingsEmailName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateConversationOptions { return new UpdateConversationOptions( $friendlyName, $dateCreated, $dateUpdated, $attributes, $messagingServiceSid, $state, $timersInactive, $timersClosed, $uniqueName, $bindingsEmailAddress, $bindingsEmailName, $xTwilioWebhookEnabled ); } } class CreateConversationOptions extends Options { /** * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $state * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $messagingServiceSid = Values::NONE, string $attributes = Values::NONE, string $state = Values::NONE, string $timersInactive = Values::NONE, string $timersClosed = Values::NONE, string $bindingsEmailAddress = Values::NONE, string $bindingsEmailName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['attributes'] = $attributes; $this->options['state'] = $state; $this->options['timersInactive'] = $timersInactive; $this->options['timersClosed'] = $timersClosed; $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; $this->options['bindingsEmailName'] = $bindingsEmailName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The human-readable name of this conversation, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * @param string $state * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @return $this Fluent Builder */ public function setTimersInactive(string $timersInactive): self { $this->options['timersInactive'] = $timersInactive; return $this; } /** * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @return $this Fluent Builder */ public function setTimersClosed(string $timersClosed): self { $this->options['timersClosed'] = $timersClosed; return $this; } /** * The default email address that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailAddress(string $bindingsEmailAddress): self { $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; return $this; } /** * The default name that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailName(string $bindingsEmailName): self { $this->options['bindingsEmailName'] = $bindingsEmailName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateConversationOptions ' . $options . ']'; } } class DeleteConversationOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.DeleteConversationOptions ' . $options . ']'; } } class ReadConversationOptions extends Options { /** * @param string $startDate Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. * @param string $endDate End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */ public function __construct( string $startDate = Values::NONE, string $endDate = Values::NONE, string $state = Values::NONE ) { $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['state'] = $state; } /** * Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. * * @param string $startDate Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. * @return $this Fluent Builder */ public function setStartDate(string $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. * * @param string $endDate End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. * @return $this Fluent Builder */ public function setEndDate(string $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` * * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadConversationOptions ' . $options . ']'; } } class UpdateConversationOptions extends Options { /** * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @param string $state * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $messagingServiceSid = Values::NONE, string $state = Values::NONE, string $timersInactive = Values::NONE, string $timersClosed = Values::NONE, string $uniqueName = Values::NONE, string $bindingsEmailAddress = Values::NONE, string $bindingsEmailName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['state'] = $state; $this->options['timersInactive'] = $timersInactive; $this->options['timersClosed'] = $timersClosed; $this->options['uniqueName'] = $uniqueName; $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; $this->options['bindingsEmailName'] = $bindingsEmailName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The human-readable name of this conversation, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. * @return $this Fluent Builder */ public function setMessagingServiceSid(string $messagingServiceSid): self { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * @param string $state * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. * @return $this Fluent Builder */ public function setTimersInactive(string $timersInactive): self { $this->options['timersInactive'] = $timersInactive; return $this; } /** * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. * @return $this Fluent Builder */ public function setTimersClosed(string $timersClosed): self { $this->options['timersClosed'] = $timersClosed; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The default email address that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailAddress The default email address that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailAddress(string $bindingsEmailAddress): self { $this->options['bindingsEmailAddress'] = $bindingsEmailAddress; return $this; } /** * The default name that will be used when sending outbound emails in this conversation. * * @param string $bindingsEmailName The default name that will be used when sending outbound emails in this conversation. * @return $this Fluent Builder */ public function setBindingsEmailName(string $bindingsEmailName): self { $this->options['bindingsEmailName'] = $bindingsEmailName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateConversationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/RolePage.php 0000644 00000003024 15021223077 0015630 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RolePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RoleInstance \Twilio\Rest\Conversations\V1\RoleInstance */ public function buildInstance(array $payload): RoleInstance { return new RoleInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.RolePage]'; } } sdk/src/Twilio/Rest/Conversations/V1/ConversationContext.php 0000644 00000015710 15021223077 0020156 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Conversations\V1\Conversation\ParticipantList; use Twilio\Rest\Conversations\V1\Conversation\WebhookList; use Twilio\Rest\Conversations\V1\Conversation\MessageList; /** * @property ParticipantList $participants * @property WebhookList $webhooks * @property MessageList $messages * @method \Twilio\Rest\Conversations\V1\Conversation\WebhookContext webhooks(string $sid) * @method \Twilio\Rest\Conversations\V1\Conversation\MessageContext messages(string $sid) * @method \Twilio\Rest\Conversations\V1\Conversation\ParticipantContext participants(string $sid) */ class ConversationContext extends InstanceContext { protected $_participants; protected $_webhooks; protected $_messages; /** * Initialize the ConversationContext * * @param Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Conversations/' . \rawurlencode($sid) .''; } /** * Delete the ConversationInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the ConversationInstance * * @return ConversationInstance Fetched ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConversationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConversationInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Updated ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConversationInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'MessagingServiceSid' => $options['messagingServiceSid'], 'State' => $options['state'], 'Timers.Inactive' => $options['timersInactive'], 'Timers.Closed' => $options['timersClosed'], 'UniqueName' => $options['uniqueName'], 'Bindings.Email.Address' => $options['bindingsEmailAddress'], 'Bindings.Email.Name' => $options['bindingsEmailName'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new ConversationInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the participants */ protected function getParticipants(): ParticipantList { if (!$this->_participants) { $this->_participants = new ParticipantList( $this->version, $this->solution['sid'] ); } return $this->_participants; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version, $this->solution['sid'] ); } return $this->_webhooks; } /** * Access the messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['sid'] ); } return $this->_messages; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ConversationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConfigurationContext.php 0000644 00000005454 15021223077 0020317 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class ConfigurationContext extends InstanceContext { /** * Initialize the ConfigurationContext * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Configuration'; } /** * Fetch the ConfigurationInstance * * @return ConfigurationInstance Fetched ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConfigurationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ConfigurationInstance( $this->version, $payload ); } /** * Update the ConfigurationInstance * * @param array|Options $options Optional Arguments * @return ConfigurationInstance Updated ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConfigurationInstance { $options = new Values($options); $data = Values::of([ 'DefaultChatServiceSid' => $options['defaultChatServiceSid'], 'DefaultMessagingServiceSid' => $options['defaultMessagingServiceSid'], 'DefaultInactiveTimer' => $options['defaultInactiveTimer'], 'DefaultClosedTimer' => $options['defaultClosedTimer'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ConfigurationInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ConfigurationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConfigurationInstance.php 0000644 00000010117 15021223077 0020427 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $defaultChatServiceSid * @property string|null $defaultMessagingServiceSid * @property string|null $defaultInactiveTimer * @property string|null $defaultClosedTimer * @property string|null $url * @property array|null $links */ class ConfigurationInstance extends InstanceResource { /** * Initialize the ConfigurationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'defaultChatServiceSid' => Values::array_get($payload, 'default_chat_service_sid'), 'defaultMessagingServiceSid' => Values::array_get($payload, 'default_messaging_service_sid'), 'defaultInactiveTimer' => Values::array_get($payload, 'default_inactive_timer'), 'defaultClosedTimer' => Values::array_get($payload, 'default_closed_timer'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = []; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ConfigurationContext Context for this ConfigurationInstance */ protected function proxy(): ConfigurationContext { if (!$this->context) { $this->context = new ConfigurationContext( $this->version ); } return $this->context; } /** * Fetch the ConfigurationInstance * * @return ConfigurationInstance Fetched ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ConfigurationInstance { return $this->proxy()->fetch(); } /** * Update the ConfigurationInstance * * @param array|Options $options Optional Arguments * @return ConfigurationInstance Updated ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ConfigurationInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ConfigurationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConversationPage.php 0000644 00000003104 15021223077 0017400 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConversationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ConversationInstance \Twilio\Rest\Conversations\V1\ConversationInstance */ public function buildInstance(array $payload): ConversationInstance { return new ConversationInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ConversationPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/CredentialOptions.php 0000644 00000034546 15021223077 0017575 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return CreateCredentialOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ): CreateCredentialOptions { return new CreateCredentialOptions( $friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret ); } /** * @param string $type * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return UpdateCredentialOptions Options builder */ public static function update( string $type = Values::NONE, string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ): UpdateCredentialOptions { return new UpdateCredentialOptions( $type, $friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret ); } } class CreateCredentialOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. */ public function __construct( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. * * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. * * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateCredentialOptions ' . $options . ']'; } } class UpdateCredentialOptions extends Options { /** * @param string $type * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. */ public function __construct( string $type = Values::NONE, string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ) { $this->options['type'] = $type; $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * @param string $type * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. * * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. * * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateCredentialOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ParticipantConversationOptions.php 0000644 00000010147 15021223077 0022363 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Options; use Twilio\Values; abstract class ParticipantConversationOptions { /** * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @param string $address A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. * @return ReadParticipantConversationOptions Options builder */ public static function read( string $identity = Values::NONE, string $address = Values::NONE ): ReadParticipantConversationOptions { return new ReadParticipantConversationOptions( $identity, $address ); } } class ReadParticipantConversationOptions extends Options { /** * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @param string $address A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. */ public function __construct( string $identity = Values::NONE, string $address = Values::NONE ) { $this->options['identity'] = $identity; $this->options['address'] = $address; } /** * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. * @return $this Fluent Builder */ public function setIdentity(string $identity): self { $this->options['identity'] = $identity; return $this; } /** * A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. * * @param string $address A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. * @return $this Fluent Builder */ public function setAddress(string $address): self { $this->options['address'] = $address; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadParticipantConversationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/UserPage.php 0000644 00000003024 15021223077 0015645 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserInstance \Twilio\Rest\Conversations\V1\UserInstance */ public function buildInstance(array $payload): UserInstance { return new UserInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.UserPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationInstance.php 0000644 00000011711 15021223077 0021736 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $type * @property string|null $address * @property string|null $friendlyName * @property array|null $autoCreation * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property string|null $addressCountry */ class AddressConfigurationInstance extends InstanceResource { /** * Initialize the AddressConfigurationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Address Configuration resource. This value can be either the `sid` or the `address` of the configuration */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'type' => Values::array_get($payload, 'type'), 'address' => Values::array_get($payload, 'address'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'autoCreation' => Values::array_get($payload, 'auto_creation'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'addressCountry' => Values::array_get($payload, 'address_country'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AddressConfigurationContext Context for this AddressConfigurationInstance */ protected function proxy(): AddressConfigurationContext { if (!$this->context) { $this->context = new AddressConfigurationContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the AddressConfigurationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the AddressConfigurationInstance * * @return AddressConfigurationInstance Fetched AddressConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AddressConfigurationInstance { return $this->proxy()->fetch(); } /** * Update the AddressConfigurationInstance * * @param array|Options $options Optional Arguments * @return AddressConfigurationInstance Updated AddressConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): AddressConfigurationInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.AddressConfigurationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConfigurationPage.php 0000644 00000003112 15021223077 0017534 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ConfigurationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ConfigurationInstance \Twilio\Rest\Conversations\V1\ConfigurationInstance */ public function buildInstance(array $payload): ConfigurationInstance { return new ConfigurationInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ConfigurationPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationContext.php 0000644 00000007654 15021223077 0021743 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\User; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class UserConversationContext extends InstanceContext { /** * Initialize the UserConversationContext * * @param Version $version Version that contains the resource * @param string $userSid The unique SID identifier of the [User resource](https://www.twilio.com/docs/conversations/api/user-resource). This value can be either the `sid` or the `identity` of the User resource. * @param string $conversationSid The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). */ public function __construct( Version $version, $userSid, $conversationSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'userSid' => $userSid, 'conversationSid' => $conversationSid, ]; $this->uri = '/Users/' . \rawurlencode($userSid) .'/Conversations/' . \rawurlencode($conversationSid) .''; } /** * Delete the UserConversationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the UserConversationInstance * * @return UserConversationInstance Fetched UserConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserConversationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserConversationInstance( $this->version, $payload, $this->solution['userSid'], $this->solution['conversationSid'] ); } /** * Update the UserConversationInstance * * @param array|Options $options Optional Arguments * @return UserConversationInstance Updated UserConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserConversationInstance { $options = new Values($options); $data = Values::of([ 'NotificationLevel' => $options['notificationLevel'], 'LastReadTimestamp' => Serialize::iso8601DateTime($options['lastReadTimestamp']), 'LastReadMessageIndex' => $options['lastReadMessageIndex'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new UserConversationInstance( $this->version, $payload, $this->solution['userSid'], $this->solution['conversationSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.UserConversationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationList.php 0000644 00000013475 15021223077 0021230 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\User; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserConversationList extends ListResource { /** * Construct the UserConversationList * * @param Version $version Version that contains the resource * @param string $userSid The unique SID identifier of the [User resource](https://www.twilio.com/docs/conversations/api/user-resource). This value can be either the `sid` or the `identity` of the User resource. */ public function __construct( Version $version, string $userSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'userSid' => $userSid, ]; $this->uri = '/Users/' . \rawurlencode($userSid) .'/Conversations'; } /** * Reads UserConversationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserConversationInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserConversationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserConversationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserConversationPage Page of UserConversationInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserConversationPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserConversationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserConversationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserConversationPage Page of UserConversationInstance */ public function getPage(string $targetUrl): UserConversationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserConversationPage($this->version, $response, $this->solution); } /** * Constructs a UserConversationContext * * @param string $conversationSid The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). */ public function getContext( string $conversationSid ): UserConversationContext { return new UserConversationContext( $this->version, $this->solution['userSid'], $conversationSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.UserConversationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationPage.php 0000644 00000003202 15021223077 0021154 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\User; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserConversationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserConversationInstance \Twilio\Rest\Conversations\V1\User\UserConversationInstance */ public function buildInstance(array $payload): UserConversationInstance { return new UserConversationInstance($this->version, $payload, $this->solution['userSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.UserConversationPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationOptions.php 0000644 00000007205 15021223077 0021742 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\User; use Twilio\Options; use Twilio\Values; abstract class UserConversationOptions { /** * @param string $notificationLevel * @param \DateTime $lastReadTimestamp The date of the last message read in conversation by the user, given in ISO 8601 format. * @param int $lastReadMessageIndex The index of the last Message in the Conversation that the Participant has read. * @return UpdateUserConversationOptions Options builder */ public static function update( string $notificationLevel = Values::NONE, \DateTime $lastReadTimestamp = null, int $lastReadMessageIndex = Values::INT_NONE ): UpdateUserConversationOptions { return new UpdateUserConversationOptions( $notificationLevel, $lastReadTimestamp, $lastReadMessageIndex ); } } class UpdateUserConversationOptions extends Options { /** * @param string $notificationLevel * @param \DateTime $lastReadTimestamp The date of the last message read in conversation by the user, given in ISO 8601 format. * @param int $lastReadMessageIndex The index of the last Message in the Conversation that the Participant has read. */ public function __construct( string $notificationLevel = Values::NONE, \DateTime $lastReadTimestamp = null, int $lastReadMessageIndex = Values::INT_NONE ) { $this->options['notificationLevel'] = $notificationLevel; $this->options['lastReadTimestamp'] = $lastReadTimestamp; $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; } /** * @param string $notificationLevel * @return $this Fluent Builder */ public function setNotificationLevel(string $notificationLevel): self { $this->options['notificationLevel'] = $notificationLevel; return $this; } /** * The date of the last message read in conversation by the user, given in ISO 8601 format. * * @param \DateTime $lastReadTimestamp The date of the last message read in conversation by the user, given in ISO 8601 format. * @return $this Fluent Builder */ public function setLastReadTimestamp(\DateTime $lastReadTimestamp): self { $this->options['lastReadTimestamp'] = $lastReadTimestamp; return $this; } /** * The index of the last Message in the Conversation that the Participant has read. * * @param int $lastReadMessageIndex The index of the last Message in the Conversation that the Participant has read. * @return $this Fluent Builder */ public function setLastReadMessageIndex(int $lastReadMessageIndex): self { $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateUserConversationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/User/UserConversationInstance.php 0000644 00000014462 15021223077 0022056 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $conversationSid * @property int|null $unreadMessagesCount * @property int|null $lastReadMessageIndex * @property string|null $participantSid * @property string|null $userSid * @property string|null $friendlyName * @property string $conversationState * @property array|null $timers * @property string|null $attributes * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy * @property string $notificationLevel * @property string|null $uniqueName * @property string|null $url * @property array|null $links */ class UserConversationInstance extends InstanceResource { /** * Initialize the UserConversationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $userSid The unique SID identifier of the [User resource](https://www.twilio.com/docs/conversations/api/user-resource). This value can be either the `sid` or the `identity` of the User resource. * @param string $conversationSid The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). */ public function __construct(Version $version, array $payload, string $userSid, string $conversationSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'userSid' => Values::array_get($payload, 'user_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'conversationState' => Values::array_get($payload, 'conversation_state'), 'timers' => Values::array_get($payload, 'timers'), 'attributes' => Values::array_get($payload, 'attributes'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'notificationLevel' => Values::array_get($payload, 'notification_level'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['userSid' => $userSid, 'conversationSid' => $conversationSid ?: $this->properties['conversationSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserConversationContext Context for this UserConversationInstance */ protected function proxy(): UserConversationContext { if (!$this->context) { $this->context = new UserConversationContext( $this->version, $this->solution['userSid'], $this->solution['conversationSid'] ); } return $this->context; } /** * Delete the UserConversationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserConversationInstance * * @return UserConversationInstance Fetched UserConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserConversationInstance { return $this->proxy()->fetch(); } /** * Update the UserConversationInstance * * @param array|Options $options Optional Arguments * @return UserConversationInstance Updated UserConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserConversationInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.UserConversationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/CredentialInstance.php 0000644 00000010777 15021223077 0017706 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string $type * @property string|null $sandbox * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'sandbox' => Values::array_get($payload, 'sandbox'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialContext Context for this CredentialInstance */ protected function proxy(): CredentialContext { if (!$this->context) { $this->context = new CredentialContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/UserList.php 0000644 00000014523 15021223077 0015712 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Users'; } /** * Create the UserInstance * * @param string $identity The application-defined string that uniquely identifies the resource's User within the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource). This value is often a username or an email address, and is case-sensitive. * @param array|Options $options Optional Arguments * @return UserInstance Created UserInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'FriendlyName' => $options['friendlyName'], 'Attributes' => $options['attributes'], 'RoleSid' => $options['roleSid'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new UserInstance( $this->version, $payload ); } /** * Reads UserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserPage Page of UserInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserPage Page of UserInstance */ public function getPage(string $targetUrl): UserPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserPage($this->version, $response, $this->solution); } /** * Constructs a UserContext * * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. */ public function getContext( string $sid ): UserContext { return new UserContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.UserList]'; } } sdk/src/Twilio/Rest/Conversations/V1/RoleList.php 0000644 00000014260 15021223077 0015673 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class RoleList extends ListResource { /** * Construct the RoleList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * @param string $type * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type`. * @return RoleInstance Created RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $permission): RoleInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload ); } /** * Reads RoleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoleInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RolePage Page of RoleInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RolePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RolePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RolePage Page of RoleInstance */ public function getPage(string $targetUrl): RolePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RolePage($this->version, $response, $this->solution); } /** * Constructs a RoleContext * * @param string $sid The SID of the Role resource to delete. */ public function getContext( string $sid ): RoleContext { return new RoleContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.RoleList]'; } } sdk/src/Twilio/Rest/Conversations/V1/ServiceContext.php 0000644 00000015101 15021223077 0017076 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Conversations\V1\Service\UserList; use Twilio\Rest\Conversations\V1\Service\BindingList; use Twilio\Rest\Conversations\V1\Service\ParticipantConversationList; use Twilio\Rest\Conversations\V1\Service\ConversationList; use Twilio\Rest\Conversations\V1\Service\RoleList; use Twilio\Rest\Conversations\V1\Service\ConfigurationList; /** * @property UserList $users * @property BindingList $bindings * @property ParticipantConversationList $participantConversations * @property ConversationList $conversations * @property RoleList $roles * @property ConfigurationList $configuration * @method \Twilio\Rest\Conversations\V1\Service\UserContext users(string $sid) * @method \Twilio\Rest\Conversations\V1\Service\RoleContext roles(string $sid) * @method \Twilio\Rest\Conversations\V1\Service\ConfigurationContext configuration() * @method \Twilio\Rest\Conversations\V1\Service\BindingContext bindings(string $sid) * @method \Twilio\Rest\Conversations\V1\Service\ConversationContext conversations(string $sid) */ class ServiceContext extends InstanceContext { protected $_users; protected $_bindings; protected $_participantConversations; protected $_conversations; protected $_roles; protected $_configuration; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies this resource. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) .''; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the users */ protected function getUsers(): UserList { if (!$this->_users) { $this->_users = new UserList( $this->version, $this->solution['sid'] ); } return $this->_users; } /** * Access the bindings */ protected function getBindings(): BindingList { if (!$this->_bindings) { $this->_bindings = new BindingList( $this->version, $this->solution['sid'] ); } return $this->_bindings; } /** * Access the participantConversations */ protected function getParticipantConversations(): ParticipantConversationList { if (!$this->_participantConversations) { $this->_participantConversations = new ParticipantConversationList( $this->version, $this->solution['sid'] ); } return $this->_participantConversations; } /** * Access the conversations */ protected function getConversations(): ConversationList { if (!$this->_conversations) { $this->_conversations = new ConversationList( $this->version, $this->solution['sid'] ); } return $this->_conversations; } /** * Access the roles */ protected function getRoles(): RoleList { if (!$this->_roles) { $this->_roles = new RoleList( $this->version, $this->solution['sid'] ); } return $this->_roles; } /** * Access the configuration */ protected function getConfiguration(): ConfigurationList { if (!$this->_configuration) { $this->_configuration = new ConfigurationList( $this->version, $this->solution['sid'] ); } return $this->_configuration; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ServicePage.php 0000644 00000003046 15021223077 0016333 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ServiceInstance \Twilio\Rest\Conversations\V1\ServiceInstance */ public function buildInstance(array $payload): ServiceInstance { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ServicePage]'; } } sdk/src/Twilio/Rest/Conversations/V1/ConversationList.php 0000644 00000016421 15021223077 0017445 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ConversationList extends ListResource { /** * Construct the ConversationList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Conversations'; } /** * Create the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Created ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ConversationInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'MessagingServiceSid' => $options['messagingServiceSid'], 'Attributes' => $options['attributes'], 'State' => $options['state'], 'Timers.Inactive' => $options['timersInactive'], 'Timers.Closed' => $options['timersClosed'], 'Bindings.Email.Address' => $options['bindingsEmailAddress'], 'Bindings.Email.Name' => $options['bindingsEmailName'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new ConversationInstance( $this->version, $payload ); } /** * Reads ConversationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConversationInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ConversationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ConversationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ConversationPage Page of ConversationInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ConversationPage { $options = new Values($options); $params = Values::of([ 'StartDate' => $options['startDate'], 'EndDate' => $options['endDate'], 'State' => $options['state'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ConversationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConversationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ConversationPage Page of ConversationInstance */ public function getPage(string $targetUrl): ConversationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConversationPage($this->version, $response, $this->solution); } /** * Constructs a ConversationContext * * @param string $sid A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. */ public function getContext( string $sid ): ConversationContext { return new ConversationContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.ConversationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationOptions.php 0000644 00000053401 15021223077 0021627 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Options; use Twilio\Values; abstract class AddressConfigurationOptions { /** * @param string $friendlyName The human-readable name of this configuration, limited to 256 characters. Optional. * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations for messages to this address * @param string $autoCreationType * @param string $autoCreationConversationServiceSid Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. * @param string $autoCreationWebhookUrl For type `webhook`, the url for the webhook request. * @param string $autoCreationWebhookMethod * @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` * @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to. * @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request * @param string $addressCountry An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses. * @return CreateAddressConfigurationOptions Options builder */ public static function create( string $friendlyName = Values::NONE, bool $autoCreationEnabled = Values::BOOL_NONE, string $autoCreationType = Values::NONE, string $autoCreationConversationServiceSid = Values::NONE, string $autoCreationWebhookUrl = Values::NONE, string $autoCreationWebhookMethod = Values::NONE, array $autoCreationWebhookFilters = Values::ARRAY_NONE, string $autoCreationStudioFlowSid = Values::NONE, int $autoCreationStudioRetryCount = Values::INT_NONE, string $addressCountry = Values::NONE ): CreateAddressConfigurationOptions { return new CreateAddressConfigurationOptions( $friendlyName, $autoCreationEnabled, $autoCreationType, $autoCreationConversationServiceSid, $autoCreationWebhookUrl, $autoCreationWebhookMethod, $autoCreationWebhookFilters, $autoCreationStudioFlowSid, $autoCreationStudioRetryCount, $addressCountry ); } /** * @param string $type Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. * @return ReadAddressConfigurationOptions Options builder */ public static function read( string $type = Values::NONE ): ReadAddressConfigurationOptions { return new ReadAddressConfigurationOptions( $type ); } /** * @param string $friendlyName The human-readable name of this configuration, limited to 256 characters. Optional. * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations for messages to this address * @param string $autoCreationType * @param string $autoCreationConversationServiceSid Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. * @param string $autoCreationWebhookUrl For type `webhook`, the url for the webhook request. * @param string $autoCreationWebhookMethod * @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` * @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to. * @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request * @return UpdateAddressConfigurationOptions Options builder */ public static function update( string $friendlyName = Values::NONE, bool $autoCreationEnabled = Values::BOOL_NONE, string $autoCreationType = Values::NONE, string $autoCreationConversationServiceSid = Values::NONE, string $autoCreationWebhookUrl = Values::NONE, string $autoCreationWebhookMethod = Values::NONE, array $autoCreationWebhookFilters = Values::ARRAY_NONE, string $autoCreationStudioFlowSid = Values::NONE, int $autoCreationStudioRetryCount = Values::INT_NONE ): UpdateAddressConfigurationOptions { return new UpdateAddressConfigurationOptions( $friendlyName, $autoCreationEnabled, $autoCreationType, $autoCreationConversationServiceSid, $autoCreationWebhookUrl, $autoCreationWebhookMethod, $autoCreationWebhookFilters, $autoCreationStudioFlowSid, $autoCreationStudioRetryCount ); } } class CreateAddressConfigurationOptions extends Options { /** * @param string $friendlyName The human-readable name of this configuration, limited to 256 characters. Optional. * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations for messages to this address * @param string $autoCreationType * @param string $autoCreationConversationServiceSid Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. * @param string $autoCreationWebhookUrl For type `webhook`, the url for the webhook request. * @param string $autoCreationWebhookMethod * @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` * @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to. * @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request * @param string $addressCountry An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses. */ public function __construct( string $friendlyName = Values::NONE, bool $autoCreationEnabled = Values::BOOL_NONE, string $autoCreationType = Values::NONE, string $autoCreationConversationServiceSid = Values::NONE, string $autoCreationWebhookUrl = Values::NONE, string $autoCreationWebhookMethod = Values::NONE, array $autoCreationWebhookFilters = Values::ARRAY_NONE, string $autoCreationStudioFlowSid = Values::NONE, int $autoCreationStudioRetryCount = Values::INT_NONE, string $addressCountry = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['autoCreationEnabled'] = $autoCreationEnabled; $this->options['autoCreationType'] = $autoCreationType; $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; $this->options['addressCountry'] = $addressCountry; } /** * The human-readable name of this configuration, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this configuration, limited to 256 characters. Optional. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Enable/Disable auto-creating conversations for messages to this address * * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations for messages to this address * @return $this Fluent Builder */ public function setAutoCreationEnabled(bool $autoCreationEnabled): self { $this->options['autoCreationEnabled'] = $autoCreationEnabled; return $this; } /** * @param string $autoCreationType * @return $this Fluent Builder */ public function setAutoCreationType(string $autoCreationType): self { $this->options['autoCreationType'] = $autoCreationType; return $this; } /** * Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. * * @param string $autoCreationConversationServiceSid Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. * @return $this Fluent Builder */ public function setAutoCreationConversationServiceSid(string $autoCreationConversationServiceSid): self { $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; return $this; } /** * For type `webhook`, the url for the webhook request. * * @param string $autoCreationWebhookUrl For type `webhook`, the url for the webhook request. * @return $this Fluent Builder */ public function setAutoCreationWebhookUrl(string $autoCreationWebhookUrl): self { $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; return $this; } /** * @param string $autoCreationWebhookMethod * @return $this Fluent Builder */ public function setAutoCreationWebhookMethod(string $autoCreationWebhookMethod): self { $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; return $this; } /** * The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` * * @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` * @return $this Fluent Builder */ public function setAutoCreationWebhookFilters(array $autoCreationWebhookFilters): self { $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; return $this; } /** * For type `studio`, the studio flow SID where the webhook should be sent to. * * @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to. * @return $this Fluent Builder */ public function setAutoCreationStudioFlowSid(string $autoCreationStudioFlowSid): self { $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; return $this; } /** * For type `studio`, number of times to retry the webhook request * * @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request * @return $this Fluent Builder */ public function setAutoCreationStudioRetryCount(int $autoCreationStudioRetryCount): self { $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; return $this; } /** * An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses. * * @param string $addressCountry An ISO 3166-1 alpha-2n country code which the address belongs to. This is currently only applicable to short code addresses. * @return $this Fluent Builder */ public function setAddressCountry(string $addressCountry): self { $this->options['addressCountry'] = $addressCountry; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.CreateAddressConfigurationOptions ' . $options . ']'; } } class ReadAddressConfigurationOptions extends Options { /** * @param string $type Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. */ public function __construct( string $type = Values::NONE ) { $this->options['type'] = $type; } /** * Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. * * @param string $type Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.ReadAddressConfigurationOptions ' . $options . ']'; } } class UpdateAddressConfigurationOptions extends Options { /** * @param string $friendlyName The human-readable name of this configuration, limited to 256 characters. Optional. * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations for messages to this address * @param string $autoCreationType * @param string $autoCreationConversationServiceSid Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. * @param string $autoCreationWebhookUrl For type `webhook`, the url for the webhook request. * @param string $autoCreationWebhookMethod * @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` * @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to. * @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request */ public function __construct( string $friendlyName = Values::NONE, bool $autoCreationEnabled = Values::BOOL_NONE, string $autoCreationType = Values::NONE, string $autoCreationConversationServiceSid = Values::NONE, string $autoCreationWebhookUrl = Values::NONE, string $autoCreationWebhookMethod = Values::NONE, array $autoCreationWebhookFilters = Values::ARRAY_NONE, string $autoCreationStudioFlowSid = Values::NONE, int $autoCreationStudioRetryCount = Values::INT_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['autoCreationEnabled'] = $autoCreationEnabled; $this->options['autoCreationType'] = $autoCreationType; $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; } /** * The human-readable name of this configuration, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this configuration, limited to 256 characters. Optional. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Enable/Disable auto-creating conversations for messages to this address * * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations for messages to this address * @return $this Fluent Builder */ public function setAutoCreationEnabled(bool $autoCreationEnabled): self { $this->options['autoCreationEnabled'] = $autoCreationEnabled; return $this; } /** * @param string $autoCreationType * @return $this Fluent Builder */ public function setAutoCreationType(string $autoCreationType): self { $this->options['autoCreationType'] = $autoCreationType; return $this; } /** * Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. * * @param string $autoCreationConversationServiceSid Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. * @return $this Fluent Builder */ public function setAutoCreationConversationServiceSid(string $autoCreationConversationServiceSid): self { $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; return $this; } /** * For type `webhook`, the url for the webhook request. * * @param string $autoCreationWebhookUrl For type `webhook`, the url for the webhook request. * @return $this Fluent Builder */ public function setAutoCreationWebhookUrl(string $autoCreationWebhookUrl): self { $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; return $this; } /** * @param string $autoCreationWebhookMethod * @return $this Fluent Builder */ public function setAutoCreationWebhookMethod(string $autoCreationWebhookMethod): self { $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; return $this; } /** * The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` * * @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` * @return $this Fluent Builder */ public function setAutoCreationWebhookFilters(array $autoCreationWebhookFilters): self { $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; return $this; } /** * For type `studio`, the studio flow SID where the webhook should be sent to. * * @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to. * @return $this Fluent Builder */ public function setAutoCreationStudioFlowSid(string $autoCreationStudioFlowSid): self { $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; return $this; } /** * For type `studio`, number of times to retry the webhook request * * @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request * @return $this Fluent Builder */ public function setAutoCreationStudioRetryCount(int $autoCreationStudioRetryCount): self { $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Conversations.V1.UpdateAddressConfigurationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/CredentialPage.php 0000644 00000003070 15021223077 0017002 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CredentialInstance \Twilio\Rest\Conversations\V1\CredentialInstance */ public function buildInstance(array $payload): CredentialInstance { return new CredentialInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.CredentialPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/CredentialList.php 0000644 00000014443 15021223077 0017047 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Credentials'; } /** * Create the CredentialInstance * * @param string $type * @param array|Options $options Optional Arguments * @return CredentialInstance Created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): CredentialInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload ); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialPage Page of CredentialInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialPage Page of CredentialInstance */ public function getPage(string $targetUrl): CredentialPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Constructs a CredentialContext * * @param string $sid A 34 character string that uniquely identifies this resource. */ public function getContext( string $sid ): CredentialContext { return new CredentialContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.CredentialList]'; } } sdk/src/Twilio/Rest/Conversations/V1/UserInstance.php 0000644 00000012562 15021223077 0016544 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Conversations\V1\User\UserConversationList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $chatServiceSid * @property string|null $roleSid * @property string|null $identity * @property string|null $friendlyName * @property string|null $attributes * @property bool|null $isOnline * @property bool|null $isNotifiable * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class UserInstance extends InstanceResource { protected $_userConversations; /** * Initialize the UserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'identity' => Values::array_get($payload, 'identity'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'isOnline' => Values::array_get($payload, 'is_online'), 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserContext Context for this UserInstance */ protected function proxy(): UserContext { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the UserInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { return $this->proxy()->update($options); } /** * Access the userConversations */ protected function getUserConversations(): UserConversationList { return $this->proxy()->userConversations; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/AddressConfigurationPage.php 0000644 00000003164 15021223077 0021051 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AddressConfigurationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AddressConfigurationInstance \Twilio\Rest\Conversations\V1\AddressConfigurationInstance */ public function buildInstance(array $payload): AddressConfigurationInstance { return new AddressConfigurationInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1.AddressConfigurationPage]'; } } sdk/src/Twilio/Rest/Conversations/V1.php 0000644 00000012652 15021223077 0014141 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Conversations * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Conversations; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Conversations\V1\AddressConfigurationList; use Twilio\Rest\Conversations\V1\ConfigurationList; use Twilio\Rest\Conversations\V1\ConversationList; use Twilio\Rest\Conversations\V1\CredentialList; use Twilio\Rest\Conversations\V1\ParticipantConversationList; use Twilio\Rest\Conversations\V1\RoleList; use Twilio\Rest\Conversations\V1\ServiceList; use Twilio\Rest\Conversations\V1\UserList; use Twilio\Version; /** * @property AddressConfigurationList $addressConfigurations * @property ConfigurationList $configuration * @property ConversationList $conversations * @property CredentialList $credentials * @property ParticipantConversationList $participantConversations * @property RoleList $roles * @property ServiceList $services * @property UserList $users * @method \Twilio\Rest\Conversations\V1\AddressConfigurationContext addressConfigurations(string $sid) * @method \Twilio\Rest\Conversations\V1\ConversationContext conversations(string $sid) * @method \Twilio\Rest\Conversations\V1\CredentialContext credentials(string $sid) * @method \Twilio\Rest\Conversations\V1\RoleContext roles(string $sid) * @method \Twilio\Rest\Conversations\V1\ServiceContext services(string $sid) * @method \Twilio\Rest\Conversations\V1\UserContext users(string $sid) */ class V1 extends Version { protected $_addressConfigurations; protected $_configuration; protected $_conversations; protected $_credentials; protected $_participantConversations; protected $_roles; protected $_services; protected $_users; /** * Construct the V1 version of Conversations * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getAddressConfigurations(): AddressConfigurationList { if (!$this->_addressConfigurations) { $this->_addressConfigurations = new AddressConfigurationList($this); } return $this->_addressConfigurations; } protected function getConfiguration(): ConfigurationList { if (!$this->_configuration) { $this->_configuration = new ConfigurationList($this); } return $this->_configuration; } protected function getConversations(): ConversationList { if (!$this->_conversations) { $this->_conversations = new ConversationList($this); } return $this->_conversations; } protected function getCredentials(): CredentialList { if (!$this->_credentials) { $this->_credentials = new CredentialList($this); } return $this->_credentials; } protected function getParticipantConversations(): ParticipantConversationList { if (!$this->_participantConversations) { $this->_participantConversations = new ParticipantConversationList($this); } return $this->_participantConversations; } protected function getRoles(): RoleList { if (!$this->_roles) { $this->_roles = new RoleList($this); } return $this->_roles; } protected function getServices(): ServiceList { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } protected function getUsers(): UserList { if (!$this->_users) { $this->_users = new UserList($this); } return $this->_users; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Conversations.V1]'; } } sdk/src/Twilio/Rest/TrunkingBase.php 0000644 00000004540 15021223077 0013407 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Trunking\V1; /** * @property \Twilio\Rest\Trunking\V1 $v1 */ class TrunkingBase extends Domain { protected $_v1; /** * Construct the Trunking Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://trunking.twilio.com'; } /** * @return V1 Version v1 of trunking */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trunking]'; } } sdk/src/Twilio/Rest/Chat.php 0000644 00000004031 15021223077 0011665 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Chat\V2; use Twilio\Rest\Chat\V3; class Chat extends ChatBase { /** * @deprecated Use v2->credentials instead. */ protected function getCredentials(): \Twilio\Rest\Chat\V2\CredentialList { echo "credentials is deprecated. Use v2->credentials instead."; return $this->v2->credentials; } /** * @deprecated Use v2->credentials(\$sid) instead. * @param string $sid The SID of the Credential resource to fetch */ protected function contextCredentials(string $sid): \Twilio\Rest\Chat\V2\CredentialContext { echo "credentials(\$sid) is deprecated. Use v2->credentials(\$sid) instead."; return $this->v2->credentials($sid); } /** * @deprecated Use v2->services instead. */ protected function getServices(): \Twilio\Rest\Chat\V2\ServiceList { echo "services is deprecated. Use v2->services instead."; return $this->v2->services; } /** * @deprecated Use v2->services(\$sid) instead. * @param string $sid The SID of the Service resource to fetch */ protected function contextServices(string $sid): \Twilio\Rest\Chat\V2\ServiceContext { echo "services(\$sid) is deprecated. Use v2->services(\$sid) instead."; return $this->v2->services($sid); } /** * @deprecated Use v3->channels instead. */ protected function getChannels(): \Twilio\Rest\Chat\V3\ChannelList { echo "channels is deprecated. Use v3->channels instead."; return $this->v3->channels; } /** * @deprecated Use v3->channels(\$serviceSid, \$sid) instead. * @param string $serviceSid Service Sid. * @param string $sid A string that uniquely identifies this Channel. */ protected function contextChannels(string $serviceSid, string $sid): \Twilio\Rest\Chat\V3\ChannelContext { echo "channels(\$serviceSid, \$sid) is deprecated. Use v3->channels(\$serviceSid, \$sid) instead."; return $this->v3->channels($serviceSid, $sid); } } sdk/src/Twilio/Rest/Pricing.php 0000644 00000004416 15021223077 0012410 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Pricing\V1; use Twilio\Rest\Pricing\V2; class Pricing extends PricingBase { /** * @deprecated Use v1->messaging instead. */ protected function getMessaging(): \Twilio\Rest\Pricing\V1\MessagingList { echo "messaging is deprecated. Use v1->messaging instead."; return $this->v1->messaging; } /** * @deprecated Use v1->phoneNumbers instead. */ protected function getPhoneNumbers(): \Twilio\Rest\Pricing\V1\PhoneNumberList { echo "phoneNumbers is deprecated. Use v1->phoneNumbers instead."; return $this->v1->phoneNumbers; } /** * @deprecated Use v2->voice instead. */ protected function getVoice(): \Twilio\Rest\Pricing\V2\VoiceList { echo "voice is deprecated. Use v2->voice instead."; return $this->v2->voice; } /** * @deprecated Use v2->countries instead. */ protected function getCountries(): \Twilio\Rest\Pricing\V2\CountryList { echo "countries is deprecated. Use v2->countries instead."; return $this->v2->countries; } /** * @deprecated Use v2->countries(\$isoCountry) instead. * @param string $isoCountry The ISO country code of the pricing information to * fetch */ protected function contextCountries(string $isoCountry): \Twilio\Rest\Pricing\V2\CountryContext { echo "countries(\$isoCountry) is deprecated. Use v2->countries(\$isoCountry) instead."; return $this->v2->countries($isoCountry); } /** * @deprecated Use v2->numbers instead. */ protected function getNumbers(): \Twilio\Rest\Pricing\V2\NumberList { echo "numbers is deprecated. Use v2->numbers instead."; return $this->v2->numbers; } /** * @deprecated Use v2->numbers(\$destinationNumber) instead. * @param string $destinationNumber The destination number for which to fetch * pricing information */ protected function contextNumbers(string $destinationNumber): \Twilio\Rest\Pricing\V2\NumberContext { echo "numbers(\$destinationNumber) is deprecated. Use v2->numbers(\$destinationNumber) instead."; return $this->v2->numbers($destinationNumber); } } sdk/src/Twilio/Rest/LookupsBase.php 0000644 00000005176 15021223077 0013250 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Lookups\V1; use Twilio\Rest\Lookups\V2; /** * @property \Twilio\Rest\Lookups\V1 $v1 * @property \Twilio\Rest\Lookups\V2 $v2 */ class LookupsBase extends Domain { protected $_v1; protected $_v2; /** * Construct the Lookups Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://lookups.twilio.com'; } /** * @return V1 Version v1 of lookups */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return V2 Version v2 of lookups */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Lookups]'; } } sdk/src/Twilio/Rest/Microvisor.php 0000644 00000002373 15021223077 0013151 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Microvisor\V1; class Microvisor extends MicrovisorBase { /** * @deprecated Use v1->apps instead. */ protected function getApps(): \Twilio\Rest\Microvisor\V1\AppList { echo "apps is deprecated. Use v1->apps instead."; return $this->v1->apps; } /** * @deprecated Use v1->apps(\$sid) instead. * @param string $sid A string that uniquely identifies this App. */ protected function contextApps(string $sid): \Twilio\Rest\Microvisor\V1\AppContext { echo "apps(\$sid) is deprecated. Use v1->apps(\$sid) instead."; return $this->v1->apps($sid); } /** * @deprecated Use v1->devices instead. */ protected function getDevices(): \Twilio\Rest\Microvisor\V1\DeviceList { echo "devices is deprecated. Use v1->devices instead."; return $this->v1->devices; } /** * @deprecated Use v1->devices(\$sid) instead. * @param string $sid A string that uniquely identifies this Device. */ protected function contextDevices(string $sid): \Twilio\Rest\Microvisor\V1\DeviceContext { echo "devices(\$sid) is deprecated. Use v1->devices(\$sid) instead."; return $this->v1->devices($sid); } } sdk/src/Twilio/Rest/PricingBase.php 0000644 00000005176 15021223077 0013207 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Pricing\V1; use Twilio\Rest\Pricing\V2; /** * @property \Twilio\Rest\Pricing\V1 $v1 * @property \Twilio\Rest\Pricing\V2 $v2 */ class PricingBase extends Domain { protected $_v1; protected $_v2; /** * Construct the Pricing Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://pricing.twilio.com'; } /** * @return V1 Version v1 of pricing */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return V2 Version v2 of pricing */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Pricing]'; } } sdk/src/Twilio/Rest/Studio.php 0000644 00000001646 15021223077 0012266 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Studio\V2; class Studio extends StudioBase { /** * @deprecated Use v2->flows instead. */ protected function getFlows(): \Twilio\Rest\Studio\V2\FlowList { echo "flows is deprecated. Use v2->flows instead."; return $this->v2->flows; } /** * @deprecated Use v2->flows(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextFlows(string $sid): \Twilio\Rest\Studio\V2\FlowContext { echo "flows(\$sid) is deprecated. Use v2->flows(\$sid) instead."; return $this->v2->flows($sid); } /** * @deprecated Use v2->flowValidate instead. */ protected function getFlowValidate(): \Twilio\Rest\Studio\V2\FlowValidateList { echo "flowValidate is deprecated. Use v2->flowValidate instead."; return $this->v2->flowValidate; } } sdk/src/Twilio/Rest/Verify/V2/Service/EntityPage.php 0000644 00000003063 15021223077 0016216 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EntityPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return EntityInstance \Twilio\Rest\Verify\V2\Service\EntityInstance */ public function buildInstance(array $payload): EntityInstance { return new EntityInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.EntityPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/EntityList.php 0000644 00000014667 15021223077 0016271 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class EntityList extends ListResource { /** * Construct the EntityList * * @param Version $version Version that contains the resource * @param string $serviceSid The unique SID identifier of the Service. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities'; } /** * Create the EntityInstance * * @param string $identity The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. * @return EntityInstance Created EntityInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity): EntityInstance { $data = Values::of([ 'Identity' => $identity, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new EntityInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads EntityInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EntityInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams EntityInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EntityInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EntityPage Page of EntityInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EntityPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EntityPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EntityInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EntityPage Page of EntityInstance */ public function getPage(string $targetUrl): EntityPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EntityPage($this->version, $response, $this->solution); } /** * Constructs a EntityContext * * @param string $identity The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. */ public function getContext( string $identity ): EntityContext { return new EntityContext( $this->version, $this->solution['serviceSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.EntityList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationOptions.php 0000644 00000044501 15021223077 0020145 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Options; use Twilio\Values; abstract class VerificationOptions { /** * @param string $customFriendlyName A custom user defined friendly name that overwrites the existing one in the verification message * @param string $customMessage The text of a custom message to use for the verification. * @param string $sendDigits The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits). * @param string $locale Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages). * @param string $customCode A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive. * @param string $amount The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @param string $payee The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @param array $rateLimits The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request. * @param array $channelConfiguration [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address. * @param string $appHash Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`. * @param string $templateSid The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. * @param string $templateCustomSubstitutions A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. * @param string $deviceIp Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. * @param string $riskCheck * @param string $tags A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. * @return CreateVerificationOptions Options builder */ public static function create( string $customFriendlyName = Values::NONE, string $customMessage = Values::NONE, string $sendDigits = Values::NONE, string $locale = Values::NONE, string $customCode = Values::NONE, string $amount = Values::NONE, string $payee = Values::NONE, array $rateLimits = Values::ARRAY_NONE, array $channelConfiguration = Values::ARRAY_NONE, string $appHash = Values::NONE, string $templateSid = Values::NONE, string $templateCustomSubstitutions = Values::NONE, string $deviceIp = Values::NONE, string $riskCheck = Values::NONE, string $tags = Values::NONE ): CreateVerificationOptions { return new CreateVerificationOptions( $customFriendlyName, $customMessage, $sendDigits, $locale, $customCode, $amount, $payee, $rateLimits, $channelConfiguration, $appHash, $templateSid, $templateCustomSubstitutions, $deviceIp, $riskCheck, $tags ); } } class CreateVerificationOptions extends Options { /** * @param string $customFriendlyName A custom user defined friendly name that overwrites the existing one in the verification message * @param string $customMessage The text of a custom message to use for the verification. * @param string $sendDigits The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits). * @param string $locale Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages). * @param string $customCode A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive. * @param string $amount The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @param string $payee The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @param array $rateLimits The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request. * @param array $channelConfiguration [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address. * @param string $appHash Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`. * @param string $templateSid The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. * @param string $templateCustomSubstitutions A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. * @param string $deviceIp Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. * @param string $riskCheck * @param string $tags A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. */ public function __construct( string $customFriendlyName = Values::NONE, string $customMessage = Values::NONE, string $sendDigits = Values::NONE, string $locale = Values::NONE, string $customCode = Values::NONE, string $amount = Values::NONE, string $payee = Values::NONE, array $rateLimits = Values::ARRAY_NONE, array $channelConfiguration = Values::ARRAY_NONE, string $appHash = Values::NONE, string $templateSid = Values::NONE, string $templateCustomSubstitutions = Values::NONE, string $deviceIp = Values::NONE, string $riskCheck = Values::NONE, string $tags = Values::NONE ) { $this->options['customFriendlyName'] = $customFriendlyName; $this->options['customMessage'] = $customMessage; $this->options['sendDigits'] = $sendDigits; $this->options['locale'] = $locale; $this->options['customCode'] = $customCode; $this->options['amount'] = $amount; $this->options['payee'] = $payee; $this->options['rateLimits'] = $rateLimits; $this->options['channelConfiguration'] = $channelConfiguration; $this->options['appHash'] = $appHash; $this->options['templateSid'] = $templateSid; $this->options['templateCustomSubstitutions'] = $templateCustomSubstitutions; $this->options['deviceIp'] = $deviceIp; $this->options['riskCheck'] = $riskCheck; $this->options['tags'] = $tags; } /** * A custom user defined friendly name that overwrites the existing one in the verification message * * @param string $customFriendlyName A custom user defined friendly name that overwrites the existing one in the verification message * @return $this Fluent Builder */ public function setCustomFriendlyName(string $customFriendlyName): self { $this->options['customFriendlyName'] = $customFriendlyName; return $this; } /** * The text of a custom message to use for the verification. * * @param string $customMessage The text of a custom message to use for the verification. * @return $this Fluent Builder */ public function setCustomMessage(string $customMessage): self { $this->options['customMessage'] = $customMessage; return $this; } /** * The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits). * * @param string $sendDigits The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits). * @return $this Fluent Builder */ public function setSendDigits(string $sendDigits): self { $this->options['sendDigits'] = $sendDigits; return $this; } /** * Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages). * * @param string $locale Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages). * @return $this Fluent Builder */ public function setLocale(string $locale): self { $this->options['locale'] = $locale; return $this; } /** * A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive. * * @param string $customCode A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive. * @return $this Fluent Builder */ public function setCustomCode(string $customCode): self { $this->options['customCode'] = $customCode; return $this; } /** * The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * * @param string $amount The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @return $this Fluent Builder */ public function setAmount(string $amount): self { $this->options['amount'] = $amount; return $this; } /** * The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * * @param string $payee The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @return $this Fluent Builder */ public function setPayee(string $payee): self { $this->options['payee'] = $payee; return $this; } /** * The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request. * * @param array $rateLimits The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request. * @return $this Fluent Builder */ public function setRateLimits(array $rateLimits): self { $this->options['rateLimits'] = $rateLimits; return $this; } /** * [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address. * * @param array $channelConfiguration [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address. * @return $this Fluent Builder */ public function setChannelConfiguration(array $channelConfiguration): self { $this->options['channelConfiguration'] = $channelConfiguration; return $this; } /** * Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`. * * @param string $appHash Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`. * @return $this Fluent Builder */ public function setAppHash(string $appHash): self { $this->options['appHash'] = $appHash; return $this; } /** * The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. * * @param string $templateSid The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. * @return $this Fluent Builder */ public function setTemplateSid(string $templateSid): self { $this->options['templateSid'] = $templateSid; return $this; } /** * A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. * * @param string $templateCustomSubstitutions A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. * @return $this Fluent Builder */ public function setTemplateCustomSubstitutions(string $templateCustomSubstitutions): self { $this->options['templateCustomSubstitutions'] = $templateCustomSubstitutions; return $this; } /** * Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. * * @param string $deviceIp Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. * @return $this Fluent Builder */ public function setDeviceIp(string $deviceIp): self { $this->options['deviceIp'] = $deviceIp; return $this; } /** * @param string $riskCheck * @return $this Fluent Builder */ public function setRiskCheck(string $riskCheck): self { $this->options['riskCheck'] = $riskCheck; return $this; } /** * A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. * * @param string $tags A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. * @return $this Fluent Builder */ public function setTags(string $tags): self { $this->options['tags'] = $tags; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateVerificationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/WebhookInstance.php 0000644 00000012076 15021223077 0017234 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $serviceSid * @property string|null $accountSid * @property string|null $friendlyName * @property string[]|null $eventTypes * @property string $status * @property string $version * @property string|null $webhookUrl * @property string $webhookMethod * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The unique SID identifier of the Service. * @param string $sid The Twilio-provided string that uniquely identifies the Webhook resource to delete. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'eventTypes' => Values::array_get($payload, 'event_types'), 'status' => Values::array_get($payload, 'status'), 'version' => Values::array_get($payload, 'version'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WebhookContext Context for this WebhookInstance */ protected function proxy(): WebhookContext { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationContext.php 0000644 00000007402 15021223077 0022160 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class MessagingConfigurationContext extends InstanceContext { /** * Initialize the MessagingConfigurationContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/verify/api/service) that the resource is associated with. * @param string $country The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`. */ public function __construct( Version $version, $serviceSid, $country ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'country' => $country, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/MessagingConfigurations/' . \rawurlencode($country) .''; } /** * Delete the MessagingConfigurationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the MessagingConfigurationInstance * * @return MessagingConfigurationInstance Fetched MessagingConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessagingConfigurationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessagingConfigurationInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['country'] ); } /** * Update the MessagingConfigurationInstance * * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration. * @return MessagingConfigurationInstance Updated MessagingConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $messagingServiceSid): MessagingConfigurationInstance { $data = Values::of([ 'MessagingServiceSid' => $messagingServiceSid, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new MessagingConfigurationInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['country'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.MessagingConfigurationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckList.php 0000644 00000004771 15021223077 0020370 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class VerificationCheckList extends ListResource { /** * Construct the VerificationCheckList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the verification [Service](https://www.twilio.com/docs/verify/api/service) to create the resource under. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/VerificationCheck'; } /** * Create the VerificationCheckInstance * * @param array|Options $options Optional Arguments * @return VerificationCheckInstance Created VerificationCheckInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): VerificationCheckInstance { $options = new Values($options); $data = Values::of([ 'Code' => $options['code'], 'To' => $options['to'], 'VerificationSid' => $options['verificationSid'], 'Amount' => $options['amount'], 'Payee' => $options['payee'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new VerificationCheckInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationCheckList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketPage.php 0000644 00000003150 15021223077 0020046 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\RateLimit; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BucketPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return BucketInstance \Twilio\Rest\Verify\V2\Service\RateLimit\BucketInstance */ public function buildInstance(array $payload): BucketInstance { return new BucketInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.BucketPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketContext.php 0000644 00000007213 15021223077 0020622 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\RateLimit; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class BucketContext extends InstanceContext { /** * Initialize the BucketContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with. * @param string $rateLimitSid The Twilio-provided string that uniquely identifies the Rate Limit resource. * @param string $sid A 34 character string that uniquely identifies this Bucket. */ public function __construct( Version $version, $serviceSid, $rateLimitSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'rateLimitSid' => $rateLimitSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/RateLimits/' . \rawurlencode($rateLimitSid) .'/Buckets/' . \rawurlencode($sid) .''; } /** * Delete the BucketInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the BucketInstance * * @return BucketInstance Fetched BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BucketInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new BucketInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid'], $this->solution['sid'] ); } /** * Update the BucketInstance * * @param array|Options $options Optional Arguments * @return BucketInstance Updated BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): BucketInstance { $options = new Values($options); $data = Values::of([ 'Max' => $options['max'], 'Interval' => $options['interval'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new BucketInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.BucketContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketOptions.php 0000644 00000005036 15021223077 0020632 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\RateLimit; use Twilio\Options; use Twilio\Values; abstract class BucketOptions { /** * @param int $max Maximum number of requests permitted in during the interval. * @param int $interval Number of seconds that the rate limit will be enforced over. * @return UpdateBucketOptions Options builder */ public static function update( int $max = Values::INT_NONE, int $interval = Values::INT_NONE ): UpdateBucketOptions { return new UpdateBucketOptions( $max, $interval ); } } class UpdateBucketOptions extends Options { /** * @param int $max Maximum number of requests permitted in during the interval. * @param int $interval Number of seconds that the rate limit will be enforced over. */ public function __construct( int $max = Values::INT_NONE, int $interval = Values::INT_NONE ) { $this->options['max'] = $max; $this->options['interval'] = $interval; } /** * Maximum number of requests permitted in during the interval. * * @param int $max Maximum number of requests permitted in during the interval. * @return $this Fluent Builder */ public function setMax(int $max): self { $this->options['max'] = $max; return $this; } /** * Number of seconds that the rate limit will be enforced over. * * @param int $interval Number of seconds that the rate limit will be enforced over. * @return $this Fluent Builder */ public function setInterval(int $interval): self { $this->options['interval'] = $interval; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.UpdateBucketOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketInstance.php 0000644 00000011752 15021223077 0020745 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\RateLimit; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $rateLimitSid * @property string|null $serviceSid * @property string|null $accountSid * @property int|null $max * @property int|null $interval * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class BucketInstance extends InstanceResource { /** * Initialize the BucketInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with. * @param string $rateLimitSid The Twilio-provided string that uniquely identifies the Rate Limit resource. * @param string $sid A 34 character string that uniquely identifies this Bucket. */ public function __construct(Version $version, array $payload, string $serviceSid, string $rateLimitSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'rateLimitSid' => Values::array_get($payload, 'rate_limit_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'max' => Values::array_get($payload, 'max'), 'interval' => Values::array_get($payload, 'interval'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'rateLimitSid' => $rateLimitSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BucketContext Context for this BucketInstance */ protected function proxy(): BucketContext { if (!$this->context) { $this->context = new BucketContext( $this->version, $this->solution['serviceSid'], $this->solution['rateLimitSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the BucketInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the BucketInstance * * @return BucketInstance Fetched BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BucketInstance { return $this->proxy()->fetch(); } /** * Update the BucketInstance * * @param array|Options $options Optional Arguments * @return BucketInstance Updated BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): BucketInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.BucketInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketList.php 0000644 00000015014 15021223077 0020107 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\RateLimit; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class BucketList extends ListResource { /** * Construct the BucketList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with. * @param string $rateLimitSid The Twilio-provided string that uniquely identifies the Rate Limit resource. */ public function __construct( Version $version, string $serviceSid, string $rateLimitSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'rateLimitSid' => $rateLimitSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/RateLimits/' . \rawurlencode($rateLimitSid) .'/Buckets'; } /** * Create the BucketInstance * * @param int $max Maximum number of requests permitted in during the interval. * @param int $interval Number of seconds that the rate limit will be enforced over. * @return BucketInstance Created BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function create(int $max, int $interval): BucketInstance { $data = Values::of([ 'Max' => $max, 'Interval' => $interval, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new BucketInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid'] ); } /** * Reads BucketInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BucketInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams BucketInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BucketInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BucketPage Page of BucketInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BucketPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BucketPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BucketInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BucketPage Page of BucketInstance */ public function getPage(string $targetUrl): BucketPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BucketPage($this->version, $response, $this->solution); } /** * Constructs a BucketContext * * @param string $sid A 34 character string that uniquely identifies this Bucket. */ public function getContext( string $sid ): BucketContext { return new BucketContext( $this->version, $this->solution['serviceSid'], $this->solution['rateLimitSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.BucketList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/EntityInstance.php 0000644 00000012252 15021223077 0017106 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Verify\V2\Service\Entity\FactorList; use Twilio\Rest\Verify\V2\Service\Entity\NewFactorList; use Twilio\Rest\Verify\V2\Service\Entity\ChallengeList; /** * @property string|null $sid * @property string|null $identity * @property string|null $accountSid * @property string|null $serviceSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class EntityInstance extends InstanceResource { protected $_factors; protected $_newFactors; protected $_challenges; /** * Initialize the EntityInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The unique SID identifier of the Service. * @param string $identity The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. */ public function __construct(Version $version, array $payload, string $serviceSid, string $identity = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'identity' => Values::array_get($payload, 'identity'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity ?: $this->properties['identity'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EntityContext Context for this EntityInstance */ protected function proxy(): EntityContext { if (!$this->context) { $this->context = new EntityContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->context; } /** * Delete the EntityInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the EntityInstance * * @return EntityInstance Fetched EntityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EntityInstance { return $this->proxy()->fetch(); } /** * Access the factors */ protected function getFactors(): FactorList { return $this->proxy()->factors; } /** * Access the newFactors */ protected function getNewFactors(): NewFactorList { return $this->proxy()->newFactors; } /** * Access the challenges */ protected function getChallenges(): ChallengeList { return $this->proxy()->challenges; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.EntityInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationInstance.php 0000644 00000012177 15021223077 0020262 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $serviceSid * @property string|null $accountSid * @property string|null $to * @property string $channel * @property string|null $status * @property bool|null $valid * @property array|null $lookup * @property string|null $amount * @property string|null $payee * @property array[]|null $sendCodeAttempts * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property array|null $sna * @property string|null $url */ class VerificationInstance extends InstanceResource { /** * Initialize the VerificationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the verification [Service](https://www.twilio.com/docs/verify/api/service) to create the resource under. * @param string $sid The Twilio-provided string that uniquely identifies the Verification resource to fetch. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'to' => Values::array_get($payload, 'to'), 'channel' => Values::array_get($payload, 'channel'), 'status' => Values::array_get($payload, 'status'), 'valid' => Values::array_get($payload, 'valid'), 'lookup' => Values::array_get($payload, 'lookup'), 'amount' => Values::array_get($payload, 'amount'), 'payee' => Values::array_get($payload, 'payee'), 'sendCodeAttempts' => Values::array_get($payload, 'send_code_attempts'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sna' => Values::array_get($payload, 'sna'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return VerificationContext Context for this VerificationInstance */ protected function proxy(): VerificationContext { if (!$this->context) { $this->context = new VerificationContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the VerificationInstance * * @return VerificationInstance Fetched VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): VerificationInstance { return $this->proxy()->fetch(); } /** * Update the VerificationInstance * * @param string $status * @return VerificationInstance Updated VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): VerificationInstance { return $this->proxy()->update($status); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.VerificationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitPage.php 0000644 00000003105 15021223077 0016631 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RateLimitPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RateLimitInstance \Twilio\Rest\Verify\V2\Service\RateLimitInstance */ public function buildInstance(array $payload): RateLimitInstance { return new RateLimitInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.RateLimitPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckPage.php 0000644 00000003165 15021223077 0020325 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class VerificationCheckPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return VerificationCheckInstance \Twilio\Rest\Verify\V2\Service\VerificationCheckInstance */ public function buildInstance(array $payload): VerificationCheckInstance { return new VerificationCheckInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationCheckPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationPage.php 0000644 00000003223 15021223077 0021405 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagingConfigurationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MessagingConfigurationInstance \Twilio\Rest\Verify\V2\Service\MessagingConfigurationInstance */ public function buildInstance(array $payload): MessagingConfigurationInstance { return new MessagingConfigurationInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.MessagingConfigurationPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationPage.php 0000644 00000003127 15021223077 0017365 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class VerificationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return VerificationInstance \Twilio\Rest\Verify\V2\Service\VerificationInstance */ public function buildInstance(array $payload): VerificationInstance { return new VerificationInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorInstance.php 0000644 00000013003 15021223077 0020317 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $entitySid * @property string|null $identity * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string $status * @property string $factorType * @property array|null $config * @property array|null $metadata * @property string|null $url */ class FactorInstance extends InstanceResource { /** * Initialize the FactorInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The unique SID identifier of the Service. * @param string $identity Customer unique identity for the Entity owner of the Factor. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. * @param string $sid A 34 character string that uniquely identifies this Factor. */ public function __construct(Version $version, array $payload, string $serviceSid, string $identity, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'entitySid' => Values::array_get($payload, 'entity_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'factorType' => Values::array_get($payload, 'factor_type'), 'config' => Values::array_get($payload, 'config'), 'metadata' => Values::array_get($payload, 'metadata'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FactorContext Context for this FactorInstance */ protected function proxy(): FactorContext { if (!$this->context) { $this->context = new FactorContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } return $this->context; } /** * Delete the FactorInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the FactorInstance * * @return FactorInstance Fetched FactorInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FactorInstance { return $this->proxy()->fetch(); } /** * Update the FactorInstance * * @param array|Options $options Optional Arguments * @return FactorInstance Updated FactorInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FactorInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.FactorInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeList.php 0000644 00000017163 15021223077 0020145 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ChallengeList extends ListResource { /** * Construct the ChallengeList * * @param Version $version Version that contains the resource * @param string $serviceSid The unique SID identifier of the Service. * @param string $identity Customer unique identity for the Entity owner of the Challenge. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. */ public function __construct( Version $version, string $serviceSid, string $identity ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities/' . \rawurlencode($identity) .'/Challenges'; } /** * Create the ChallengeInstance * * @param string $factorSid The unique SID identifier of the Factor. * @param array|Options $options Optional Arguments * @return ChallengeInstance Created ChallengeInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $factorSid, array $options = []): ChallengeInstance { $options = new Values($options); $data = Values::of([ 'FactorSid' => $factorSid, 'ExpirationDate' => Serialize::iso8601DateTime($options['expirationDate']), 'Details.Message' => $options['detailsMessage'], 'Details.Fields' => Serialize::map($options['detailsFields'], function ($e) { return Serialize::jsonObject($e); }), 'HiddenDetails' => Serialize::jsonObject($options['hiddenDetails']), 'AuthPayload' => $options['authPayload'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ChallengeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'] ); } /** * Reads ChallengeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChallengeInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ChallengeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ChallengeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ChallengePage Page of ChallengeInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ChallengePage { $options = new Values($options); $params = Values::of([ 'FactorSid' => $options['factorSid'], 'Status' => $options['status'], 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChallengePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChallengeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ChallengePage Page of ChallengeInstance */ public function getPage(string $targetUrl): ChallengePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChallengePage($this->version, $response, $this->solution); } /** * Constructs a ChallengeContext * * @param string $sid A 34 character string that uniquely identifies this Challenge. */ public function getContext( string $sid ): ChallengeContext { return new ChallengeContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.ChallengeList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorInstance.php 0000644 00000007531 15021223077 0021002 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $entitySid * @property string|null $identity * @property array|null $binding * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $friendlyName * @property string $status * @property string $factorType * @property array|null $config * @property array|null $metadata * @property string|null $url */ class NewFactorInstance extends InstanceResource { /** * Initialize the NewFactorInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The unique SID identifier of the Service. * @param string $identity Customer unique identity for the Entity owner of the Factor. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. */ public function __construct(Version $version, array $payload, string $serviceSid, string $identity) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'entitySid' => Values::array_get($payload, 'entity_sid'), 'identity' => Values::array_get($payload, 'identity'), 'binding' => Values::array_get($payload, 'binding'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'factorType' => Values::array_get($payload, 'factor_type'), 'config' => Values::array_get($payload, 'config'), 'metadata' => Values::array_get($payload, 'metadata'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.NewFactorInstance]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengePage.php 0000644 00000003160 15021223077 0020076 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ChallengePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ChallengeInstance \Twilio\Rest\Verify\V2\Service\Entity\ChallengeInstance */ public function buildInstance(array $payload): ChallengeInstance { return new ChallengeInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.ChallengePage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorOptions.php 0000644 00000023146 15021223077 0020217 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity; use Twilio\Options; use Twilio\Values; abstract class FactorOptions { /** * @param string $authPayload The optional payload needed to verify the Factor for the first time. E.g. for a TOTP, the numeric code. * @param string $friendlyName The new friendly name of this Factor. It can be up to 64 characters. * @param string $configNotificationToken For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Required when `factor_type` is `push`. If specified, this value must be between 32 and 255 characters long. * @param string $configSdkVersion The Verify Push SDK version used to configure the factor * @param int $configTimeStep Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive * @param int $configSkew The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive * @param int $configCodeLength Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive * @param string $configAlg * @param string $configNotificationPlatform The transport technology used to generate the Notification Token. Can be `apn`, `fcm` or `none`. Required when `factor_type` is `push`. * @return UpdateFactorOptions Options builder */ public static function update( string $authPayload = Values::NONE, string $friendlyName = Values::NONE, string $configNotificationToken = Values::NONE, string $configSdkVersion = Values::NONE, int $configTimeStep = Values::INT_NONE, int $configSkew = Values::INT_NONE, int $configCodeLength = Values::INT_NONE, string $configAlg = Values::NONE, string $configNotificationPlatform = Values::NONE ): UpdateFactorOptions { return new UpdateFactorOptions( $authPayload, $friendlyName, $configNotificationToken, $configSdkVersion, $configTimeStep, $configSkew, $configCodeLength, $configAlg, $configNotificationPlatform ); } } class UpdateFactorOptions extends Options { /** * @param string $authPayload The optional payload needed to verify the Factor for the first time. E.g. for a TOTP, the numeric code. * @param string $friendlyName The new friendly name of this Factor. It can be up to 64 characters. * @param string $configNotificationToken For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Required when `factor_type` is `push`. If specified, this value must be between 32 and 255 characters long. * @param string $configSdkVersion The Verify Push SDK version used to configure the factor * @param int $configTimeStep Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive * @param int $configSkew The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive * @param int $configCodeLength Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive * @param string $configAlg * @param string $configNotificationPlatform The transport technology used to generate the Notification Token. Can be `apn`, `fcm` or `none`. Required when `factor_type` is `push`. */ public function __construct( string $authPayload = Values::NONE, string $friendlyName = Values::NONE, string $configNotificationToken = Values::NONE, string $configSdkVersion = Values::NONE, int $configTimeStep = Values::INT_NONE, int $configSkew = Values::INT_NONE, int $configCodeLength = Values::INT_NONE, string $configAlg = Values::NONE, string $configNotificationPlatform = Values::NONE ) { $this->options['authPayload'] = $authPayload; $this->options['friendlyName'] = $friendlyName; $this->options['configNotificationToken'] = $configNotificationToken; $this->options['configSdkVersion'] = $configSdkVersion; $this->options['configTimeStep'] = $configTimeStep; $this->options['configSkew'] = $configSkew; $this->options['configCodeLength'] = $configCodeLength; $this->options['configAlg'] = $configAlg; $this->options['configNotificationPlatform'] = $configNotificationPlatform; } /** * The optional payload needed to verify the Factor for the first time. E.g. for a TOTP, the numeric code. * * @param string $authPayload The optional payload needed to verify the Factor for the first time. E.g. for a TOTP, the numeric code. * @return $this Fluent Builder */ public function setAuthPayload(string $authPayload): self { $this->options['authPayload'] = $authPayload; return $this; } /** * The new friendly name of this Factor. It can be up to 64 characters. * * @param string $friendlyName The new friendly name of this Factor. It can be up to 64 characters. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Required when `factor_type` is `push`. If specified, this value must be between 32 and 255 characters long. * * @param string $configNotificationToken For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Required when `factor_type` is `push`. If specified, this value must be between 32 and 255 characters long. * @return $this Fluent Builder */ public function setConfigNotificationToken(string $configNotificationToken): self { $this->options['configNotificationToken'] = $configNotificationToken; return $this; } /** * The Verify Push SDK version used to configure the factor * * @param string $configSdkVersion The Verify Push SDK version used to configure the factor * @return $this Fluent Builder */ public function setConfigSdkVersion(string $configSdkVersion): self { $this->options['configSdkVersion'] = $configSdkVersion; return $this; } /** * Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive * * @param int $configTimeStep Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive * @return $this Fluent Builder */ public function setConfigTimeStep(int $configTimeStep): self { $this->options['configTimeStep'] = $configTimeStep; return $this; } /** * The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive * * @param int $configSkew The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive * @return $this Fluent Builder */ public function setConfigSkew(int $configSkew): self { $this->options['configSkew'] = $configSkew; return $this; } /** * Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive * * @param int $configCodeLength Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive * @return $this Fluent Builder */ public function setConfigCodeLength(int $configCodeLength): self { $this->options['configCodeLength'] = $configCodeLength; return $this; } /** * @param string $configAlg * @return $this Fluent Builder */ public function setConfigAlg(string $configAlg): self { $this->options['configAlg'] = $configAlg; return $this; } /** * The transport technology used to generate the Notification Token. Can be `apn`, `fcm` or `none`. Required when `factor_type` is `push`. * * @param string $configNotificationPlatform The transport technology used to generate the Notification Token. Can be `apn`, `fcm` or `none`. Required when `factor_type` is `push`. * @return $this Fluent Builder */ public function setConfigNotificationPlatform(string $configNotificationPlatform): self { $this->options['configNotificationPlatform'] = $configNotificationPlatform; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.UpdateFactorOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorList.php 0000644 00000010067 15021223077 0020147 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class NewFactorList extends ListResource { /** * Construct the NewFactorList * * @param Version $version Version that contains the resource * @param string $serviceSid The unique SID identifier of the Service. * @param string $identity Customer unique identity for the Entity owner of the Factor. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. */ public function __construct( Version $version, string $serviceSid, string $identity ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities/' . \rawurlencode($identity) .'/Factors'; } /** * Create the NewFactorInstance * * @param string $friendlyName The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors. For `factor_type` `push`, this could be a device name. For `factor_type` `totp`, this value is used as the “account name” in constructing the `binding.uri` property. At the same time, we recommend avoiding providing PII. * @param string $factorType * @param array|Options $options Optional Arguments * @return NewFactorInstance Created NewFactorInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $factorType, array $options = []): NewFactorInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'FactorType' => $factorType, 'Binding.Alg' => $options['bindingAlg'], 'Binding.PublicKey' => $options['bindingPublicKey'], 'Config.AppId' => $options['configAppId'], 'Config.NotificationPlatform' => $options['configNotificationPlatform'], 'Config.NotificationToken' => $options['configNotificationToken'], 'Config.SdkVersion' => $options['configSdkVersion'], 'Binding.Secret' => $options['bindingSecret'], 'Config.TimeStep' => $options['configTimeStep'], 'Config.Skew' => $options['configSkew'], 'Config.CodeLength' => $options['configCodeLength'], 'Config.Alg' => $options['configAlg'], 'Metadata' => Serialize::jsonObject($options['metadata']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new NewFactorInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.NewFactorList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeContext.php 0000644 00000012446 15021223077 0020655 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Verify\V2\Service\Entity\Challenge\NotificationList; /** * @property NotificationList $notifications */ class ChallengeContext extends InstanceContext { protected $_notifications; /** * Initialize the ChallengeContext * * @param Version $version Version that contains the resource * @param string $serviceSid The unique SID identifier of the Service. * @param string $identity Customer unique identity for the Entity owner of the Challenge. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. * @param string $sid A 34 character string that uniquely identifies this Challenge. */ public function __construct( Version $version, $serviceSid, $identity, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'identity' => $identity, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities/' . \rawurlencode($identity) .'/Challenges/' . \rawurlencode($sid) .''; } /** * Fetch the ChallengeInstance * * @return ChallengeInstance Fetched ChallengeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChallengeInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ChallengeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } /** * Update the ChallengeInstance * * @param array|Options $options Optional Arguments * @return ChallengeInstance Updated ChallengeInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChallengeInstance { $options = new Values($options); $data = Values::of([ 'AuthPayload' => $options['authPayload'], 'Metadata' => Serialize::jsonObject($options['metadata']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ChallengeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } /** * Access the notifications */ protected function getNotifications(): NotificationList { if (!$this->_notifications) { $this->_notifications = new NotificationList( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } return $this->_notifications; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.ChallengeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationInstance.php 0000644 00000006745 15021223077 0023430 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity\Challenge; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $entitySid * @property string|null $identity * @property string|null $challengeSid * @property string|null $priority * @property int|null $ttl * @property \DateTime|null $dateCreated */ class NotificationInstance extends InstanceResource { /** * Initialize the NotificationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The unique SID identifier of the Service. * @param string $identity Customer unique identity for the Entity owner of the Challenge. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. * @param string $challengeSid The unique SID identifier of the Challenge. */ public function __construct(Version $version, array $payload, string $serviceSid, string $identity, string $challengeSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'entitySid' => Values::array_get($payload, 'entity_sid'), 'identity' => Values::array_get($payload, 'identity'), 'challengeSid' => Values::array_get($payload, 'challenge_sid'), 'priority' => Values::array_get($payload, 'priority'), 'ttl' => Values::array_get($payload, 'ttl'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), ]; $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity, 'challengeSid' => $challengeSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.NotificationInstance]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationOptions.php 0000644 00000005464 15021223077 0023314 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity\Challenge; use Twilio\Options; use Twilio\Values; abstract class NotificationOptions { /** * @param int $ttl How long, in seconds, the notification is valid. Can be an integer between 0 and 300. Default is 300. Delivery is attempted until the TTL elapses, even if the device is offline. 0 means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. * @return CreateNotificationOptions Options builder */ public static function create( int $ttl = Values::INT_NONE ): CreateNotificationOptions { return new CreateNotificationOptions( $ttl ); } } class CreateNotificationOptions extends Options { /** * @param int $ttl How long, in seconds, the notification is valid. Can be an integer between 0 and 300. Default is 300. Delivery is attempted until the TTL elapses, even if the device is offline. 0 means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. */ public function __construct( int $ttl = Values::INT_NONE ) { $this->options['ttl'] = $ttl; } /** * How long, in seconds, the notification is valid. Can be an integer between 0 and 300. Default is 300. Delivery is attempted until the TTL elapses, even if the device is offline. 0 means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. * * @param int $ttl How long, in seconds, the notification is valid. Can be an integer between 0 and 300. Default is 300. Delivery is attempted until the TTL elapses, even if the device is offline. 0 means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateNotificationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationList.php 0000644 00000005623 15021223077 0022571 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity\Challenge; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class NotificationList extends ListResource { /** * Construct the NotificationList * * @param Version $version Version that contains the resource * @param string $serviceSid The unique SID identifier of the Service. * @param string $identity Customer unique identity for the Entity owner of the Challenge. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. * @param string $challengeSid The unique SID identifier of the Challenge. */ public function __construct( Version $version, string $serviceSid, string $identity, string $challengeSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'identity' => $identity, 'challengeSid' => $challengeSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities/' . \rawurlencode($identity) .'/Challenges/' . \rawurlencode($challengeSid) .'/Notifications'; } /** * Create the NotificationInstance * * @param array|Options $options Optional Arguments * @return NotificationInstance Created NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): NotificationInstance { $options = new Values($options); $data = Values::of([ 'Ttl' => $options['ttl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new NotificationInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['challengeSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.NotificationList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationPage.php 0000644 00000003267 15021223077 0022534 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity\Challenge; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NotificationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return NotificationInstance \Twilio\Rest\Verify\V2\Service\Entity\Challenge\NotificationInstance */ public function buildInstance(array $payload): NotificationInstance { return new NotificationInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['challengeSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.NotificationPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorOptions.php 0000644 00000035513 15021223077 0020672 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity; use Twilio\Options; use Twilio\Values; abstract class NewFactorOptions { /** * @param string $bindingAlg The algorithm used when `factor_type` is `push`. Algorithm supported: `ES256` * @param string $bindingPublicKey The Ecdsa public key in PKIX, ASN.1 DER format encoded in Base64. Required when `factor_type` is `push` * @param string $configAppId The ID that uniquely identifies your app in the Google or Apple store, such as `com.example.myapp`. It can be up to 100 characters long. Required when `factor_type` is `push`. * @param string $configNotificationPlatform * @param string $configNotificationToken For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Must be between 32 and 255 characters long. Required when `factor_type` is `push`. * @param string $configSdkVersion The Verify Push SDK version used to configure the factor Required when `factor_type` is `push` * @param string $bindingSecret The shared secret for TOTP factors encoded in Base32. This can be provided when creating the Factor, otherwise it will be generated. Used when `factor_type` is `totp` * @param int $configTimeStep Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. The default value is defined at the service level in the property `totp.time_step`. Defaults to 30 seconds if not configured. Used when `factor_type` is `totp` * @param int $configSkew The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The default value is defined at the service level in the property `totp.skew`. If not configured defaults to 1. Used when `factor_type` is `totp` * @param int $configCodeLength Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. The default value is defined at the service level in the property `totp.code_length`. If not configured defaults to 6. Used when `factor_type` is `totp` * @param string $configAlg * @param array $metadata Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. * @return CreateNewFactorOptions Options builder */ public static function create( string $bindingAlg = Values::NONE, string $bindingPublicKey = Values::NONE, string $configAppId = Values::NONE, string $configNotificationPlatform = Values::NONE, string $configNotificationToken = Values::NONE, string $configSdkVersion = Values::NONE, string $bindingSecret = Values::NONE, int $configTimeStep = Values::INT_NONE, int $configSkew = Values::INT_NONE, int $configCodeLength = Values::INT_NONE, string $configAlg = Values::NONE, array $metadata = Values::ARRAY_NONE ): CreateNewFactorOptions { return new CreateNewFactorOptions( $bindingAlg, $bindingPublicKey, $configAppId, $configNotificationPlatform, $configNotificationToken, $configSdkVersion, $bindingSecret, $configTimeStep, $configSkew, $configCodeLength, $configAlg, $metadata ); } } class CreateNewFactorOptions extends Options { /** * @param string $bindingAlg The algorithm used when `factor_type` is `push`. Algorithm supported: `ES256` * @param string $bindingPublicKey The Ecdsa public key in PKIX, ASN.1 DER format encoded in Base64. Required when `factor_type` is `push` * @param string $configAppId The ID that uniquely identifies your app in the Google or Apple store, such as `com.example.myapp`. It can be up to 100 characters long. Required when `factor_type` is `push`. * @param string $configNotificationPlatform * @param string $configNotificationToken For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Must be between 32 and 255 characters long. Required when `factor_type` is `push`. * @param string $configSdkVersion The Verify Push SDK version used to configure the factor Required when `factor_type` is `push` * @param string $bindingSecret The shared secret for TOTP factors encoded in Base32. This can be provided when creating the Factor, otherwise it will be generated. Used when `factor_type` is `totp` * @param int $configTimeStep Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. The default value is defined at the service level in the property `totp.time_step`. Defaults to 30 seconds if not configured. Used when `factor_type` is `totp` * @param int $configSkew The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The default value is defined at the service level in the property `totp.skew`. If not configured defaults to 1. Used when `factor_type` is `totp` * @param int $configCodeLength Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. The default value is defined at the service level in the property `totp.code_length`. If not configured defaults to 6. Used when `factor_type` is `totp` * @param string $configAlg * @param array $metadata Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. */ public function __construct( string $bindingAlg = Values::NONE, string $bindingPublicKey = Values::NONE, string $configAppId = Values::NONE, string $configNotificationPlatform = Values::NONE, string $configNotificationToken = Values::NONE, string $configSdkVersion = Values::NONE, string $bindingSecret = Values::NONE, int $configTimeStep = Values::INT_NONE, int $configSkew = Values::INT_NONE, int $configCodeLength = Values::INT_NONE, string $configAlg = Values::NONE, array $metadata = Values::ARRAY_NONE ) { $this->options['bindingAlg'] = $bindingAlg; $this->options['bindingPublicKey'] = $bindingPublicKey; $this->options['configAppId'] = $configAppId; $this->options['configNotificationPlatform'] = $configNotificationPlatform; $this->options['configNotificationToken'] = $configNotificationToken; $this->options['configSdkVersion'] = $configSdkVersion; $this->options['bindingSecret'] = $bindingSecret; $this->options['configTimeStep'] = $configTimeStep; $this->options['configSkew'] = $configSkew; $this->options['configCodeLength'] = $configCodeLength; $this->options['configAlg'] = $configAlg; $this->options['metadata'] = $metadata; } /** * The algorithm used when `factor_type` is `push`. Algorithm supported: `ES256` * * @param string $bindingAlg The algorithm used when `factor_type` is `push`. Algorithm supported: `ES256` * @return $this Fluent Builder */ public function setBindingAlg(string $bindingAlg): self { $this->options['bindingAlg'] = $bindingAlg; return $this; } /** * The Ecdsa public key in PKIX, ASN.1 DER format encoded in Base64. Required when `factor_type` is `push` * * @param string $bindingPublicKey The Ecdsa public key in PKIX, ASN.1 DER format encoded in Base64. Required when `factor_type` is `push` * @return $this Fluent Builder */ public function setBindingPublicKey(string $bindingPublicKey): self { $this->options['bindingPublicKey'] = $bindingPublicKey; return $this; } /** * The ID that uniquely identifies your app in the Google or Apple store, such as `com.example.myapp`. It can be up to 100 characters long. Required when `factor_type` is `push`. * * @param string $configAppId The ID that uniquely identifies your app in the Google or Apple store, such as `com.example.myapp`. It can be up to 100 characters long. Required when `factor_type` is `push`. * @return $this Fluent Builder */ public function setConfigAppId(string $configAppId): self { $this->options['configAppId'] = $configAppId; return $this; } /** * @param string $configNotificationPlatform * @return $this Fluent Builder */ public function setConfigNotificationPlatform(string $configNotificationPlatform): self { $this->options['configNotificationPlatform'] = $configNotificationPlatform; return $this; } /** * For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Must be between 32 and 255 characters long. Required when `factor_type` is `push`. * * @param string $configNotificationToken For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Must be between 32 and 255 characters long. Required when `factor_type` is `push`. * @return $this Fluent Builder */ public function setConfigNotificationToken(string $configNotificationToken): self { $this->options['configNotificationToken'] = $configNotificationToken; return $this; } /** * The Verify Push SDK version used to configure the factor Required when `factor_type` is `push` * * @param string $configSdkVersion The Verify Push SDK version used to configure the factor Required when `factor_type` is `push` * @return $this Fluent Builder */ public function setConfigSdkVersion(string $configSdkVersion): self { $this->options['configSdkVersion'] = $configSdkVersion; return $this; } /** * The shared secret for TOTP factors encoded in Base32. This can be provided when creating the Factor, otherwise it will be generated. Used when `factor_type` is `totp` * * @param string $bindingSecret The shared secret for TOTP factors encoded in Base32. This can be provided when creating the Factor, otherwise it will be generated. Used when `factor_type` is `totp` * @return $this Fluent Builder */ public function setBindingSecret(string $bindingSecret): self { $this->options['bindingSecret'] = $bindingSecret; return $this; } /** * Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. The default value is defined at the service level in the property `totp.time_step`. Defaults to 30 seconds if not configured. Used when `factor_type` is `totp` * * @param int $configTimeStep Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. The default value is defined at the service level in the property `totp.time_step`. Defaults to 30 seconds if not configured. Used when `factor_type` is `totp` * @return $this Fluent Builder */ public function setConfigTimeStep(int $configTimeStep): self { $this->options['configTimeStep'] = $configTimeStep; return $this; } /** * The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The default value is defined at the service level in the property `totp.skew`. If not configured defaults to 1. Used when `factor_type` is `totp` * * @param int $configSkew The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The default value is defined at the service level in the property `totp.skew`. If not configured defaults to 1. Used when `factor_type` is `totp` * @return $this Fluent Builder */ public function setConfigSkew(int $configSkew): self { $this->options['configSkew'] = $configSkew; return $this; } /** * Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. The default value is defined at the service level in the property `totp.code_length`. If not configured defaults to 6. Used when `factor_type` is `totp` * * @param int $configCodeLength Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. The default value is defined at the service level in the property `totp.code_length`. If not configured defaults to 6. Used when `factor_type` is `totp` * @return $this Fluent Builder */ public function setConfigCodeLength(int $configCodeLength): self { $this->options['configCodeLength'] = $configCodeLength; return $this; } /** * @param string $configAlg * @return $this Fluent Builder */ public function setConfigAlg(string $configAlg): self { $this->options['configAlg'] = $configAlg; return $this; } /** * Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. * * @param array $metadata Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. * @return $this Fluent Builder */ public function setMetadata(array $metadata): self { $this->options['metadata'] = $metadata; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateNewFactorOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorPage.php 0000644 00000003136 15021223077 0017435 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FactorPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FactorInstance \Twilio\Rest\Verify\V2\Service\Entity\FactorInstance */ public function buildInstance(array $payload): FactorInstance { return new FactorInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.FactorPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorContext.php 0000644 00000010516 15021223077 0020205 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class FactorContext extends InstanceContext { /** * Initialize the FactorContext * * @param Version $version Version that contains the resource * @param string $serviceSid The unique SID identifier of the Service. * @param string $identity Customer unique identity for the Entity owner of the Factor. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. * @param string $sid A 34 character string that uniquely identifies this Factor. */ public function __construct( Version $version, $serviceSid, $identity, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'identity' => $identity, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities/' . \rawurlencode($identity) .'/Factors/' . \rawurlencode($sid) .''; } /** * Delete the FactorInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the FactorInstance * * @return FactorInstance Fetched FactorInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FactorInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new FactorInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } /** * Update the FactorInstance * * @param array|Options $options Optional Arguments * @return FactorInstance Updated FactorInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): FactorInstance { $options = new Values($options); $data = Values::of([ 'AuthPayload' => $options['authPayload'], 'FriendlyName' => $options['friendlyName'], 'Config.NotificationToken' => $options['configNotificationToken'], 'Config.SdkVersion' => $options['configSdkVersion'], 'Config.TimeStep' => $options['configTimeStep'], 'Config.Skew' => $options['configSkew'], 'Config.CodeLength' => $options['configCodeLength'], 'Config.Alg' => $options['configAlg'], 'Config.NotificationPlatform' => $options['configNotificationPlatform'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FactorInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.FactorContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeOptions.php 0000644 00000034675 15021223077 0020674 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity; use Twilio\Options; use Twilio\Values; abstract class ChallengeOptions { /** * @param \DateTime $expirationDate The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The default value is five (5) minutes after Challenge creation. The max value is sixty (60) minutes after creation. * @param string $detailsMessage Shown to the user when the push notification arrives. Required when `factor_type` is `push`. Can be up to 256 characters in length * @param array[] $detailsFields A list of objects that describe the Fields included in the Challenge. Each object contains the label and value of the field, the label can be up to 36 characters in length and the value can be up to 128 characters in length. Used when `factor_type` is `push`. There can be up to 20 details fields. * @param array $hiddenDetails Details provided to give context about the Challenge. Not shown to the end user. It must be a stringified JSON with only strings values eg. `{\\\"ip\\\": \\\"172.168.1.234\\\"}`. Can be up to 1024 characters in length * @param string $authPayload Optional payload used to verify the Challenge upon creation. Only used with a Factor of type `totp` to carry the TOTP code that needs to be verified. For `TOTP` this value must be between 3 and 8 characters long. * @return CreateChallengeOptions Options builder */ public static function create( \DateTime $expirationDate = null, string $detailsMessage = Values::NONE, array $detailsFields = Values::ARRAY_NONE, array $hiddenDetails = Values::ARRAY_NONE, string $authPayload = Values::NONE ): CreateChallengeOptions { return new CreateChallengeOptions( $expirationDate, $detailsMessage, $detailsFields, $hiddenDetails, $authPayload ); } /** * @param string $factorSid The unique SID identifier of the Factor. * @param string $status The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. * @param string $order The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. * @return ReadChallengeOptions Options builder */ public static function read( string $factorSid = Values::NONE, string $status = Values::NONE, string $order = Values::NONE ): ReadChallengeOptions { return new ReadChallengeOptions( $factorSid, $status, $order ); } /** * @param string $authPayload The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must be between 3 and 8 characters long. For `Push` this value can be up to 5456 characters in length * @param array $metadata Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. * @return UpdateChallengeOptions Options builder */ public static function update( string $authPayload = Values::NONE, array $metadata = Values::ARRAY_NONE ): UpdateChallengeOptions { return new UpdateChallengeOptions( $authPayload, $metadata ); } } class CreateChallengeOptions extends Options { /** * @param \DateTime $expirationDate The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The default value is five (5) minutes after Challenge creation. The max value is sixty (60) minutes after creation. * @param string $detailsMessage Shown to the user when the push notification arrives. Required when `factor_type` is `push`. Can be up to 256 characters in length * @param array[] $detailsFields A list of objects that describe the Fields included in the Challenge. Each object contains the label and value of the field, the label can be up to 36 characters in length and the value can be up to 128 characters in length. Used when `factor_type` is `push`. There can be up to 20 details fields. * @param array $hiddenDetails Details provided to give context about the Challenge. Not shown to the end user. It must be a stringified JSON with only strings values eg. `{\\\"ip\\\": \\\"172.168.1.234\\\"}`. Can be up to 1024 characters in length * @param string $authPayload Optional payload used to verify the Challenge upon creation. Only used with a Factor of type `totp` to carry the TOTP code that needs to be verified. For `TOTP` this value must be between 3 and 8 characters long. */ public function __construct( \DateTime $expirationDate = null, string $detailsMessage = Values::NONE, array $detailsFields = Values::ARRAY_NONE, array $hiddenDetails = Values::ARRAY_NONE, string $authPayload = Values::NONE ) { $this->options['expirationDate'] = $expirationDate; $this->options['detailsMessage'] = $detailsMessage; $this->options['detailsFields'] = $detailsFields; $this->options['hiddenDetails'] = $hiddenDetails; $this->options['authPayload'] = $authPayload; } /** * The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The default value is five (5) minutes after Challenge creation. The max value is sixty (60) minutes after creation. * * @param \DateTime $expirationDate The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The default value is five (5) minutes after Challenge creation. The max value is sixty (60) minutes after creation. * @return $this Fluent Builder */ public function setExpirationDate(\DateTime $expirationDate): self { $this->options['expirationDate'] = $expirationDate; return $this; } /** * Shown to the user when the push notification arrives. Required when `factor_type` is `push`. Can be up to 256 characters in length * * @param string $detailsMessage Shown to the user when the push notification arrives. Required when `factor_type` is `push`. Can be up to 256 characters in length * @return $this Fluent Builder */ public function setDetailsMessage(string $detailsMessage): self { $this->options['detailsMessage'] = $detailsMessage; return $this; } /** * A list of objects that describe the Fields included in the Challenge. Each object contains the label and value of the field, the label can be up to 36 characters in length and the value can be up to 128 characters in length. Used when `factor_type` is `push`. There can be up to 20 details fields. * * @param array[] $detailsFields A list of objects that describe the Fields included in the Challenge. Each object contains the label and value of the field, the label can be up to 36 characters in length and the value can be up to 128 characters in length. Used when `factor_type` is `push`. There can be up to 20 details fields. * @return $this Fluent Builder */ public function setDetailsFields(array $detailsFields): self { $this->options['detailsFields'] = $detailsFields; return $this; } /** * Details provided to give context about the Challenge. Not shown to the end user. It must be a stringified JSON with only strings values eg. `{\\\"ip\\\": \\\"172.168.1.234\\\"}`. Can be up to 1024 characters in length * * @param array $hiddenDetails Details provided to give context about the Challenge. Not shown to the end user. It must be a stringified JSON with only strings values eg. `{\\\"ip\\\": \\\"172.168.1.234\\\"}`. Can be up to 1024 characters in length * @return $this Fluent Builder */ public function setHiddenDetails(array $hiddenDetails): self { $this->options['hiddenDetails'] = $hiddenDetails; return $this; } /** * Optional payload used to verify the Challenge upon creation. Only used with a Factor of type `totp` to carry the TOTP code that needs to be verified. For `TOTP` this value must be between 3 and 8 characters long. * * @param string $authPayload Optional payload used to verify the Challenge upon creation. Only used with a Factor of type `totp` to carry the TOTP code that needs to be verified. For `TOTP` this value must be between 3 and 8 characters long. * @return $this Fluent Builder */ public function setAuthPayload(string $authPayload): self { $this->options['authPayload'] = $authPayload; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateChallengeOptions ' . $options . ']'; } } class ReadChallengeOptions extends Options { /** * @param string $factorSid The unique SID identifier of the Factor. * @param string $status The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. * @param string $order The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. */ public function __construct( string $factorSid = Values::NONE, string $status = Values::NONE, string $order = Values::NONE ) { $this->options['factorSid'] = $factorSid; $this->options['status'] = $status; $this->options['order'] = $order; } /** * The unique SID identifier of the Factor. * * @param string $factorSid The unique SID identifier of the Factor. * @return $this Fluent Builder */ public function setFactorSid(string $factorSid): self { $this->options['factorSid'] = $factorSid; return $this; } /** * The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. * * @param string $status The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. * * @param string $order The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.ReadChallengeOptions ' . $options . ']'; } } class UpdateChallengeOptions extends Options { /** * @param string $authPayload The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must be between 3 and 8 characters long. For `Push` this value can be up to 5456 characters in length * @param array $metadata Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. */ public function __construct( string $authPayload = Values::NONE, array $metadata = Values::ARRAY_NONE ) { $this->options['authPayload'] = $authPayload; $this->options['metadata'] = $metadata; } /** * The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must be between 3 and 8 characters long. For `Push` this value can be up to 5456 characters in length * * @param string $authPayload The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must be between 3 and 8 characters long. For `Push` this value can be up to 5456 characters in length * @return $this Fluent Builder */ public function setAuthPayload(string $authPayload): self { $this->options['authPayload'] = $authPayload; return $this; } /** * Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. * * @param array $metadata Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. * @return $this Fluent Builder */ public function setMetadata(array $metadata): self { $this->options['metadata'] = $metadata; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.UpdateChallengeOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/FactorList.php 0000644 00000013446 15021223077 0017501 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class FactorList extends ListResource { /** * Construct the FactorList * * @param Version $version Version that contains the resource * @param string $serviceSid The unique SID identifier of the Service. * @param string $identity Customer unique identity for the Entity owner of the Factor. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. */ public function __construct( Version $version, string $serviceSid, string $identity ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities/' . \rawurlencode($identity) .'/Factors'; } /** * Reads FactorInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FactorInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams FactorInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FactorInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FactorPage Page of FactorInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FactorPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FactorPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FactorInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FactorPage Page of FactorInstance */ public function getPage(string $targetUrl): FactorPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FactorPage($this->version, $response, $this->solution); } /** * Constructs a FactorContext * * @param string $sid A 34 character string that uniquely identifies this Factor. */ public function getContext( string $sid ): FactorContext { return new FactorContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.FactorList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/ChallengeInstance.php 0000644 00000014236 15021223077 0020774 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Verify\V2\Service\Entity\Challenge\NotificationList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $entitySid * @property string|null $identity * @property string|null $factorSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property \DateTime|null $dateResponded * @property \DateTime|null $expirationDate * @property string $status * @property string $respondedReason * @property array|null $details * @property array|null $hiddenDetails * @property array|null $metadata * @property string $factorType * @property string|null $url * @property array|null $links */ class ChallengeInstance extends InstanceResource { protected $_notifications; /** * Initialize the ChallengeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The unique SID identifier of the Service. * @param string $identity Customer unique identity for the Entity owner of the Challenge. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. * @param string $sid A 34 character string that uniquely identifies this Challenge. */ public function __construct(Version $version, array $payload, string $serviceSid, string $identity, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'entitySid' => Values::array_get($payload, 'entity_sid'), 'identity' => Values::array_get($payload, 'identity'), 'factorSid' => Values::array_get($payload, 'factor_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'dateResponded' => Deserialize::dateTime(Values::array_get($payload, 'date_responded')), 'expirationDate' => Deserialize::dateTime(Values::array_get($payload, 'expiration_date')), 'status' => Values::array_get($payload, 'status'), 'respondedReason' => Values::array_get($payload, 'responded_reason'), 'details' => Values::array_get($payload, 'details'), 'hiddenDetails' => Values::array_get($payload, 'hidden_details'), 'metadata' => Values::array_get($payload, 'metadata'), 'factorType' => Values::array_get($payload, 'factor_type'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ChallengeContext Context for this ChallengeInstance */ protected function proxy(): ChallengeContext { if (!$this->context) { $this->context = new ChallengeContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the ChallengeInstance * * @return ChallengeInstance Fetched ChallengeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChallengeInstance { return $this->proxy()->fetch(); } /** * Update the ChallengeInstance * * @param array|Options $options Optional Arguments * @return ChallengeInstance Updated ChallengeInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChallengeInstance { return $this->proxy()->update($options); } /** * Access the notifications */ protected function getNotifications(): NotificationList { return $this->proxy()->notifications; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.ChallengeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/Entity/NewFactorPage.php 0000644 00000003160 15021223077 0020104 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service\Entity; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class NewFactorPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return NewFactorInstance \Twilio\Rest\Verify\V2\Service\Entity\NewFactorInstance */ public function buildInstance(array $payload): NewFactorInstance { return new NewFactorInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.NewFactorPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/WebhookContext.php 0000644 00000007063 15021223077 0017114 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param Version $version Version that contains the resource * @param string $serviceSid The unique SID identifier of the Service. * @param string $sid The Twilio-provided string that uniquely identifies the Webhook resource to delete. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Webhooks/' . \rawurlencode($sid) .''; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'EventTypes' => Serialize::map($options['eventTypes'], function ($e) { return $e; }), 'WebhookUrl' => $options['webhookUrl'], 'Status' => $options['status'], 'Version' => $options['version'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.WebhookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationInstance.php 0000644 00000012255 15021223077 0022302 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $country * @property string|null $messagingServiceSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class MessagingConfigurationInstance extends InstanceResource { /** * Initialize the MessagingConfigurationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/verify/api/service) that the resource is associated with. * @param string $country The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`. */ public function __construct(Version $version, array $payload, string $serviceSid, string $country = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'country' => Values::array_get($payload, 'country'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'country' => $country ?: $this->properties['country'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessagingConfigurationContext Context for this MessagingConfigurationInstance */ protected function proxy(): MessagingConfigurationContext { if (!$this->context) { $this->context = new MessagingConfigurationContext( $this->version, $this->solution['serviceSid'], $this->solution['country'] ); } return $this->context; } /** * Delete the MessagingConfigurationInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the MessagingConfigurationInstance * * @return MessagingConfigurationInstance Fetched MessagingConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessagingConfigurationInstance { return $this->proxy()->fetch(); } /** * Update the MessagingConfigurationInstance * * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration. * @return MessagingConfigurationInstance Updated MessagingConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $messagingServiceSid): MessagingConfigurationInstance { return $this->proxy()->update($messagingServiceSid); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.MessagingConfigurationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenInstance.php 0000644 00000010355 15021223077 0020036 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $entityIdentity * @property string $factorType * @property string|null $factorFriendlyName * @property string|null $token * @property string|null $url * @property int|null $ttl * @property \DateTime|null $dateCreated */ class AccessTokenInstance extends InstanceResource { /** * Initialize the AccessTokenInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The unique SID identifier of the Service. * @param string $sid A 34 character string that uniquely identifies this Access Token. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'entityIdentity' => Values::array_get($payload, 'entity_identity'), 'factorType' => Values::array_get($payload, 'factor_type'), 'factorFriendlyName' => Values::array_get($payload, 'factor_friendly_name'), 'token' => Values::array_get($payload, 'token'), 'url' => Values::array_get($payload, 'url'), 'ttl' => Values::array_get($payload, 'ttl'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AccessTokenContext Context for this AccessTokenInstance */ protected function proxy(): AccessTokenContext { if (!$this->context) { $this->context = new AccessTokenContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the AccessTokenInstance * * @return AccessTokenInstance Fetched AccessTokenInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AccessTokenInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.AccessTokenInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenContext.php 0000644 00000004361 15021223077 0017716 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class AccessTokenContext extends InstanceContext { /** * Initialize the AccessTokenContext * * @param Version $version Version that contains the resource * @param string $serviceSid The unique SID identifier of the Service. * @param string $sid A 34 character string that uniquely identifies this Access Token. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/AccessTokens/' . \rawurlencode($sid) .''; } /** * Fetch the AccessTokenInstance * * @return AccessTokenInstance Fetched AccessTokenInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AccessTokenInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AccessTokenInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.AccessTokenContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/EntityContext.php 0000644 00000012750 15021223077 0016771 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Verify\V2\Service\Entity\FactorList; use Twilio\Rest\Verify\V2\Service\Entity\NewFactorList; use Twilio\Rest\Verify\V2\Service\Entity\ChallengeList; /** * @property FactorList $factors * @property NewFactorList $newFactors * @property ChallengeList $challenges * @method \Twilio\Rest\Verify\V2\Service\Entity\FactorContext factors(string $sid) * @method \Twilio\Rest\Verify\V2\Service\Entity\ChallengeContext challenges(string $sid) */ class EntityContext extends InstanceContext { protected $_factors; protected $_newFactors; protected $_challenges; /** * Initialize the EntityContext * * @param Version $version Version that contains the resource * @param string $serviceSid The unique SID identifier of the Service. * @param string $identity The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. */ public function __construct( Version $version, $serviceSid, $identity ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'identity' => $identity, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Entities/' . \rawurlencode($identity) .''; } /** * Delete the EntityInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the EntityInstance * * @return EntityInstance Fetched EntityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EntityInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new EntityInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'] ); } /** * Access the factors */ protected function getFactors(): FactorList { if (!$this->_factors) { $this->_factors = new FactorList( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->_factors; } /** * Access the newFactors */ protected function getNewFactors(): NewFactorList { if (!$this->_newFactors) { $this->_newFactors = new NewFactorList( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->_newFactors; } /** * Access the challenges */ protected function getChallenges(): ChallengeList { if (!$this->_challenges) { $this->_challenges = new ChallengeList( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->_challenges; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.EntityContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/WebhookOptions.php 0000644 00000014170 15021223077 0017120 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Options; use Twilio\Values; abstract class WebhookOptions { /** * @param string $status * @param string $version * @return CreateWebhookOptions Options builder */ public static function create( string $status = Values::NONE, string $version = Values::NONE ): CreateWebhookOptions { return new CreateWebhookOptions( $status, $version ); } /** * @param string $friendlyName The string that you assigned to describe the webhook. **This value should not contain PII.** * @param string[] $eventTypes The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` * @param string $webhookUrl The URL associated with this Webhook. * @param string $status * @param string $version * @return UpdateWebhookOptions Options builder */ public static function update( string $friendlyName = Values::NONE, array $eventTypes = Values::ARRAY_NONE, string $webhookUrl = Values::NONE, string $status = Values::NONE, string $version = Values::NONE ): UpdateWebhookOptions { return new UpdateWebhookOptions( $friendlyName, $eventTypes, $webhookUrl, $status, $version ); } } class CreateWebhookOptions extends Options { /** * @param string $status * @param string $version */ public function __construct( string $status = Values::NONE, string $version = Values::NONE ) { $this->options['status'] = $status; $this->options['version'] = $version; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * @param string $version * @return $this Fluent Builder */ public function setVersion(string $version): self { $this->options['version'] = $version; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateWebhookOptions ' . $options . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the webhook. **This value should not contain PII.** * @param string[] $eventTypes The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` * @param string $webhookUrl The URL associated with this Webhook. * @param string $status * @param string $version */ public function __construct( string $friendlyName = Values::NONE, array $eventTypes = Values::ARRAY_NONE, string $webhookUrl = Values::NONE, string $status = Values::NONE, string $version = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['eventTypes'] = $eventTypes; $this->options['webhookUrl'] = $webhookUrl; $this->options['status'] = $status; $this->options['version'] = $version; } /** * The string that you assigned to describe the webhook. **This value should not contain PII.** * * @param string $friendlyName The string that you assigned to describe the webhook. **This value should not contain PII.** * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` * * @param string[] $eventTypes The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` * @return $this Fluent Builder */ public function setEventTypes(array $eventTypes): self { $this->options['eventTypes'] = $eventTypes; return $this; } /** * The URL associated with this Webhook. * * @param string $webhookUrl The URL associated with this Webhook. * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * @param string $version * @return $this Fluent Builder */ public function setVersion(string $version): self { $this->options['version'] = $version; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.UpdateWebhookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenPage.php 0000644 00000003121 15021223077 0017137 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AccessTokenPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AccessTokenInstance \Twilio\Rest\Verify\V2\Service\AccessTokenInstance */ public function buildInstance(array $payload): AccessTokenInstance { return new AccessTokenInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.AccessTokenPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenOptions.php 0000644 00000005652 15021223077 0017731 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Options; use Twilio\Values; abstract class AccessTokenOptions { /** * @param string $factorFriendlyName The friendly name of the factor that is going to be created with this access token * @param int $ttl How long, in seconds, the access token is valid. Can be an integer between 60 and 300. Default is 60. * @return CreateAccessTokenOptions Options builder */ public static function create( string $factorFriendlyName = Values::NONE, int $ttl = Values::INT_NONE ): CreateAccessTokenOptions { return new CreateAccessTokenOptions( $factorFriendlyName, $ttl ); } } class CreateAccessTokenOptions extends Options { /** * @param string $factorFriendlyName The friendly name of the factor that is going to be created with this access token * @param int $ttl How long, in seconds, the access token is valid. Can be an integer between 60 and 300. Default is 60. */ public function __construct( string $factorFriendlyName = Values::NONE, int $ttl = Values::INT_NONE ) { $this->options['factorFriendlyName'] = $factorFriendlyName; $this->options['ttl'] = $ttl; } /** * The friendly name of the factor that is going to be created with this access token * * @param string $factorFriendlyName The friendly name of the factor that is going to be created with this access token * @return $this Fluent Builder */ public function setFactorFriendlyName(string $factorFriendlyName): self { $this->options['factorFriendlyName'] = $factorFriendlyName; return $this; } /** * How long, in seconds, the access token is valid. Can be an integer between 60 and 300. Default is 60. * * @param int $ttl How long, in seconds, the access token is valid. Can be an integer between 60 and 300. Default is 60. * @return $this Fluent Builder */ public function setTtl(int $ttl): self { $this->options['ttl'] = $ttl; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateAccessTokenOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitInstance.php 0000644 00000012100 15021223077 0017514 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Verify\V2\Service\RateLimit\BucketList; /** * @property string|null $sid * @property string|null $serviceSid * @property string|null $accountSid * @property string|null $uniqueName * @property string|null $description * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class RateLimitInstance extends InstanceResource { protected $_buckets; /** * Initialize the RateLimitInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with. * @param string $sid The Twilio-provided string that uniquely identifies the Rate Limit resource to fetch. */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'description' => Values::array_get($payload, 'description'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RateLimitContext Context for this RateLimitInstance */ protected function proxy(): RateLimitContext { if (!$this->context) { $this->context = new RateLimitContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RateLimitInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RateLimitInstance * * @return RateLimitInstance Fetched RateLimitInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RateLimitInstance { return $this->proxy()->fetch(); } /** * Update the RateLimitInstance * * @param array|Options $options Optional Arguments * @return RateLimitInstance Updated RateLimitInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): RateLimitInstance { return $this->proxy()->update($options); } /** * Access the buckets */ protected function getBuckets(): BucketList { return $this->proxy()->buckets; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.RateLimitInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckOptions.php 0000644 00000013653 15021223077 0021107 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Options; use Twilio\Values; abstract class VerificationCheckOptions { /** * @param string $code The 4-10 character string being verified. * @param string $to The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Either this parameter or the `verification_sid` must be specified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @param string $verificationSid A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/[email](https://www.twilio.com/docs/verify/email) must be specified. * @param string $amount The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @param string $payee The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @return CreateVerificationCheckOptions Options builder */ public static function create( string $code = Values::NONE, string $to = Values::NONE, string $verificationSid = Values::NONE, string $amount = Values::NONE, string $payee = Values::NONE ): CreateVerificationCheckOptions { return new CreateVerificationCheckOptions( $code, $to, $verificationSid, $amount, $payee ); } } class CreateVerificationCheckOptions extends Options { /** * @param string $code The 4-10 character string being verified. * @param string $to The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Either this parameter or the `verification_sid` must be specified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @param string $verificationSid A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/[email](https://www.twilio.com/docs/verify/email) must be specified. * @param string $amount The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @param string $payee The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. */ public function __construct( string $code = Values::NONE, string $to = Values::NONE, string $verificationSid = Values::NONE, string $amount = Values::NONE, string $payee = Values::NONE ) { $this->options['code'] = $code; $this->options['to'] = $to; $this->options['verificationSid'] = $verificationSid; $this->options['amount'] = $amount; $this->options['payee'] = $payee; } /** * The 4-10 character string being verified. * * @param string $code The 4-10 character string being verified. * @return $this Fluent Builder */ public function setCode(string $code): self { $this->options['code'] = $code; return $this; } /** * The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Either this parameter or the `verification_sid` must be specified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * * @param string $to The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Either this parameter or the `verification_sid` must be specified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @return $this Fluent Builder */ public function setTo(string $to): self { $this->options['to'] = $to; return $this; } /** * A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/[email](https://www.twilio.com/docs/verify/email) must be specified. * * @param string $verificationSid A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/[email](https://www.twilio.com/docs/verify/email) must be specified. * @return $this Fluent Builder */ public function setVerificationSid(string $verificationSid): self { $this->options['verificationSid'] = $verificationSid; return $this; } /** * The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * * @param string $amount The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @return $this Fluent Builder */ public function setAmount(string $amount): self { $this->options['amount'] = $amount; return $this; } /** * The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * * @param string $payee The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * @return $this Fluent Builder */ public function setPayee(string $payee): self { $this->options['payee'] = $payee; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateVerificationCheckOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationContext.php 0000644 00000005755 15021223077 0020146 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class VerificationContext extends InstanceContext { /** * Initialize the VerificationContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the verification [Service](https://www.twilio.com/docs/verify/api/service) to create the resource under. * @param string $sid The Twilio-provided string that uniquely identifies the Verification resource to fetch. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Verifications/' . \rawurlencode($sid) .''; } /** * Fetch the VerificationInstance * * @return VerificationInstance Fetched VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): VerificationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new VerificationInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the VerificationInstance * * @param string $status * @return VerificationInstance Updated VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): VerificationInstance { $data = Values::of([ 'Status' => $status, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new VerificationInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.VerificationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/WebhookPage.php 0000644 00000003071 15021223077 0016337 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WebhookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return WebhookInstance \Twilio\Rest\Verify\V2\Service\WebhookInstance */ public function buildInstance(array $payload): WebhookInstance { return new WebhookInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.WebhookPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitOptions.php 0000644 00000006140 15021223077 0017412 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Options; use Twilio\Values; abstract class RateLimitOptions { /** * @param string $description Description of this Rate Limit * @return CreateRateLimitOptions Options builder */ public static function create( string $description = Values::NONE ): CreateRateLimitOptions { return new CreateRateLimitOptions( $description ); } /** * @param string $description Description of this Rate Limit * @return UpdateRateLimitOptions Options builder */ public static function update( string $description = Values::NONE ): UpdateRateLimitOptions { return new UpdateRateLimitOptions( $description ); } } class CreateRateLimitOptions extends Options { /** * @param string $description Description of this Rate Limit */ public function __construct( string $description = Values::NONE ) { $this->options['description'] = $description; } /** * Description of this Rate Limit * * @param string $description Description of this Rate Limit * @return $this Fluent Builder */ public function setDescription(string $description): self { $this->options['description'] = $description; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateRateLimitOptions ' . $options . ']'; } } class UpdateRateLimitOptions extends Options { /** * @param string $description Description of this Rate Limit */ public function __construct( string $description = Values::NONE ) { $this->options['description'] = $description; } /** * Description of this Rate Limit * * @param string $description Description of this Rate Limit * @return $this Fluent Builder */ public function setDescription(string $description): self { $this->options['description'] = $description; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.UpdateRateLimitOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationList.php 0000644 00000016014 15021223077 0021446 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MessagingConfigurationList extends ListResource { /** * Construct the MessagingConfigurationList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/verify/api/service) that the resource is associated with. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/MessagingConfigurations'; } /** * Create the MessagingConfigurationInstance * * @param string $country The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`. * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to be used to send SMS to the country of this configuration. * @return MessagingConfigurationInstance Created MessagingConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $country, string $messagingServiceSid): MessagingConfigurationInstance { $data = Values::of([ 'Country' => $country, 'MessagingServiceSid' => $messagingServiceSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MessagingConfigurationInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads MessagingConfigurationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessagingConfigurationInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams MessagingConfigurationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessagingConfigurationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagingConfigurationPage Page of MessagingConfigurationInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagingConfigurationPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagingConfigurationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessagingConfigurationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagingConfigurationPage Page of MessagingConfigurationInstance */ public function getPage(string $targetUrl): MessagingConfigurationPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagingConfigurationPage($this->version, $response, $this->solution); } /** * Constructs a MessagingConfigurationContext * * @param string $country The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`. */ public function getContext( string $country ): MessagingConfigurationContext { return new MessagingConfigurationContext( $this->version, $this->solution['serviceSid'], $country ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.MessagingConfigurationList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/WebhookList.php 0000644 00000015467 15021223077 0016412 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $serviceSid The unique SID identifier of the Service. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Webhooks'; } /** * Create the WebhookInstance * * @param string $friendlyName The string that you assigned to describe the webhook. **This value should not contain PII.** * @param string[] $eventTypes The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` * @param string $webhookUrl The URL associated with this Webhook. * @param array|Options $options Optional Arguments * @return WebhookInstance Created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $eventTypes, string $webhookUrl, array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'EventTypes' => Serialize::map($eventTypes,function ($e) { return $e; }), 'WebhookUrl' => $webhookUrl, 'Status' => $options['status'], 'Version' => $options['version'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WebhookPage Page of WebhookInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WebhookPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WebhookPage Page of WebhookInstance */ public function getPage(string $targetUrl): WebhookPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Constructs a WebhookContext * * @param string $sid The Twilio-provided string that uniquely identifies the Webhook resource to delete. */ public function getContext( string $sid ): WebhookContext { return new WebhookContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.WebhookList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitList.php 0000644 00000014731 15021223077 0016677 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class RateLimitList extends ListResource { /** * Construct the RateLimitList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/RateLimits'; } /** * Create the RateLimitInstance * * @param string $uniqueName Provides a unique and addressable name to be assigned to this Rate Limit, assigned by the developer, to be optionally used in addition to SID. **This value should not contain PII.** * @param array|Options $options Optional Arguments * @return RateLimitInstance Created RateLimitInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $uniqueName, array $options = []): RateLimitInstance { $options = new Values($options); $data = Values::of([ 'UniqueName' => $uniqueName, 'Description' => $options['description'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RateLimitInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads RateLimitInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RateLimitInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RateLimitInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RateLimitInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RateLimitPage Page of RateLimitInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RateLimitPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RateLimitPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RateLimitInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RateLimitPage Page of RateLimitInstance */ public function getPage(string $targetUrl): RateLimitPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RateLimitPage($this->version, $response, $this->solution); } /** * Constructs a RateLimitContext * * @param string $sid The Twilio-provided string that uniquely identifies the Rate Limit resource to fetch. */ public function getContext( string $sid ): RateLimitContext { return new RateLimitContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.RateLimitList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/AccessTokenList.php 0000644 00000005753 15021223077 0017213 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class AccessTokenList extends ListResource { /** * Construct the AccessTokenList * * @param Version $version Version that contains the resource * @param string $serviceSid The unique SID identifier of the Service. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/AccessTokens'; } /** * Create the AccessTokenInstance * * @param string $identity The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, and generated by your external system, such as your user's UUID, GUID, or SID. * @param string $factorType * @param array|Options $options Optional Arguments * @return AccessTokenInstance Created AccessTokenInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, string $factorType, array $options = []): AccessTokenInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'FactorType' => $factorType, 'FactorFriendlyName' => $options['factorFriendlyName'], 'Ttl' => $options['ttl'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new AccessTokenInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Constructs a AccessTokenContext * * @param string $sid A 34 character string that uniquely identifies this Access Token. */ public function getContext( string $sid ): AccessTokenContext { return new AccessTokenContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.AccessTokenList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationList.php 0000644 00000010175 15021223077 0017425 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class VerificationList extends ListResource { /** * Construct the VerificationList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the verification [Service](https://www.twilio.com/docs/verify/api/service) to create the resource under. */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Verifications'; } /** * Create the VerificationInstance * * @param string $to The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @param string $channel The verification method to use. One of: [`email`](https://www.twilio.com/docs/verify/email), `sms`, `whatsapp`, `call`, `sna` or `auto`. * @param array|Options $options Optional Arguments * @return VerificationInstance Created VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $to, string $channel, array $options = []): VerificationInstance { $options = new Values($options); $data = Values::of([ 'To' => $to, 'Channel' => $channel, 'CustomFriendlyName' => $options['customFriendlyName'], 'CustomMessage' => $options['customMessage'], 'SendDigits' => $options['sendDigits'], 'Locale' => $options['locale'], 'CustomCode' => $options['customCode'], 'Amount' => $options['amount'], 'Payee' => $options['payee'], 'RateLimits' => Serialize::jsonObject($options['rateLimits']), 'ChannelConfiguration' => Serialize::jsonObject($options['channelConfiguration']), 'AppHash' => $options['appHash'], 'TemplateSid' => $options['templateSid'], 'TemplateCustomSubstitutions' => $options['templateCustomSubstitutions'], 'DeviceIp' => $options['deviceIp'], 'RiskCheck' => $options['riskCheck'], 'Tags' => $options['tags'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new VerificationInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Constructs a VerificationContext * * @param string $sid The Twilio-provided string that uniquely identifies the Verification resource to fetch. */ public function getContext( string $sid ): VerificationContext { return new VerificationContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckInstance.php 0000644 00000006604 15021223077 0021216 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $serviceSid * @property string|null $accountSid * @property string|null $to * @property string $channel * @property string|null $status * @property bool|null $valid * @property string|null $amount * @property string|null $payee * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property array[]|null $snaAttemptsErrorCodes */ class VerificationCheckInstance extends InstanceResource { /** * Initialize the VerificationCheckInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the verification [Service](https://www.twilio.com/docs/verify/api/service) to create the resource under. */ public function __construct(Version $version, array $payload, string $serviceSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'to' => Values::array_get($payload, 'to'), 'channel' => Values::array_get($payload, 'channel'), 'status' => Values::array_get($payload, 'status'), 'valid' => Values::array_get($payload, 'valid'), 'amount' => Values::array_get($payload, 'amount'), 'payee' => Values::array_get($payload, 'payee'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'snaAttemptsErrorCodes' => Values::array_get($payload, 'sna_attempts_error_codes'), ]; $this->solution = ['serviceSid' => $serviceSid, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationCheckInstance]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitContext.php 0000644 00000012010 15021223077 0017374 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Verify\V2\Service\RateLimit\BucketList; /** * @property BucketList $buckets * @method \Twilio\Rest\Verify\V2\Service\RateLimit\BucketContext buckets(string $sid) */ class RateLimitContext extends InstanceContext { protected $_buckets; /** * Initialize the RateLimitContext * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with. * @param string $sid The Twilio-provided string that uniquely identifies the Rate Limit resource to fetch. */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/RateLimits/' . \rawurlencode($sid) .''; } /** * Delete the RateLimitInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RateLimitInstance * * @return RateLimitInstance Fetched RateLimitInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RateLimitInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RateLimitInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the RateLimitInstance * * @param array|Options $options Optional Arguments * @return RateLimitInstance Updated RateLimitInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): RateLimitInstance { $options = new Values($options); $data = Values::of([ 'Description' => $options['description'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RateLimitInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the buckets */ protected function getBuckets(): BucketList { if (!$this->_buckets) { $this->_buckets = new BucketList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_buckets; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.RateLimitContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/SafelistInstance.php 0000644 00000007165 15021223077 0016013 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string|null $phoneNumber * @property string|null $url */ class SafelistInstance extends InstanceResource { /** * Initialize the SafelistInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $phoneNumber The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). */ public function __construct(Version $version, array $payload, string $phoneNumber = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['phoneNumber' => $phoneNumber ?: $this->properties['phoneNumber'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SafelistContext Context for this SafelistInstance */ protected function proxy(): SafelistContext { if (!$this->context) { $this->context = new SafelistContext( $this->version, $this->solution['phoneNumber'] ); } return $this->context; } /** * Delete the SafelistInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SafelistInstance * * @return SafelistInstance Fetched SafelistInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SafelistInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.SafelistInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/FormPage.php 0000644 00000002770 15021223077 0014251 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FormPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FormInstance \Twilio\Rest\Verify\V2\FormInstance */ public function buildInstance(array $payload): FormInstance { return new FormInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.FormPage]'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptOptions.php 0000644 00000022712 15021223077 0020104 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Options; use Twilio\Values; abstract class VerificationAttemptOptions { /** * @param \DateTime $dateCreatedAfter Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @param \DateTime $dateCreatedBefore Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @param string $channelDataTo Destination of a verification. It is phone number in E.164 format. * @param string $country Filter used to query Verification Attempts sent to the specified destination country. * @param string $channel Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL` * @param string $verifyServiceSid Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned. * @param string $verificationSid Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned. * @param string $status Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed. * @return ReadVerificationAttemptOptions Options builder */ public static function read( \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null, string $channelDataTo = Values::NONE, string $country = Values::NONE, string $channel = Values::NONE, string $verifyServiceSid = Values::NONE, string $verificationSid = Values::NONE, string $status = Values::NONE ): ReadVerificationAttemptOptions { return new ReadVerificationAttemptOptions( $dateCreatedAfter, $dateCreatedBefore, $channelDataTo, $country, $channel, $verifyServiceSid, $verificationSid, $status ); } } class ReadVerificationAttemptOptions extends Options { /** * @param \DateTime $dateCreatedAfter Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @param \DateTime $dateCreatedBefore Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @param string $channelDataTo Destination of a verification. It is phone number in E.164 format. * @param string $country Filter used to query Verification Attempts sent to the specified destination country. * @param string $channel Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL` * @param string $verifyServiceSid Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned. * @param string $verificationSid Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned. * @param string $status Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed. */ public function __construct( \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null, string $channelDataTo = Values::NONE, string $country = Values::NONE, string $channel = Values::NONE, string $verifyServiceSid = Values::NONE, string $verificationSid = Values::NONE, string $status = Values::NONE ) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['channelDataTo'] = $channelDataTo; $this->options['country'] = $country; $this->options['channel'] = $channel; $this->options['verifyServiceSid'] = $verifyServiceSid; $this->options['verificationSid'] = $verificationSid; $this->options['status'] = $status; } /** * Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * * @param \DateTime $dateCreatedAfter Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * * @param \DateTime $dateCreatedBefore Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Destination of a verification. It is phone number in E.164 format. * * @param string $channelDataTo Destination of a verification. It is phone number in E.164 format. * @return $this Fluent Builder */ public function setChannelDataTo(string $channelDataTo): self { $this->options['channelDataTo'] = $channelDataTo; return $this; } /** * Filter used to query Verification Attempts sent to the specified destination country. * * @param string $country Filter used to query Verification Attempts sent to the specified destination country. * @return $this Fluent Builder */ public function setCountry(string $country): self { $this->options['country'] = $country; return $this; } /** * Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL` * * @param string $channel Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL` * @return $this Fluent Builder */ public function setChannel(string $channel): self { $this->options['channel'] = $channel; return $this; } /** * Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned. * * @param string $verifyServiceSid Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned. * @return $this Fluent Builder */ public function setVerifyServiceSid(string $verifyServiceSid): self { $this->options['verifyServiceSid'] = $verifyServiceSid; return $this; } /** * Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned. * * @param string $verificationSid Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned. * @return $this Fluent Builder */ public function setVerificationSid(string $verificationSid): self { $this->options['verificationSid'] = $verificationSid; return $this; } /** * Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed. * * @param string $status Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.ReadVerificationAttemptOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/SafelistList.php 0000644 00000004512 15021223077 0015153 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class SafelistList extends ListResource { /** * Construct the SafelistList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/SafeList/Numbers'; } /** * Create the SafelistInstance * * @param string $phoneNumber The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * @return SafelistInstance Created SafelistInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $phoneNumber): SafelistInstance { $data = Values::of([ 'PhoneNumber' => $phoneNumber, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SafelistInstance( $this->version, $payload ); } /** * Constructs a SafelistContext * * @param string $phoneNumber The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). */ public function getContext( string $phoneNumber ): SafelistContext { return new SafelistContext( $this->version, $phoneNumber ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.SafelistList]'; } } sdk/src/Twilio/Rest/Verify/V2/ServiceInstance.php 0000644 00000017014 15021223077 0015633 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Verify\V2\Service\EntityList; use Twilio\Rest\Verify\V2\Service\VerificationCheckList; use Twilio\Rest\Verify\V2\Service\VerificationList; use Twilio\Rest\Verify\V2\Service\AccessTokenList; use Twilio\Rest\Verify\V2\Service\RateLimitList; use Twilio\Rest\Verify\V2\Service\WebhookList; use Twilio\Rest\Verify\V2\Service\MessagingConfigurationList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property int|null $codeLength * @property bool|null $lookupEnabled * @property bool|null $psd2Enabled * @property bool|null $skipSmsToLandlines * @property bool|null $dtmfInputRequired * @property string|null $ttsName * @property bool|null $doNotShareWarningEnabled * @property bool|null $customCodeEnabled * @property array|null $push * @property array|null $totp * @property string|null $defaultTemplateSid * @property bool|null $verifyEventSubscriptionEnabled * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class ServiceInstance extends InstanceResource { protected $_entities; protected $_verificationChecks; protected $_verifications; protected $_accessTokens; protected $_rateLimits; protected $_webhooks; protected $_messagingConfigurations; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The Twilio-provided string that uniquely identifies the Verification Service resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'codeLength' => Values::array_get($payload, 'code_length'), 'lookupEnabled' => Values::array_get($payload, 'lookup_enabled'), 'psd2Enabled' => Values::array_get($payload, 'psd2_enabled'), 'skipSmsToLandlines' => Values::array_get($payload, 'skip_sms_to_landlines'), 'dtmfInputRequired' => Values::array_get($payload, 'dtmf_input_required'), 'ttsName' => Values::array_get($payload, 'tts_name'), 'doNotShareWarningEnabled' => Values::array_get($payload, 'do_not_share_warning_enabled'), 'customCodeEnabled' => Values::array_get($payload, 'custom_code_enabled'), 'push' => Values::array_get($payload, 'push'), 'totp' => Values::array_get($payload, 'totp'), 'defaultTemplateSid' => Values::array_get($payload, 'default_template_sid'), 'verifyEventSubscriptionEnabled' => Values::array_get($payload, 'verify_event_subscription_enabled'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the entities */ protected function getEntities(): EntityList { return $this->proxy()->entities; } /** * Access the verificationChecks */ protected function getVerificationChecks(): VerificationCheckList { return $this->proxy()->verificationChecks; } /** * Access the verifications */ protected function getVerifications(): VerificationList { return $this->proxy()->verifications; } /** * Access the accessTokens */ protected function getAccessTokens(): AccessTokenList { return $this->proxy()->accessTokens; } /** * Access the rateLimits */ protected function getRateLimits(): RateLimitList { return $this->proxy()->rateLimits; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Access the messagingConfigurations */ protected function getMessagingConfigurations(): MessagingConfigurationList { return $this->proxy()->messagingConfigurations; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/ServiceList.php 0000644 00000017037 15021223077 0015007 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** * @param array|Options $options Optional Arguments * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'CodeLength' => $options['codeLength'], 'LookupEnabled' => Serialize::booleanToString($options['lookupEnabled']), 'SkipSmsToLandlines' => Serialize::booleanToString($options['skipSmsToLandlines']), 'DtmfInputRequired' => Serialize::booleanToString($options['dtmfInputRequired']), 'TtsName' => $options['ttsName'], 'Psd2Enabled' => Serialize::booleanToString($options['psd2Enabled']), 'DoNotShareWarningEnabled' => Serialize::booleanToString($options['doNotShareWarningEnabled']), 'CustomCodeEnabled' => Serialize::booleanToString($options['customCodeEnabled']), 'Push.IncludeDate' => Serialize::booleanToString($options['pushIncludeDate']), 'Push.ApnCredentialSid' => $options['pushApnCredentialSid'], 'Push.FcmCredentialSid' => $options['pushFcmCredentialSid'], 'Totp.Issuer' => $options['totpIssuer'], 'Totp.TimeStep' => $options['totpTimeStep'], 'Totp.CodeLength' => $options['totpCodeLength'], 'Totp.Skew' => $options['totpSkew'], 'DefaultTemplateSid' => $options['defaultTemplateSid'], 'VerifyEventSubscriptionEnabled' => Serialize::booleanToString($options['verifyEventSubscriptionEnabled']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The Twilio-provided string that uniquely identifies the Verification Service resource to delete. */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.ServiceList]'; } } sdk/src/Twilio/Rest/Verify/V2/TemplateInstance.php 0000644 00000004623 15021223077 0016010 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string[]|null $channels * @property array|null $translations */ class TemplateInstance extends InstanceResource { /** * Initialize the TemplateInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'channels' => Values::array_get($payload, 'channels'), 'translations' => Values::array_get($payload, 'translations'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.TemplateInstance]'; } } sdk/src/Twilio/Rest/Verify/V2/ServiceOptions.php 0000644 00000123401 15021223077 0015520 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param int $codeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. * @param bool $lookupEnabled Whether to perform a lookup with each verification started and return info about the phone number. * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. * @param bool $dtmfInputRequired Whether to ask the user to press a number before delivering the verify code in a phone call. * @param string $ttsName The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when starting a verification. * @param bool $doNotShareWarningEnabled Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code` * @param bool $customCodeEnabled Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. * @param bool $pushIncludeDate Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. This timestamp value is the same one as the one found in `date_created`, please use that one instead. * @param string $pushApnCredentialSid Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @param string $pushFcmCredentialSid Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @param string $totpIssuer Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. Defaults to the service friendly name if not provided. * @param int $totpTimeStep Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds * @param int $totpCodeLength Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 * @param int $totpSkew Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 * @param string $defaultTemplateSid The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. * @param bool $verifyEventSubscriptionEnabled Whether to allow verifications from the service to reach the stream-events sinks if configured * @return CreateServiceOptions Options builder */ public static function create( int $codeLength = Values::INT_NONE, bool $lookupEnabled = Values::BOOL_NONE, bool $skipSmsToLandlines = Values::BOOL_NONE, bool $dtmfInputRequired = Values::BOOL_NONE, string $ttsName = Values::NONE, bool $psd2Enabled = Values::BOOL_NONE, bool $doNotShareWarningEnabled = Values::BOOL_NONE, bool $customCodeEnabled = Values::BOOL_NONE, bool $pushIncludeDate = Values::BOOL_NONE, string $pushApnCredentialSid = Values::NONE, string $pushFcmCredentialSid = Values::NONE, string $totpIssuer = Values::NONE, int $totpTimeStep = Values::INT_NONE, int $totpCodeLength = Values::INT_NONE, int $totpSkew = Values::INT_NONE, string $defaultTemplateSid = Values::NONE, bool $verifyEventSubscriptionEnabled = Values::BOOL_NONE ): CreateServiceOptions { return new CreateServiceOptions( $codeLength, $lookupEnabled, $skipSmsToLandlines, $dtmfInputRequired, $ttsName, $psd2Enabled, $doNotShareWarningEnabled, $customCodeEnabled, $pushIncludeDate, $pushApnCredentialSid, $pushFcmCredentialSid, $totpIssuer, $totpTimeStep, $totpCodeLength, $totpSkew, $defaultTemplateSid, $verifyEventSubscriptionEnabled ); } /** * @param string $friendlyName A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** * @param int $codeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. * @param bool $lookupEnabled Whether to perform a lookup with each verification started and return info about the phone number. * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. * @param bool $dtmfInputRequired Whether to ask the user to press a number before delivering the verify code in a phone call. * @param string $ttsName The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when starting a verification. * @param bool $doNotShareWarningEnabled Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** * @param bool $customCodeEnabled Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. * @param bool $pushIncludeDate Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. * @param string $pushApnCredentialSid Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @param string $pushFcmCredentialSid Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @param string $totpIssuer Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. * @param int $totpTimeStep Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds * @param int $totpCodeLength Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 * @param int $totpSkew Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 * @param string $defaultTemplateSid The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. * @param bool $verifyEventSubscriptionEnabled Whether to allow verifications from the service to reach the stream-events sinks if configured * @return UpdateServiceOptions Options builder */ public static function update( string $friendlyName = Values::NONE, int $codeLength = Values::INT_NONE, bool $lookupEnabled = Values::BOOL_NONE, bool $skipSmsToLandlines = Values::BOOL_NONE, bool $dtmfInputRequired = Values::BOOL_NONE, string $ttsName = Values::NONE, bool $psd2Enabled = Values::BOOL_NONE, bool $doNotShareWarningEnabled = Values::BOOL_NONE, bool $customCodeEnabled = Values::BOOL_NONE, bool $pushIncludeDate = Values::BOOL_NONE, string $pushApnCredentialSid = Values::NONE, string $pushFcmCredentialSid = Values::NONE, string $totpIssuer = Values::NONE, int $totpTimeStep = Values::INT_NONE, int $totpCodeLength = Values::INT_NONE, int $totpSkew = Values::INT_NONE, string $defaultTemplateSid = Values::NONE, bool $verifyEventSubscriptionEnabled = Values::BOOL_NONE ): UpdateServiceOptions { return new UpdateServiceOptions( $friendlyName, $codeLength, $lookupEnabled, $skipSmsToLandlines, $dtmfInputRequired, $ttsName, $psd2Enabled, $doNotShareWarningEnabled, $customCodeEnabled, $pushIncludeDate, $pushApnCredentialSid, $pushFcmCredentialSid, $totpIssuer, $totpTimeStep, $totpCodeLength, $totpSkew, $defaultTemplateSid, $verifyEventSubscriptionEnabled ); } } class CreateServiceOptions extends Options { /** * @param int $codeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. * @param bool $lookupEnabled Whether to perform a lookup with each verification started and return info about the phone number. * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. * @param bool $dtmfInputRequired Whether to ask the user to press a number before delivering the verify code in a phone call. * @param string $ttsName The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when starting a verification. * @param bool $doNotShareWarningEnabled Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code` * @param bool $customCodeEnabled Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. * @param bool $pushIncludeDate Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. This timestamp value is the same one as the one found in `date_created`, please use that one instead. * @param string $pushApnCredentialSid Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @param string $pushFcmCredentialSid Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @param string $totpIssuer Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. Defaults to the service friendly name if not provided. * @param int $totpTimeStep Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds * @param int $totpCodeLength Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 * @param int $totpSkew Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 * @param string $defaultTemplateSid The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. * @param bool $verifyEventSubscriptionEnabled Whether to allow verifications from the service to reach the stream-events sinks if configured */ public function __construct( int $codeLength = Values::INT_NONE, bool $lookupEnabled = Values::BOOL_NONE, bool $skipSmsToLandlines = Values::BOOL_NONE, bool $dtmfInputRequired = Values::BOOL_NONE, string $ttsName = Values::NONE, bool $psd2Enabled = Values::BOOL_NONE, bool $doNotShareWarningEnabled = Values::BOOL_NONE, bool $customCodeEnabled = Values::BOOL_NONE, bool $pushIncludeDate = Values::BOOL_NONE, string $pushApnCredentialSid = Values::NONE, string $pushFcmCredentialSid = Values::NONE, string $totpIssuer = Values::NONE, int $totpTimeStep = Values::INT_NONE, int $totpCodeLength = Values::INT_NONE, int $totpSkew = Values::INT_NONE, string $defaultTemplateSid = Values::NONE, bool $verifyEventSubscriptionEnabled = Values::BOOL_NONE ) { $this->options['codeLength'] = $codeLength; $this->options['lookupEnabled'] = $lookupEnabled; $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; $this->options['dtmfInputRequired'] = $dtmfInputRequired; $this->options['ttsName'] = $ttsName; $this->options['psd2Enabled'] = $psd2Enabled; $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; $this->options['customCodeEnabled'] = $customCodeEnabled; $this->options['pushIncludeDate'] = $pushIncludeDate; $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; $this->options['totpIssuer'] = $totpIssuer; $this->options['totpTimeStep'] = $totpTimeStep; $this->options['totpCodeLength'] = $totpCodeLength; $this->options['totpSkew'] = $totpSkew; $this->options['defaultTemplateSid'] = $defaultTemplateSid; $this->options['verifyEventSubscriptionEnabled'] = $verifyEventSubscriptionEnabled; } /** * The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. * * @param int $codeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. * @return $this Fluent Builder */ public function setCodeLength(int $codeLength): self { $this->options['codeLength'] = $codeLength; return $this; } /** * Whether to perform a lookup with each verification started and return info about the phone number. * * @param bool $lookupEnabled Whether to perform a lookup with each verification started and return info about the phone number. * @return $this Fluent Builder */ public function setLookupEnabled(bool $lookupEnabled): self { $this->options['lookupEnabled'] = $lookupEnabled; return $this; } /** * Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. * * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. * @return $this Fluent Builder */ public function setSkipSmsToLandlines(bool $skipSmsToLandlines): self { $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; return $this; } /** * Whether to ask the user to press a number before delivering the verify code in a phone call. * * @param bool $dtmfInputRequired Whether to ask the user to press a number before delivering the verify code in a phone call. * @return $this Fluent Builder */ public function setDtmfInputRequired(bool $dtmfInputRequired): self { $this->options['dtmfInputRequired'] = $dtmfInputRequired; return $this; } /** * The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. * * @param string $ttsName The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. * @return $this Fluent Builder */ public function setTtsName(string $ttsName): self { $this->options['ttsName'] = $ttsName; return $this; } /** * Whether to pass PSD2 transaction parameters when starting a verification. * * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when starting a verification. * @return $this Fluent Builder */ public function setPsd2Enabled(bool $psd2Enabled): self { $this->options['psd2Enabled'] = $psd2Enabled; return $this; } /** * Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code` * * @param bool $doNotShareWarningEnabled Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code` * @return $this Fluent Builder */ public function setDoNotShareWarningEnabled(bool $doNotShareWarningEnabled): self { $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; return $this; } /** * Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. * * @param bool $customCodeEnabled Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. * @return $this Fluent Builder */ public function setCustomCodeEnabled(bool $customCodeEnabled): self { $this->options['customCodeEnabled'] = $customCodeEnabled; return $this; } /** * Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. This timestamp value is the same one as the one found in `date_created`, please use that one instead. * * @param bool $pushIncludeDate Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. This timestamp value is the same one as the one found in `date_created`, please use that one instead. * @return $this Fluent Builder */ public function setPushIncludeDate(bool $pushIncludeDate): self { $this->options['pushIncludeDate'] = $pushIncludeDate; return $this; } /** * Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * * @param string $pushApnCredentialSid Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @return $this Fluent Builder */ public function setPushApnCredentialSid(string $pushApnCredentialSid): self { $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; return $this; } /** * Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * * @param string $pushFcmCredentialSid Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @return $this Fluent Builder */ public function setPushFcmCredentialSid(string $pushFcmCredentialSid): self { $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; return $this; } /** * Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. Defaults to the service friendly name if not provided. * * @param string $totpIssuer Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. Defaults to the service friendly name if not provided. * @return $this Fluent Builder */ public function setTotpIssuer(string $totpIssuer): self { $this->options['totpIssuer'] = $totpIssuer; return $this; } /** * Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds * * @param int $totpTimeStep Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds * @return $this Fluent Builder */ public function setTotpTimeStep(int $totpTimeStep): self { $this->options['totpTimeStep'] = $totpTimeStep; return $this; } /** * Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 * * @param int $totpCodeLength Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 * @return $this Fluent Builder */ public function setTotpCodeLength(int $totpCodeLength): self { $this->options['totpCodeLength'] = $totpCodeLength; return $this; } /** * Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 * * @param int $totpSkew Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 * @return $this Fluent Builder */ public function setTotpSkew(int $totpSkew): self { $this->options['totpSkew'] = $totpSkew; return $this; } /** * The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. * * @param string $defaultTemplateSid The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. * @return $this Fluent Builder */ public function setDefaultTemplateSid(string $defaultTemplateSid): self { $this->options['defaultTemplateSid'] = $defaultTemplateSid; return $this; } /** * Whether to allow verifications from the service to reach the stream-events sinks if configured * * @param bool $verifyEventSubscriptionEnabled Whether to allow verifications from the service to reach the stream-events sinks if configured * @return $this Fluent Builder */ public function setVerifyEventSubscriptionEnabled(bool $verifyEventSubscriptionEnabled): self { $this->options['verifyEventSubscriptionEnabled'] = $verifyEventSubscriptionEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.CreateServiceOptions ' . $options . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** * @param int $codeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. * @param bool $lookupEnabled Whether to perform a lookup with each verification started and return info about the phone number. * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. * @param bool $dtmfInputRequired Whether to ask the user to press a number before delivering the verify code in a phone call. * @param string $ttsName The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when starting a verification. * @param bool $doNotShareWarningEnabled Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** * @param bool $customCodeEnabled Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. * @param bool $pushIncludeDate Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. * @param string $pushApnCredentialSid Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @param string $pushFcmCredentialSid Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @param string $totpIssuer Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. * @param int $totpTimeStep Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds * @param int $totpCodeLength Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 * @param int $totpSkew Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 * @param string $defaultTemplateSid The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. * @param bool $verifyEventSubscriptionEnabled Whether to allow verifications from the service to reach the stream-events sinks if configured */ public function __construct( string $friendlyName = Values::NONE, int $codeLength = Values::INT_NONE, bool $lookupEnabled = Values::BOOL_NONE, bool $skipSmsToLandlines = Values::BOOL_NONE, bool $dtmfInputRequired = Values::BOOL_NONE, string $ttsName = Values::NONE, bool $psd2Enabled = Values::BOOL_NONE, bool $doNotShareWarningEnabled = Values::BOOL_NONE, bool $customCodeEnabled = Values::BOOL_NONE, bool $pushIncludeDate = Values::BOOL_NONE, string $pushApnCredentialSid = Values::NONE, string $pushFcmCredentialSid = Values::NONE, string $totpIssuer = Values::NONE, int $totpTimeStep = Values::INT_NONE, int $totpCodeLength = Values::INT_NONE, int $totpSkew = Values::INT_NONE, string $defaultTemplateSid = Values::NONE, bool $verifyEventSubscriptionEnabled = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['codeLength'] = $codeLength; $this->options['lookupEnabled'] = $lookupEnabled; $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; $this->options['dtmfInputRequired'] = $dtmfInputRequired; $this->options['ttsName'] = $ttsName; $this->options['psd2Enabled'] = $psd2Enabled; $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; $this->options['customCodeEnabled'] = $customCodeEnabled; $this->options['pushIncludeDate'] = $pushIncludeDate; $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; $this->options['totpIssuer'] = $totpIssuer; $this->options['totpTimeStep'] = $totpTimeStep; $this->options['totpCodeLength'] = $totpCodeLength; $this->options['totpSkew'] = $totpSkew; $this->options['defaultTemplateSid'] = $defaultTemplateSid; $this->options['verifyEventSubscriptionEnabled'] = $verifyEventSubscriptionEnabled; } /** * A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** * * @param string $friendlyName A descriptive string that you create to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. * * @param int $codeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. * @return $this Fluent Builder */ public function setCodeLength(int $codeLength): self { $this->options['codeLength'] = $codeLength; return $this; } /** * Whether to perform a lookup with each verification started and return info about the phone number. * * @param bool $lookupEnabled Whether to perform a lookup with each verification started and return info about the phone number. * @return $this Fluent Builder */ public function setLookupEnabled(bool $lookupEnabled): self { $this->options['lookupEnabled'] = $lookupEnabled; return $this; } /** * Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. * * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. * @return $this Fluent Builder */ public function setSkipSmsToLandlines(bool $skipSmsToLandlines): self { $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; return $this; } /** * Whether to ask the user to press a number before delivering the verify code in a phone call. * * @param bool $dtmfInputRequired Whether to ask the user to press a number before delivering the verify code in a phone call. * @return $this Fluent Builder */ public function setDtmfInputRequired(bool $dtmfInputRequired): self { $this->options['dtmfInputRequired'] = $dtmfInputRequired; return $this; } /** * The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. * * @param string $ttsName The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. * @return $this Fluent Builder */ public function setTtsName(string $ttsName): self { $this->options['ttsName'] = $ttsName; return $this; } /** * Whether to pass PSD2 transaction parameters when starting a verification. * * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when starting a verification. * @return $this Fluent Builder */ public function setPsd2Enabled(bool $psd2Enabled): self { $this->options['psd2Enabled'] = $psd2Enabled; return $this; } /** * Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** * * @param bool $doNotShareWarningEnabled Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** * @return $this Fluent Builder */ public function setDoNotShareWarningEnabled(bool $doNotShareWarningEnabled): self { $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; return $this; } /** * Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. * * @param bool $customCodeEnabled Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. * @return $this Fluent Builder */ public function setCustomCodeEnabled(bool $customCodeEnabled): self { $this->options['customCodeEnabled'] = $customCodeEnabled; return $this; } /** * Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. * * @param bool $pushIncludeDate Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. * @return $this Fluent Builder */ public function setPushIncludeDate(bool $pushIncludeDate): self { $this->options['pushIncludeDate'] = $pushIncludeDate; return $this; } /** * Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * * @param string $pushApnCredentialSid Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @return $this Fluent Builder */ public function setPushApnCredentialSid(string $pushApnCredentialSid): self { $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; return $this; } /** * Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * * @param string $pushFcmCredentialSid Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) * @return $this Fluent Builder */ public function setPushFcmCredentialSid(string $pushFcmCredentialSid): self { $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; return $this; } /** * Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. * * @param string $totpIssuer Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. * @return $this Fluent Builder */ public function setTotpIssuer(string $totpIssuer): self { $this->options['totpIssuer'] = $totpIssuer; return $this; } /** * Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds * * @param int $totpTimeStep Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds * @return $this Fluent Builder */ public function setTotpTimeStep(int $totpTimeStep): self { $this->options['totpTimeStep'] = $totpTimeStep; return $this; } /** * Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 * * @param int $totpCodeLength Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 * @return $this Fluent Builder */ public function setTotpCodeLength(int $totpCodeLength): self { $this->options['totpCodeLength'] = $totpCodeLength; return $this; } /** * Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 * * @param int $totpSkew Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 * @return $this Fluent Builder */ public function setTotpSkew(int $totpSkew): self { $this->options['totpSkew'] = $totpSkew; return $this; } /** * The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. * * @param string $defaultTemplateSid The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. * @return $this Fluent Builder */ public function setDefaultTemplateSid(string $defaultTemplateSid): self { $this->options['defaultTemplateSid'] = $defaultTemplateSid; return $this; } /** * Whether to allow verifications from the service to reach the stream-events sinks if configured * * @param bool $verifyEventSubscriptionEnabled Whether to allow verifications from the service to reach the stream-events sinks if configured * @return $this Fluent Builder */ public function setVerifyEventSubscriptionEnabled(bool $verifyEventSubscriptionEnabled): self { $this->options['verifyEventSubscriptionEnabled'] = $verifyEventSubscriptionEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/SafelistContext.php 0000644 00000004573 15021223077 0015673 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class SafelistContext extends InstanceContext { /** * Initialize the SafelistContext * * @param Version $version Version that contains the resource * @param string $phoneNumber The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). */ public function __construct( Version $version, $phoneNumber ) { parent::__construct($version); // Path Solution $this->solution = [ 'phoneNumber' => $phoneNumber, ]; $this->uri = '/SafeList/Numbers/' . \rawurlencode($phoneNumber) .''; } /** * Delete the SafelistInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SafelistInstance * * @return SafelistInstance Fetched SafelistInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SafelistInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SafelistInstance( $this->version, $payload, $this->solution['phoneNumber'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.SafelistContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryOptions.php 0000644 00000017604 15021223077 0021651 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Options; use Twilio\Values; abstract class VerificationAttemptsSummaryOptions { /** * @param string $verifyServiceSid Filter used to consider only Verification Attempts of the given verify service on the summary aggregation. * @param \DateTime $dateCreatedAfter Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @param \DateTime $dateCreatedBefore Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @param string $country Filter used to consider only Verification Attempts sent to the specified destination country on the summary aggregation. * @param string $channel Filter Verification Attempts considered on the summary aggregation by communication channel. Valid values are `SMS`, `CALL` and `WHATSAPP` * @param string $destinationPrefix Filter the Verification Attempts considered on the summary aggregation by Destination prefix. It is the prefix of a phone number in E.164 format. * @return FetchVerificationAttemptsSummaryOptions Options builder */ public static function fetch( string $verifyServiceSid = Values::NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null, string $country = Values::NONE, string $channel = Values::NONE, string $destinationPrefix = Values::NONE ): FetchVerificationAttemptsSummaryOptions { return new FetchVerificationAttemptsSummaryOptions( $verifyServiceSid, $dateCreatedAfter, $dateCreatedBefore, $country, $channel, $destinationPrefix ); } } class FetchVerificationAttemptsSummaryOptions extends Options { /** * @param string $verifyServiceSid Filter used to consider only Verification Attempts of the given verify service on the summary aggregation. * @param \DateTime $dateCreatedAfter Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @param \DateTime $dateCreatedBefore Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @param string $country Filter used to consider only Verification Attempts sent to the specified destination country on the summary aggregation. * @param string $channel Filter Verification Attempts considered on the summary aggregation by communication channel. Valid values are `SMS`, `CALL` and `WHATSAPP` * @param string $destinationPrefix Filter the Verification Attempts considered on the summary aggregation by Destination prefix. It is the prefix of a phone number in E.164 format. */ public function __construct( string $verifyServiceSid = Values::NONE, \DateTime $dateCreatedAfter = null, \DateTime $dateCreatedBefore = null, string $country = Values::NONE, string $channel = Values::NONE, string $destinationPrefix = Values::NONE ) { $this->options['verifyServiceSid'] = $verifyServiceSid; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['country'] = $country; $this->options['channel'] = $channel; $this->options['destinationPrefix'] = $destinationPrefix; } /** * Filter used to consider only Verification Attempts of the given verify service on the summary aggregation. * * @param string $verifyServiceSid Filter used to consider only Verification Attempts of the given verify service on the summary aggregation. * @return $this Fluent Builder */ public function setVerifyServiceSid(string $verifyServiceSid): self { $this->options['verifyServiceSid'] = $verifyServiceSid; return $this; } /** * Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * * @param \DateTime $dateCreatedAfter Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @return $this Fluent Builder */ public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * * @param \DateTime $dateCreatedBefore Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in ISO 8601 formatted datetime string: yyyy-MM-dd'T'HH:mm:ss'Z. * @return $this Fluent Builder */ public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Filter used to consider only Verification Attempts sent to the specified destination country on the summary aggregation. * * @param string $country Filter used to consider only Verification Attempts sent to the specified destination country on the summary aggregation. * @return $this Fluent Builder */ public function setCountry(string $country): self { $this->options['country'] = $country; return $this; } /** * Filter Verification Attempts considered on the summary aggregation by communication channel. Valid values are `SMS`, `CALL` and `WHATSAPP` * * @param string $channel Filter Verification Attempts considered on the summary aggregation by communication channel. Valid values are `SMS`, `CALL` and `WHATSAPP` * @return $this Fluent Builder */ public function setChannel(string $channel): self { $this->options['channel'] = $channel; return $this; } /** * Filter the Verification Attempts considered on the summary aggregation by Destination prefix. It is the prefix of a phone number in E.164 format. * * @param string $destinationPrefix Filter the Verification Attempts considered on the summary aggregation by Destination prefix. It is the prefix of a phone number in E.164 format. * @return $this Fluent Builder */ public function setDestinationPrefix(string $destinationPrefix): self { $this->options['destinationPrefix'] = $destinationPrefix; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.FetchVerificationAttemptsSummaryOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptContext.php 0000644 00000004050 15021223077 0020070 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class VerificationAttemptContext extends InstanceContext { /** * Initialize the VerificationAttemptContext * * @param Version $version Version that contains the resource * @param string $sid The unique SID identifier of a Verification Attempt */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Attempts/' . \rawurlencode($sid) .''; } /** * Fetch the VerificationAttemptInstance * * @return VerificationAttemptInstance Fetched VerificationAttemptInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): VerificationAttemptInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new VerificationAttemptInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.VerificationAttemptContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryList.php 0000644 00000002675 15021223077 0021133 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\ListResource; use Twilio\Version; class VerificationAttemptsSummaryList extends ListResource { /** * Construct the VerificationAttemptsSummaryList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a VerificationAttemptsSummaryContext */ public function getContext( ): VerificationAttemptsSummaryContext { return new VerificationAttemptsSummaryContext( $this->version ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationAttemptsSummaryList]'; } } sdk/src/Twilio/Rest/Verify/V2/TemplateOptions.php 0000644 00000003741 15021223077 0015677 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Options; use Twilio\Values; abstract class TemplateOptions { /** * @param string $friendlyName String filter used to query templates with a given friendly name. * @return ReadTemplateOptions Options builder */ public static function read( string $friendlyName = Values::NONE ): ReadTemplateOptions { return new ReadTemplateOptions( $friendlyName ); } } class ReadTemplateOptions extends Options { /** * @param string $friendlyName String filter used to query templates with a given friendly name. */ public function __construct( string $friendlyName = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; } /** * String filter used to query templates with a given friendly name. * * @param string $friendlyName String filter used to query templates with a given friendly name. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Verify.V2.ReadTemplateOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryInstance.php 0000644 00000007240 15021223077 0021755 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property int|null $totalAttempts * @property int|null $totalConverted * @property int|null $totalUnconverted * @property string|null $conversionRatePercentage * @property string|null $url */ class VerificationAttemptsSummaryInstance extends InstanceResource { /** * Initialize the VerificationAttemptsSummaryInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'totalAttempts' => Values::array_get($payload, 'total_attempts'), 'totalConverted' => Values::array_get($payload, 'total_converted'), 'totalUnconverted' => Values::array_get($payload, 'total_unconverted'), 'conversionRatePercentage' => Values::array_get($payload, 'conversion_rate_percentage'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = []; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return VerificationAttemptsSummaryContext Context for this VerificationAttemptsSummaryInstance */ protected function proxy(): VerificationAttemptsSummaryContext { if (!$this->context) { $this->context = new VerificationAttemptsSummaryContext( $this->version ); } return $this->context; } /** * Fetch the VerificationAttemptsSummaryInstance * * @param array|Options $options Optional Arguments * @return VerificationAttemptsSummaryInstance Fetched VerificationAttemptsSummaryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): VerificationAttemptsSummaryInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.VerificationAttemptsSummaryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryContext.php 0000644 00000005205 15021223077 0021634 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class VerificationAttemptsSummaryContext extends InstanceContext { /** * Initialize the VerificationAttemptsSummaryContext * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Attempts/Summary'; } /** * Fetch the VerificationAttemptsSummaryInstance * * @param array|Options $options Optional Arguments * @return VerificationAttemptsSummaryInstance Fetched VerificationAttemptsSummaryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): VerificationAttemptsSummaryInstance { $options = new Values($options); $params = Values::of([ 'VerifyServiceSid' => $options['verifyServiceSid'], 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'Country' => $options['country'], 'Channel' => $options['channel'], 'DestinationPrefix' => $options['destinationPrefix'], ]); $payload = $this->version->fetch('GET', $this->uri, $params, []); return new VerificationAttemptsSummaryInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.VerificationAttemptsSummaryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/ServiceContext.php 0000644 00000022741 15021223077 0015516 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Verify\V2\Service\EntityList; use Twilio\Rest\Verify\V2\Service\VerificationCheckList; use Twilio\Rest\Verify\V2\Service\VerificationList; use Twilio\Rest\Verify\V2\Service\AccessTokenList; use Twilio\Rest\Verify\V2\Service\RateLimitList; use Twilio\Rest\Verify\V2\Service\WebhookList; use Twilio\Rest\Verify\V2\Service\MessagingConfigurationList; /** * @property EntityList $entities * @property VerificationCheckList $verificationChecks * @property VerificationList $verifications * @property AccessTokenList $accessTokens * @property RateLimitList $rateLimits * @property WebhookList $webhooks * @property MessagingConfigurationList $messagingConfigurations * @method \Twilio\Rest\Verify\V2\Service\VerificationContext verifications(string $sid) * @method \Twilio\Rest\Verify\V2\Service\AccessTokenContext accessTokens(string $sid) * @method \Twilio\Rest\Verify\V2\Service\WebhookContext webhooks(string $sid) * @method \Twilio\Rest\Verify\V2\Service\MessagingConfigurationContext messagingConfigurations(string $country) * @method \Twilio\Rest\Verify\V2\Service\EntityContext entities(string $identity) * @method \Twilio\Rest\Verify\V2\Service\RateLimitContext rateLimits(string $sid) */ class ServiceContext extends InstanceContext { protected $_entities; protected $_verificationChecks; protected $_verifications; protected $_accessTokens; protected $_rateLimits; protected $_webhooks; protected $_messagingConfigurations; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid The Twilio-provided string that uniquely identifies the Verification Service resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) .''; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'CodeLength' => $options['codeLength'], 'LookupEnabled' => Serialize::booleanToString($options['lookupEnabled']), 'SkipSmsToLandlines' => Serialize::booleanToString($options['skipSmsToLandlines']), 'DtmfInputRequired' => Serialize::booleanToString($options['dtmfInputRequired']), 'TtsName' => $options['ttsName'], 'Psd2Enabled' => Serialize::booleanToString($options['psd2Enabled']), 'DoNotShareWarningEnabled' => Serialize::booleanToString($options['doNotShareWarningEnabled']), 'CustomCodeEnabled' => Serialize::booleanToString($options['customCodeEnabled']), 'Push.IncludeDate' => Serialize::booleanToString($options['pushIncludeDate']), 'Push.ApnCredentialSid' => $options['pushApnCredentialSid'], 'Push.FcmCredentialSid' => $options['pushFcmCredentialSid'], 'Totp.Issuer' => $options['totpIssuer'], 'Totp.TimeStep' => $options['totpTimeStep'], 'Totp.CodeLength' => $options['totpCodeLength'], 'Totp.Skew' => $options['totpSkew'], 'DefaultTemplateSid' => $options['defaultTemplateSid'], 'VerifyEventSubscriptionEnabled' => Serialize::booleanToString($options['verifyEventSubscriptionEnabled']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the entities */ protected function getEntities(): EntityList { if (!$this->_entities) { $this->_entities = new EntityList( $this->version, $this->solution['sid'] ); } return $this->_entities; } /** * Access the verificationChecks */ protected function getVerificationChecks(): VerificationCheckList { if (!$this->_verificationChecks) { $this->_verificationChecks = new VerificationCheckList( $this->version, $this->solution['sid'] ); } return $this->_verificationChecks; } /** * Access the verifications */ protected function getVerifications(): VerificationList { if (!$this->_verifications) { $this->_verifications = new VerificationList( $this->version, $this->solution['sid'] ); } return $this->_verifications; } /** * Access the accessTokens */ protected function getAccessTokens(): AccessTokenList { if (!$this->_accessTokens) { $this->_accessTokens = new AccessTokenList( $this->version, $this->solution['sid'] ); } return $this->_accessTokens; } /** * Access the rateLimits */ protected function getRateLimits(): RateLimitList { if (!$this->_rateLimits) { $this->_rateLimits = new RateLimitList( $this->version, $this->solution['sid'] ); } return $this->_rateLimits; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version, $this->solution['sid'] ); } return $this->_webhooks; } /** * Access the messagingConfigurations */ protected function getMessagingConfigurations(): MessagingConfigurationList { if (!$this->_messagingConfigurations) { $this->_messagingConfigurations = new MessagingConfigurationList( $this->version, $this->solution['sid'] ); } return $this->_messagingConfigurations; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptInstance.php 0000644 00000010425 15021223077 0020213 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $verificationSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string $conversionStatus * @property string $channel * @property array|null $price * @property array|null $channelData * @property string|null $url */ class VerificationAttemptInstance extends InstanceResource { /** * Initialize the VerificationAttemptInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique SID identifier of a Verification Attempt */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'verificationSid' => Values::array_get($payload, 'verification_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'conversionStatus' => Values::array_get($payload, 'conversion_status'), 'channel' => Values::array_get($payload, 'channel'), 'price' => Values::array_get($payload, 'price'), 'channelData' => Values::array_get($payload, 'channel_data'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return VerificationAttemptContext Context for this VerificationAttemptInstance */ protected function proxy(): VerificationAttemptContext { if (!$this->context) { $this->context = new VerificationAttemptContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the VerificationAttemptInstance * * @return VerificationAttemptInstance Fetched VerificationAttemptInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): VerificationAttemptInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.VerificationAttemptInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/ServicePage.php 0000644 00000003012 15021223077 0014734 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ServiceInstance \Twilio\Rest\Verify\V2\ServiceInstance */ public function buildInstance(array $payload): ServiceInstance { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.ServicePage]'; } } sdk/src/Twilio/Rest/Verify/V2/TemplatePage.php 0000644 00000003020 15021223077 0015106 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TemplatePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TemplateInstance \Twilio\Rest\Verify\V2\TemplateInstance */ public function buildInstance(array $payload): TemplateInstance { return new TemplateInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.TemplatePage]'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptList.php 0000644 00000014272 15021223077 0017366 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class VerificationAttemptList extends ListResource { /** * Construct the VerificationAttemptList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Attempts'; } /** * Reads VerificationAttemptInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return VerificationAttemptInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams VerificationAttemptInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of VerificationAttemptInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return VerificationAttemptPage Page of VerificationAttemptInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): VerificationAttemptPage { $options = new Values($options); $params = Values::of([ 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'ChannelData.To' => $options['channelDataTo'], 'Country' => $options['country'], 'Channel' => $options['channel'], 'VerifyServiceSid' => $options['verifyServiceSid'], 'VerificationSid' => $options['verificationSid'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new VerificationAttemptPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of VerificationAttemptInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return VerificationAttemptPage Page of VerificationAttemptInstance */ public function getPage(string $targetUrl): VerificationAttemptPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new VerificationAttemptPage($this->version, $response, $this->solution); } /** * Constructs a VerificationAttemptContext * * @param string $sid The unique SID identifier of a Verification Attempt */ public function getContext( string $sid ): VerificationAttemptContext { return new VerificationAttemptContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationAttemptList]'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptPage.php 0000644 00000003122 15021223077 0017317 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class VerificationAttemptPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return VerificationAttemptInstance \Twilio\Rest\Verify\V2\VerificationAttemptInstance */ public function buildInstance(array $payload): VerificationAttemptInstance { return new VerificationAttemptInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationAttemptPage]'; } } sdk/src/Twilio/Rest/Verify/V2/SafelistPage.php 0000644 00000003020 15021223077 0015105 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SafelistPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SafelistInstance \Twilio\Rest\Verify\V2\SafelistInstance */ public function buildInstance(array $payload): SafelistInstance { return new SafelistInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.SafelistPage]'; } } sdk/src/Twilio/Rest/Verify/V2/FormContext.php 0000644 00000003727 15021223077 0015024 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class FormContext extends InstanceContext { /** * Initialize the FormContext * * @param Version $version Version that contains the resource * @param string $formType The Type of this Form. Currently only `form-push` is supported. */ public function __construct( Version $version, $formType ) { parent::__construct($version); // Path Solution $this->solution = [ 'formType' => $formType, ]; $this->uri = '/Forms/' . \rawurlencode($formType) .''; } /** * Fetch the FormInstance * * @return FormInstance Fetched FormInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FormInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new FormInstance( $this->version, $payload, $this->solution['formType'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.FormContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryPage.php 0000644 00000003202 15021223077 0021057 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class VerificationAttemptsSummaryPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return VerificationAttemptsSummaryInstance \Twilio\Rest\Verify\V2\VerificationAttemptsSummaryInstance */ public function buildInstance(array $payload): VerificationAttemptsSummaryInstance { return new VerificationAttemptsSummaryInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.VerificationAttemptsSummaryPage]'; } } sdk/src/Twilio/Rest/Verify/V2/FormInstance.php 0000644 00000006502 15021223077 0015136 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $formType * @property array|null $forms * @property array|null $formMeta * @property string|null $url */ class FormInstance extends InstanceResource { /** * Initialize the FormInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $formType The Type of this Form. Currently only `form-push` is supported. */ public function __construct(Version $version, array $payload, string $formType = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'formType' => Values::array_get($payload, 'form_type'), 'forms' => Values::array_get($payload, 'forms'), 'formMeta' => Values::array_get($payload, 'form_meta'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['formType' => $formType ?: $this->properties['formType'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FormContext Context for this FormInstance */ protected function proxy(): FormContext { if (!$this->context) { $this->context = new FormContext( $this->version, $this->solution['formType'] ); } return $this->context; } /** * Fetch the FormInstance * * @return FormInstance Fetched FormInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FormInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.FormInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/TemplateList.php 0000644 00000012133 15021223077 0015152 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TemplateList extends ListResource { /** * Construct the TemplateList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Templates'; } /** * Reads TemplateInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TemplateInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TemplateInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TemplateInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TemplatePage Page of TemplateInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TemplatePage { $options = new Values($options); $params = Values::of([ 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TemplatePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TemplateInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TemplatePage Page of TemplateInstance */ public function getPage(string $targetUrl): TemplatePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TemplatePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.TemplateList]'; } } sdk/src/Twilio/Rest/Verify/V2/FormList.php 0000644 00000002711 15021223077 0014303 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify\V2; use Twilio\ListResource; use Twilio\Version; class FormList extends ListResource { /** * Construct the FormList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a FormContext * * @param string $formType The Type of this Form. Currently only `form-push` is supported. */ public function getContext( string $formType ): FormContext { return new FormContext( $this->version, $formType ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2.FormList]'; } } sdk/src/Twilio/Rest/Verify/V2.php 0000644 00000011022 15021223077 0012537 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Verify * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Verify; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Verify\V2\FormList; use Twilio\Rest\Verify\V2\SafelistList; use Twilio\Rest\Verify\V2\ServiceList; use Twilio\Rest\Verify\V2\TemplateList; use Twilio\Rest\Verify\V2\VerificationAttemptList; use Twilio\Rest\Verify\V2\VerificationAttemptsSummaryList; use Twilio\Version; /** * @property FormList $forms * @property SafelistList $safelist * @property ServiceList $services * @property TemplateList $templates * @property VerificationAttemptList $verificationAttempts * @property VerificationAttemptsSummaryList $verificationAttemptsSummary * @method \Twilio\Rest\Verify\V2\FormContext forms(string $formType) * @method \Twilio\Rest\Verify\V2\SafelistContext safelist(string $phoneNumber) * @method \Twilio\Rest\Verify\V2\ServiceContext services(string $sid) * @method \Twilio\Rest\Verify\V2\VerificationAttemptContext verificationAttempts(string $sid) */ class V2 extends Version { protected $_forms; protected $_safelist; protected $_services; protected $_templates; protected $_verificationAttempts; protected $_verificationAttemptsSummary; /** * Construct the V2 version of Verify * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v2'; } protected function getForms(): FormList { if (!$this->_forms) { $this->_forms = new FormList($this); } return $this->_forms; } protected function getSafelist(): SafelistList { if (!$this->_safelist) { $this->_safelist = new SafelistList($this); } return $this->_safelist; } protected function getServices(): ServiceList { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } protected function getTemplates(): TemplateList { if (!$this->_templates) { $this->_templates = new TemplateList($this); } return $this->_templates; } protected function getVerificationAttempts(): VerificationAttemptList { if (!$this->_verificationAttempts) { $this->_verificationAttempts = new VerificationAttemptList($this); } return $this->_verificationAttempts; } protected function getVerificationAttemptsSummary(): VerificationAttemptsSummaryList { if (!$this->_verificationAttemptsSummary) { $this->_verificationAttemptsSummary = new VerificationAttemptsSummaryList($this); } return $this->_verificationAttemptsSummary; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Verify.V2]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsPage.php 0000644 00000003066 15021223077 0016565 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TrustProductsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TrustProductsInstance \Twilio\Rest\Trusthub\V1\TrustProductsInstance */ public function buildInstance(array $payload): TrustProductsInstance { return new TrustProductsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypePage.php 0000644 00000003154 15021223077 0020431 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SupportingDocumentTypePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SupportingDocumentTypeInstance \Twilio\Rest\Trusthub\V1\SupportingDocumentTypeInstance */ public function buildInstance(array $payload): SupportingDocumentTypeInstance { return new SupportingDocumentTypeInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.SupportingDocumentTypePage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/PoliciesContext.php 0000644 00000003731 15021223077 0016236 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class PoliciesContext extends InstanceContext { /** * Initialize the PoliciesContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the Policy resource. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Policies/' . \rawurlencode($sid) .''; } /** * Fetch the PoliciesInstance * * @return PoliciesInstance Fetched PoliciesInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PoliciesInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new PoliciesInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.PoliciesContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesOptions.php 0000644 00000042577 15021223077 0022151 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Options; use Twilio\Values; abstract class ComplianceTollfreeInquiriesOptions { /** * @param string $businessName The name of the business or organization using the Tollfree number. * @param string $businessWebsite The website of the business or organization using the Tollfree number. * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. * @param string $productionMessageSample An example of message content, i.e. a sample message. * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. * @param string $optInType * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. * @param string $businessCity The city of the business or organization using the Tollfree number. * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. * @param string $businessCountry The country of the business or organization using the Tollfree number. * @param string $additionalInformation Additional information to be provided for verification. * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. * @param string $businessContactPhone The phone number of the contact for the business or organization using the Tollfree number. * @return CreateComplianceTollfreeInquiriesOptions Options builder */ public static function create( string $businessName = Values::NONE, string $businessWebsite = Values::NONE, array $useCaseCategories = Values::ARRAY_NONE, string $useCaseSummary = Values::NONE, string $productionMessageSample = Values::NONE, array $optInImageUrls = Values::ARRAY_NONE, string $optInType = Values::NONE, string $messageVolume = Values::NONE, string $businessStreetAddress = Values::NONE, string $businessStreetAddress2 = Values::NONE, string $businessCity = Values::NONE, string $businessStateProvinceRegion = Values::NONE, string $businessPostalCode = Values::NONE, string $businessCountry = Values::NONE, string $additionalInformation = Values::NONE, string $businessContactFirstName = Values::NONE, string $businessContactLastName = Values::NONE, string $businessContactEmail = Values::NONE, string $businessContactPhone = Values::NONE ): CreateComplianceTollfreeInquiriesOptions { return new CreateComplianceTollfreeInquiriesOptions( $businessName, $businessWebsite, $useCaseCategories, $useCaseSummary, $productionMessageSample, $optInImageUrls, $optInType, $messageVolume, $businessStreetAddress, $businessStreetAddress2, $businessCity, $businessStateProvinceRegion, $businessPostalCode, $businessCountry, $additionalInformation, $businessContactFirstName, $businessContactLastName, $businessContactEmail, $businessContactPhone ); } } class CreateComplianceTollfreeInquiriesOptions extends Options { /** * @param string $businessName The name of the business or organization using the Tollfree number. * @param string $businessWebsite The website of the business or organization using the Tollfree number. * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. * @param string $productionMessageSample An example of message content, i.e. a sample message. * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. * @param string $optInType * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. * @param string $businessCity The city of the business or organization using the Tollfree number. * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. * @param string $businessCountry The country of the business or organization using the Tollfree number. * @param string $additionalInformation Additional information to be provided for verification. * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. * @param string $businessContactPhone The phone number of the contact for the business or organization using the Tollfree number. */ public function __construct( string $businessName = Values::NONE, string $businessWebsite = Values::NONE, array $useCaseCategories = Values::ARRAY_NONE, string $useCaseSummary = Values::NONE, string $productionMessageSample = Values::NONE, array $optInImageUrls = Values::ARRAY_NONE, string $optInType = Values::NONE, string $messageVolume = Values::NONE, string $businessStreetAddress = Values::NONE, string $businessStreetAddress2 = Values::NONE, string $businessCity = Values::NONE, string $businessStateProvinceRegion = Values::NONE, string $businessPostalCode = Values::NONE, string $businessCountry = Values::NONE, string $additionalInformation = Values::NONE, string $businessContactFirstName = Values::NONE, string $businessContactLastName = Values::NONE, string $businessContactEmail = Values::NONE, string $businessContactPhone = Values::NONE ) { $this->options['businessName'] = $businessName; $this->options['businessWebsite'] = $businessWebsite; $this->options['useCaseCategories'] = $useCaseCategories; $this->options['useCaseSummary'] = $useCaseSummary; $this->options['productionMessageSample'] = $productionMessageSample; $this->options['optInImageUrls'] = $optInImageUrls; $this->options['optInType'] = $optInType; $this->options['messageVolume'] = $messageVolume; $this->options['businessStreetAddress'] = $businessStreetAddress; $this->options['businessStreetAddress2'] = $businessStreetAddress2; $this->options['businessCity'] = $businessCity; $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; $this->options['businessPostalCode'] = $businessPostalCode; $this->options['businessCountry'] = $businessCountry; $this->options['additionalInformation'] = $additionalInformation; $this->options['businessContactFirstName'] = $businessContactFirstName; $this->options['businessContactLastName'] = $businessContactLastName; $this->options['businessContactEmail'] = $businessContactEmail; $this->options['businessContactPhone'] = $businessContactPhone; } /** * The name of the business or organization using the Tollfree number. * * @param string $businessName The name of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessName(string $businessName): self { $this->options['businessName'] = $businessName; return $this; } /** * The website of the business or organization using the Tollfree number. * * @param string $businessWebsite The website of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessWebsite(string $businessWebsite): self { $this->options['businessWebsite'] = $businessWebsite; return $this; } /** * The category of the use case for the Tollfree Number. List as many are applicable.. * * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. * @return $this Fluent Builder */ public function setUseCaseCategories(array $useCaseCategories): self { $this->options['useCaseCategories'] = $useCaseCategories; return $this; } /** * Use this to further explain how messaging is used by the business or organization. * * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. * @return $this Fluent Builder */ public function setUseCaseSummary(string $useCaseSummary): self { $this->options['useCaseSummary'] = $useCaseSummary; return $this; } /** * An example of message content, i.e. a sample message. * * @param string $productionMessageSample An example of message content, i.e. a sample message. * @return $this Fluent Builder */ public function setProductionMessageSample(string $productionMessageSample): self { $this->options['productionMessageSample'] = $productionMessageSample; return $this; } /** * Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. * * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. * @return $this Fluent Builder */ public function setOptInImageUrls(array $optInImageUrls): self { $this->options['optInImageUrls'] = $optInImageUrls; return $this; } /** * @param string $optInType * @return $this Fluent Builder */ public function setOptInType(string $optInType): self { $this->options['optInType'] = $optInType; return $this; } /** * Estimate monthly volume of messages from the Tollfree Number. * * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. * @return $this Fluent Builder */ public function setMessageVolume(string $messageVolume): self { $this->options['messageVolume'] = $messageVolume; return $this; } /** * The address of the business or organization using the Tollfree number. * * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessStreetAddress(string $businessStreetAddress): self { $this->options['businessStreetAddress'] = $businessStreetAddress; return $this; } /** * The address of the business or organization using the Tollfree number. * * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessStreetAddress2(string $businessStreetAddress2): self { $this->options['businessStreetAddress2'] = $businessStreetAddress2; return $this; } /** * The city of the business or organization using the Tollfree number. * * @param string $businessCity The city of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessCity(string $businessCity): self { $this->options['businessCity'] = $businessCity; return $this; } /** * The state/province/region of the business or organization using the Tollfree number. * * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessStateProvinceRegion(string $businessStateProvinceRegion): self { $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; return $this; } /** * The postal code of the business or organization using the Tollfree number. * * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessPostalCode(string $businessPostalCode): self { $this->options['businessPostalCode'] = $businessPostalCode; return $this; } /** * The country of the business or organization using the Tollfree number. * * @param string $businessCountry The country of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessCountry(string $businessCountry): self { $this->options['businessCountry'] = $businessCountry; return $this; } /** * Additional information to be provided for verification. * * @param string $additionalInformation Additional information to be provided for verification. * @return $this Fluent Builder */ public function setAdditionalInformation(string $additionalInformation): self { $this->options['additionalInformation'] = $additionalInformation; return $this; } /** * The first name of the contact for the business or organization using the Tollfree number. * * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactFirstName(string $businessContactFirstName): self { $this->options['businessContactFirstName'] = $businessContactFirstName; return $this; } /** * The last name of the contact for the business or organization using the Tollfree number. * * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactLastName(string $businessContactLastName): self { $this->options['businessContactLastName'] = $businessContactLastName; return $this; } /** * The email address of the contact for the business or organization using the Tollfree number. * * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactEmail(string $businessContactEmail): self { $this->options['businessContactEmail'] = $businessContactEmail; return $this; } /** * The phone number of the contact for the business or organization using the Tollfree number. * * @param string $businessContactPhone The phone number of the contact for the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessContactPhone(string $businessContactPhone): self { $this->options['businessContactPhone'] = $businessContactPhone; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.CreateComplianceTollfreeInquiriesOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsOptions.php 0000644 00000020110 15021223077 0017331 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Options; use Twilio\Values; abstract class TrustProductsOptions { /** * @param string $statusCallback The URL we call to inform your application of status changes. * @return CreateTrustProductsOptions Options builder */ public static function create( string $statusCallback = Values::NONE ): CreateTrustProductsOptions { return new CreateTrustProductsOptions( $statusCallback ); } /** * @param string $status The verification status of the Trust Product resource. * @param string $friendlyName The string that you assigned to describe the resource. * @param string $policySid The unique string of a policy that is associated to the Trust Product resource. * @return ReadTrustProductsOptions Options builder */ public static function read( string $status = Values::NONE, string $friendlyName = Values::NONE, string $policySid = Values::NONE ): ReadTrustProductsOptions { return new ReadTrustProductsOptions( $status, $friendlyName, $policySid ); } /** * @param string $status * @param string $statusCallback The URL we call to inform your application of status changes. * @param string $friendlyName The string that you assigned to describe the resource. * @param string $email The email address that will receive updates when the Trust Product resource changes status. * @return UpdateTrustProductsOptions Options builder */ public static function update( string $status = Values::NONE, string $statusCallback = Values::NONE, string $friendlyName = Values::NONE, string $email = Values::NONE ): UpdateTrustProductsOptions { return new UpdateTrustProductsOptions( $status, $statusCallback, $friendlyName, $email ); } } class CreateTrustProductsOptions extends Options { /** * @param string $statusCallback The URL we call to inform your application of status changes. */ public function __construct( string $statusCallback = Values::NONE ) { $this->options['statusCallback'] = $statusCallback; } /** * The URL we call to inform your application of status changes. * * @param string $statusCallback The URL we call to inform your application of status changes. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.CreateTrustProductsOptions ' . $options . ']'; } } class ReadTrustProductsOptions extends Options { /** * @param string $status The verification status of the Trust Product resource. * @param string $friendlyName The string that you assigned to describe the resource. * @param string $policySid The unique string of a policy that is associated to the Trust Product resource. */ public function __construct( string $status = Values::NONE, string $friendlyName = Values::NONE, string $policySid = Values::NONE ) { $this->options['status'] = $status; $this->options['friendlyName'] = $friendlyName; $this->options['policySid'] = $policySid; } /** * The verification status of the Trust Product resource. * * @param string $status The verification status of the Trust Product resource. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique string of a policy that is associated to the Trust Product resource. * * @param string $policySid The unique string of a policy that is associated to the Trust Product resource. * @return $this Fluent Builder */ public function setPolicySid(string $policySid): self { $this->options['policySid'] = $policySid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.ReadTrustProductsOptions ' . $options . ']'; } } class UpdateTrustProductsOptions extends Options { /** * @param string $status * @param string $statusCallback The URL we call to inform your application of status changes. * @param string $friendlyName The string that you assigned to describe the resource. * @param string $email The email address that will receive updates when the Trust Product resource changes status. */ public function __construct( string $status = Values::NONE, string $statusCallback = Values::NONE, string $friendlyName = Values::NONE, string $email = Values::NONE ) { $this->options['status'] = $status; $this->options['statusCallback'] = $statusCallback; $this->options['friendlyName'] = $friendlyName; $this->options['email'] = $email; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The URL we call to inform your application of status changes. * * @param string $statusCallback The URL we call to inform your application of status changes. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The email address that will receive updates when the Trust Product resource changes status. * * @param string $email The email address that will receive updates when the Trust Product resource changes status. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.UpdateTrustProductsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/PoliciesList.php 0000644 00000012131 15021223077 0015517 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class PoliciesList extends ListResource { /** * Construct the PoliciesList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Policies'; } /** * Reads PoliciesInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PoliciesInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams PoliciesInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of PoliciesInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return PoliciesPage Page of PoliciesInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): PoliciesPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new PoliciesPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PoliciesInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return PoliciesPage Page of PoliciesInstance */ public function getPage(string $targetUrl): PoliciesPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PoliciesPage($this->version, $response, $this->solution); } /** * Constructs a PoliciesContext * * @param string $sid The unique string that identifies the Policy resource. */ public function getContext( string $sid ): PoliciesContext { return new PoliciesContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.PoliciesList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesOptions.php 0000644 00000075363 15021223077 0023046 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Options; use Twilio\Values; abstract class ComplianceRegistrationInquiriesOptions { /** * @param string $businessIdentityType * @param string $businessRegistrationAuthority * @param string $businessLegalName he name of the business or organization using the Tollfree number. * @param string $notificationEmail he email address to receive the notification about the verification result. * @param bool $acceptedNotificationReceipt The email address to receive the notification about the verification result. * @param string $businessRegistrationNumber Business registration number of the business * @param string $businessWebsiteUrl The URL of the business website * @param string $friendlyName Friendly name for your business information * @param string $authorizedRepresentative1FirstName First name of the authorized representative * @param string $authorizedRepresentative1LastName Last name of the authorized representative * @param string $authorizedRepresentative1Phone Phone number of the authorized representative * @param string $authorizedRepresentative1Email Email address of the authorized representative * @param string $authorizedRepresentative1DateOfBirth Birthdate of the authorized representative * @param string $addressStreet Street address of the business * @param string $addressStreetSecondary Street address of the business * @param string $addressCity City of the business * @param string $addressSubdivision State or province of the business * @param string $addressPostalCode Postal code of the business * @param string $addressCountryCode Country code of the business * @param string $emergencyAddressStreet Street address of the business * @param string $emergencyAddressStreetSecondary Street address of the business * @param string $emergencyAddressCity City of the business * @param string $emergencyAddressSubdivision State or province of the business * @param string $emergencyAddressPostalCode Postal code of the business * @param string $emergencyAddressCountryCode Country code of the business * @param bool $useAddressAsEmergencyAddress Use the business address as the emergency address * @param string $fileName The name of the verification document to upload * @param string $file The verification document to upload * @param string $firstName The first name of the Individual User. * @param string $lastName The last name of the Individual User. * @param string $dateOfBirth The date of birth of the Individual User. * @param string $individualEmail The email address of the Individual User. * @param string $individualPhone The phone number of the Individual User. * @param bool $isIsvEmbed Indicates if the inquiry is being started from an ISV embedded component. * @param string $isvRegisteringForSelfOrTenant Indicates if the isv registering for self or tenant. * @param string $statusCallbackUrl The url we call to inform you of bundle changes. * @param string $themeSetId Theme id for styling the inquiry form. * @return CreateComplianceRegistrationInquiriesOptions Options builder */ public static function create( string $businessIdentityType = Values::NONE, string $businessRegistrationAuthority = Values::NONE, string $businessLegalName = Values::NONE, string $notificationEmail = Values::NONE, bool $acceptedNotificationReceipt = Values::BOOL_NONE, string $businessRegistrationNumber = Values::NONE, string $businessWebsiteUrl = Values::NONE, string $friendlyName = Values::NONE, string $authorizedRepresentative1FirstName = Values::NONE, string $authorizedRepresentative1LastName = Values::NONE, string $authorizedRepresentative1Phone = Values::NONE, string $authorizedRepresentative1Email = Values::NONE, string $authorizedRepresentative1DateOfBirth = Values::NONE, string $addressStreet = Values::NONE, string $addressStreetSecondary = Values::NONE, string $addressCity = Values::NONE, string $addressSubdivision = Values::NONE, string $addressPostalCode = Values::NONE, string $addressCountryCode = Values::NONE, string $emergencyAddressStreet = Values::NONE, string $emergencyAddressStreetSecondary = Values::NONE, string $emergencyAddressCity = Values::NONE, string $emergencyAddressSubdivision = Values::NONE, string $emergencyAddressPostalCode = Values::NONE, string $emergencyAddressCountryCode = Values::NONE, bool $useAddressAsEmergencyAddress = Values::BOOL_NONE, string $fileName = Values::NONE, string $file = Values::NONE, string $firstName = Values::NONE, string $lastName = Values::NONE, string $dateOfBirth = Values::NONE, string $individualEmail = Values::NONE, string $individualPhone = Values::NONE, bool $isIsvEmbed = Values::BOOL_NONE, string $isvRegisteringForSelfOrTenant = Values::NONE, string $statusCallbackUrl = Values::NONE, string $themeSetId = Values::NONE ): CreateComplianceRegistrationInquiriesOptions { return new CreateComplianceRegistrationInquiriesOptions( $businessIdentityType, $businessRegistrationAuthority, $businessLegalName, $notificationEmail, $acceptedNotificationReceipt, $businessRegistrationNumber, $businessWebsiteUrl, $friendlyName, $authorizedRepresentative1FirstName, $authorizedRepresentative1LastName, $authorizedRepresentative1Phone, $authorizedRepresentative1Email, $authorizedRepresentative1DateOfBirth, $addressStreet, $addressStreetSecondary, $addressCity, $addressSubdivision, $addressPostalCode, $addressCountryCode, $emergencyAddressStreet, $emergencyAddressStreetSecondary, $emergencyAddressCity, $emergencyAddressSubdivision, $emergencyAddressPostalCode, $emergencyAddressCountryCode, $useAddressAsEmergencyAddress, $fileName, $file, $firstName, $lastName, $dateOfBirth, $individualEmail, $individualPhone, $isIsvEmbed, $isvRegisteringForSelfOrTenant, $statusCallbackUrl, $themeSetId ); } /** * @param bool $isIsvEmbed Indicates if the inquiry is being started from an ISV embedded component. * @param string $themeSetId Theme id for styling the inquiry form. * @return UpdateComplianceRegistrationInquiriesOptions Options builder */ public static function update( bool $isIsvEmbed = Values::BOOL_NONE, string $themeSetId = Values::NONE ): UpdateComplianceRegistrationInquiriesOptions { return new UpdateComplianceRegistrationInquiriesOptions( $isIsvEmbed, $themeSetId ); } } class CreateComplianceRegistrationInquiriesOptions extends Options { /** * @param string $businessIdentityType * @param string $businessRegistrationAuthority * @param string $businessLegalName he name of the business or organization using the Tollfree number. * @param string $notificationEmail he email address to receive the notification about the verification result. * @param bool $acceptedNotificationReceipt The email address to receive the notification about the verification result. * @param string $businessRegistrationNumber Business registration number of the business * @param string $businessWebsiteUrl The URL of the business website * @param string $friendlyName Friendly name for your business information * @param string $authorizedRepresentative1FirstName First name of the authorized representative * @param string $authorizedRepresentative1LastName Last name of the authorized representative * @param string $authorizedRepresentative1Phone Phone number of the authorized representative * @param string $authorizedRepresentative1Email Email address of the authorized representative * @param string $authorizedRepresentative1DateOfBirth Birthdate of the authorized representative * @param string $addressStreet Street address of the business * @param string $addressStreetSecondary Street address of the business * @param string $addressCity City of the business * @param string $addressSubdivision State or province of the business * @param string $addressPostalCode Postal code of the business * @param string $addressCountryCode Country code of the business * @param string $emergencyAddressStreet Street address of the business * @param string $emergencyAddressStreetSecondary Street address of the business * @param string $emergencyAddressCity City of the business * @param string $emergencyAddressSubdivision State or province of the business * @param string $emergencyAddressPostalCode Postal code of the business * @param string $emergencyAddressCountryCode Country code of the business * @param bool $useAddressAsEmergencyAddress Use the business address as the emergency address * @param string $fileName The name of the verification document to upload * @param string $file The verification document to upload * @param string $firstName The first name of the Individual User. * @param string $lastName The last name of the Individual User. * @param string $dateOfBirth The date of birth of the Individual User. * @param string $individualEmail The email address of the Individual User. * @param string $individualPhone The phone number of the Individual User. * @param bool $isIsvEmbed Indicates if the inquiry is being started from an ISV embedded component. * @param string $isvRegisteringForSelfOrTenant Indicates if the isv registering for self or tenant. * @param string $statusCallbackUrl The url we call to inform you of bundle changes. * @param string $themeSetId Theme id for styling the inquiry form. */ public function __construct( string $businessIdentityType = Values::NONE, string $businessRegistrationAuthority = Values::NONE, string $businessLegalName = Values::NONE, string $notificationEmail = Values::NONE, bool $acceptedNotificationReceipt = Values::BOOL_NONE, string $businessRegistrationNumber = Values::NONE, string $businessWebsiteUrl = Values::NONE, string $friendlyName = Values::NONE, string $authorizedRepresentative1FirstName = Values::NONE, string $authorizedRepresentative1LastName = Values::NONE, string $authorizedRepresentative1Phone = Values::NONE, string $authorizedRepresentative1Email = Values::NONE, string $authorizedRepresentative1DateOfBirth = Values::NONE, string $addressStreet = Values::NONE, string $addressStreetSecondary = Values::NONE, string $addressCity = Values::NONE, string $addressSubdivision = Values::NONE, string $addressPostalCode = Values::NONE, string $addressCountryCode = Values::NONE, string $emergencyAddressStreet = Values::NONE, string $emergencyAddressStreetSecondary = Values::NONE, string $emergencyAddressCity = Values::NONE, string $emergencyAddressSubdivision = Values::NONE, string $emergencyAddressPostalCode = Values::NONE, string $emergencyAddressCountryCode = Values::NONE, bool $useAddressAsEmergencyAddress = Values::BOOL_NONE, string $fileName = Values::NONE, string $file = Values::NONE, string $firstName = Values::NONE, string $lastName = Values::NONE, string $dateOfBirth = Values::NONE, string $individualEmail = Values::NONE, string $individualPhone = Values::NONE, bool $isIsvEmbed = Values::BOOL_NONE, string $isvRegisteringForSelfOrTenant = Values::NONE, string $statusCallbackUrl = Values::NONE, string $themeSetId = Values::NONE ) { $this->options['businessIdentityType'] = $businessIdentityType; $this->options['businessRegistrationAuthority'] = $businessRegistrationAuthority; $this->options['businessLegalName'] = $businessLegalName; $this->options['notificationEmail'] = $notificationEmail; $this->options['acceptedNotificationReceipt'] = $acceptedNotificationReceipt; $this->options['businessRegistrationNumber'] = $businessRegistrationNumber; $this->options['businessWebsiteUrl'] = $businessWebsiteUrl; $this->options['friendlyName'] = $friendlyName; $this->options['authorizedRepresentative1FirstName'] = $authorizedRepresentative1FirstName; $this->options['authorizedRepresentative1LastName'] = $authorizedRepresentative1LastName; $this->options['authorizedRepresentative1Phone'] = $authorizedRepresentative1Phone; $this->options['authorizedRepresentative1Email'] = $authorizedRepresentative1Email; $this->options['authorizedRepresentative1DateOfBirth'] = $authorizedRepresentative1DateOfBirth; $this->options['addressStreet'] = $addressStreet; $this->options['addressStreetSecondary'] = $addressStreetSecondary; $this->options['addressCity'] = $addressCity; $this->options['addressSubdivision'] = $addressSubdivision; $this->options['addressPostalCode'] = $addressPostalCode; $this->options['addressCountryCode'] = $addressCountryCode; $this->options['emergencyAddressStreet'] = $emergencyAddressStreet; $this->options['emergencyAddressStreetSecondary'] = $emergencyAddressStreetSecondary; $this->options['emergencyAddressCity'] = $emergencyAddressCity; $this->options['emergencyAddressSubdivision'] = $emergencyAddressSubdivision; $this->options['emergencyAddressPostalCode'] = $emergencyAddressPostalCode; $this->options['emergencyAddressCountryCode'] = $emergencyAddressCountryCode; $this->options['useAddressAsEmergencyAddress'] = $useAddressAsEmergencyAddress; $this->options['fileName'] = $fileName; $this->options['file'] = $file; $this->options['firstName'] = $firstName; $this->options['lastName'] = $lastName; $this->options['dateOfBirth'] = $dateOfBirth; $this->options['individualEmail'] = $individualEmail; $this->options['individualPhone'] = $individualPhone; $this->options['isIsvEmbed'] = $isIsvEmbed; $this->options['isvRegisteringForSelfOrTenant'] = $isvRegisteringForSelfOrTenant; $this->options['statusCallbackUrl'] = $statusCallbackUrl; $this->options['themeSetId'] = $themeSetId; } /** * @param string $businessIdentityType * @return $this Fluent Builder */ public function setBusinessIdentityType(string $businessIdentityType): self { $this->options['businessIdentityType'] = $businessIdentityType; return $this; } /** * @param string $businessRegistrationAuthority * @return $this Fluent Builder */ public function setBusinessRegistrationAuthority(string $businessRegistrationAuthority): self { $this->options['businessRegistrationAuthority'] = $businessRegistrationAuthority; return $this; } /** * he name of the business or organization using the Tollfree number. * * @param string $businessLegalName he name of the business or organization using the Tollfree number. * @return $this Fluent Builder */ public function setBusinessLegalName(string $businessLegalName): self { $this->options['businessLegalName'] = $businessLegalName; return $this; } /** * he email address to receive the notification about the verification result. * * @param string $notificationEmail he email address to receive the notification about the verification result. * @return $this Fluent Builder */ public function setNotificationEmail(string $notificationEmail): self { $this->options['notificationEmail'] = $notificationEmail; return $this; } /** * The email address to receive the notification about the verification result. * * @param bool $acceptedNotificationReceipt The email address to receive the notification about the verification result. * @return $this Fluent Builder */ public function setAcceptedNotificationReceipt(bool $acceptedNotificationReceipt): self { $this->options['acceptedNotificationReceipt'] = $acceptedNotificationReceipt; return $this; } /** * Business registration number of the business * * @param string $businessRegistrationNumber Business registration number of the business * @return $this Fluent Builder */ public function setBusinessRegistrationNumber(string $businessRegistrationNumber): self { $this->options['businessRegistrationNumber'] = $businessRegistrationNumber; return $this; } /** * The URL of the business website * * @param string $businessWebsiteUrl The URL of the business website * @return $this Fluent Builder */ public function setBusinessWebsiteUrl(string $businessWebsiteUrl): self { $this->options['businessWebsiteUrl'] = $businessWebsiteUrl; return $this; } /** * Friendly name for your business information * * @param string $friendlyName Friendly name for your business information * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * First name of the authorized representative * * @param string $authorizedRepresentative1FirstName First name of the authorized representative * @return $this Fluent Builder */ public function setAuthorizedRepresentative1FirstName(string $authorizedRepresentative1FirstName): self { $this->options['authorizedRepresentative1FirstName'] = $authorizedRepresentative1FirstName; return $this; } /** * Last name of the authorized representative * * @param string $authorizedRepresentative1LastName Last name of the authorized representative * @return $this Fluent Builder */ public function setAuthorizedRepresentative1LastName(string $authorizedRepresentative1LastName): self { $this->options['authorizedRepresentative1LastName'] = $authorizedRepresentative1LastName; return $this; } /** * Phone number of the authorized representative * * @param string $authorizedRepresentative1Phone Phone number of the authorized representative * @return $this Fluent Builder */ public function setAuthorizedRepresentative1Phone(string $authorizedRepresentative1Phone): self { $this->options['authorizedRepresentative1Phone'] = $authorizedRepresentative1Phone; return $this; } /** * Email address of the authorized representative * * @param string $authorizedRepresentative1Email Email address of the authorized representative * @return $this Fluent Builder */ public function setAuthorizedRepresentative1Email(string $authorizedRepresentative1Email): self { $this->options['authorizedRepresentative1Email'] = $authorizedRepresentative1Email; return $this; } /** * Birthdate of the authorized representative * * @param string $authorizedRepresentative1DateOfBirth Birthdate of the authorized representative * @return $this Fluent Builder */ public function setAuthorizedRepresentative1DateOfBirth(string $authorizedRepresentative1DateOfBirth): self { $this->options['authorizedRepresentative1DateOfBirth'] = $authorizedRepresentative1DateOfBirth; return $this; } /** * Street address of the business * * @param string $addressStreet Street address of the business * @return $this Fluent Builder */ public function setAddressStreet(string $addressStreet): self { $this->options['addressStreet'] = $addressStreet; return $this; } /** * Street address of the business * * @param string $addressStreetSecondary Street address of the business * @return $this Fluent Builder */ public function setAddressStreetSecondary(string $addressStreetSecondary): self { $this->options['addressStreetSecondary'] = $addressStreetSecondary; return $this; } /** * City of the business * * @param string $addressCity City of the business * @return $this Fluent Builder */ public function setAddressCity(string $addressCity): self { $this->options['addressCity'] = $addressCity; return $this; } /** * State or province of the business * * @param string $addressSubdivision State or province of the business * @return $this Fluent Builder */ public function setAddressSubdivision(string $addressSubdivision): self { $this->options['addressSubdivision'] = $addressSubdivision; return $this; } /** * Postal code of the business * * @param string $addressPostalCode Postal code of the business * @return $this Fluent Builder */ public function setAddressPostalCode(string $addressPostalCode): self { $this->options['addressPostalCode'] = $addressPostalCode; return $this; } /** * Country code of the business * * @param string $addressCountryCode Country code of the business * @return $this Fluent Builder */ public function setAddressCountryCode(string $addressCountryCode): self { $this->options['addressCountryCode'] = $addressCountryCode; return $this; } /** * Street address of the business * * @param string $emergencyAddressStreet Street address of the business * @return $this Fluent Builder */ public function setEmergencyAddressStreet(string $emergencyAddressStreet): self { $this->options['emergencyAddressStreet'] = $emergencyAddressStreet; return $this; } /** * Street address of the business * * @param string $emergencyAddressStreetSecondary Street address of the business * @return $this Fluent Builder */ public function setEmergencyAddressStreetSecondary(string $emergencyAddressStreetSecondary): self { $this->options['emergencyAddressStreetSecondary'] = $emergencyAddressStreetSecondary; return $this; } /** * City of the business * * @param string $emergencyAddressCity City of the business * @return $this Fluent Builder */ public function setEmergencyAddressCity(string $emergencyAddressCity): self { $this->options['emergencyAddressCity'] = $emergencyAddressCity; return $this; } /** * State or province of the business * * @param string $emergencyAddressSubdivision State or province of the business * @return $this Fluent Builder */ public function setEmergencyAddressSubdivision(string $emergencyAddressSubdivision): self { $this->options['emergencyAddressSubdivision'] = $emergencyAddressSubdivision; return $this; } /** * Postal code of the business * * @param string $emergencyAddressPostalCode Postal code of the business * @return $this Fluent Builder */ public function setEmergencyAddressPostalCode(string $emergencyAddressPostalCode): self { $this->options['emergencyAddressPostalCode'] = $emergencyAddressPostalCode; return $this; } /** * Country code of the business * * @param string $emergencyAddressCountryCode Country code of the business * @return $this Fluent Builder */ public function setEmergencyAddressCountryCode(string $emergencyAddressCountryCode): self { $this->options['emergencyAddressCountryCode'] = $emergencyAddressCountryCode; return $this; } /** * Use the business address as the emergency address * * @param bool $useAddressAsEmergencyAddress Use the business address as the emergency address * @return $this Fluent Builder */ public function setUseAddressAsEmergencyAddress(bool $useAddressAsEmergencyAddress): self { $this->options['useAddressAsEmergencyAddress'] = $useAddressAsEmergencyAddress; return $this; } /** * The name of the verification document to upload * * @param string $fileName The name of the verification document to upload * @return $this Fluent Builder */ public function setFileName(string $fileName): self { $this->options['fileName'] = $fileName; return $this; } /** * The verification document to upload * * @param string $file The verification document to upload * @return $this Fluent Builder */ public function setFile(string $file): self { $this->options['file'] = $file; return $this; } /** * The first name of the Individual User. * * @param string $firstName The first name of the Individual User. * @return $this Fluent Builder */ public function setFirstName(string $firstName): self { $this->options['firstName'] = $firstName; return $this; } /** * The last name of the Individual User. * * @param string $lastName The last name of the Individual User. * @return $this Fluent Builder */ public function setLastName(string $lastName): self { $this->options['lastName'] = $lastName; return $this; } /** * The date of birth of the Individual User. * * @param string $dateOfBirth The date of birth of the Individual User. * @return $this Fluent Builder */ public function setDateOfBirth(string $dateOfBirth): self { $this->options['dateOfBirth'] = $dateOfBirth; return $this; } /** * The email address of the Individual User. * * @param string $individualEmail The email address of the Individual User. * @return $this Fluent Builder */ public function setIndividualEmail(string $individualEmail): self { $this->options['individualEmail'] = $individualEmail; return $this; } /** * The phone number of the Individual User. * * @param string $individualPhone The phone number of the Individual User. * @return $this Fluent Builder */ public function setIndividualPhone(string $individualPhone): self { $this->options['individualPhone'] = $individualPhone; return $this; } /** * Indicates if the inquiry is being started from an ISV embedded component. * * @param bool $isIsvEmbed Indicates if the inquiry is being started from an ISV embedded component. * @return $this Fluent Builder */ public function setIsIsvEmbed(bool $isIsvEmbed): self { $this->options['isIsvEmbed'] = $isIsvEmbed; return $this; } /** * Indicates if the isv registering for self or tenant. * * @param string $isvRegisteringForSelfOrTenant Indicates if the isv registering for self or tenant. * @return $this Fluent Builder */ public function setIsvRegisteringForSelfOrTenant(string $isvRegisteringForSelfOrTenant): self { $this->options['isvRegisteringForSelfOrTenant'] = $isvRegisteringForSelfOrTenant; return $this; } /** * The url we call to inform you of bundle changes. * * @param string $statusCallbackUrl The url we call to inform you of bundle changes. * @return $this Fluent Builder */ public function setStatusCallbackUrl(string $statusCallbackUrl): self { $this->options['statusCallbackUrl'] = $statusCallbackUrl; return $this; } /** * Theme id for styling the inquiry form. * * @param string $themeSetId Theme id for styling the inquiry form. * @return $this Fluent Builder */ public function setThemeSetId(string $themeSetId): self { $this->options['themeSetId'] = $themeSetId; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.CreateComplianceRegistrationInquiriesOptions ' . $options . ']'; } } class UpdateComplianceRegistrationInquiriesOptions extends Options { /** * @param bool $isIsvEmbed Indicates if the inquiry is being started from an ISV embedded component. * @param string $themeSetId Theme id for styling the inquiry form. */ public function __construct( bool $isIsvEmbed = Values::BOOL_NONE, string $themeSetId = Values::NONE ) { $this->options['isIsvEmbed'] = $isIsvEmbed; $this->options['themeSetId'] = $themeSetId; } /** * Indicates if the inquiry is being started from an ISV embedded component. * * @param bool $isIsvEmbed Indicates if the inquiry is being started from an ISV embedded component. * @return $this Fluent Builder */ public function setIsIsvEmbed(bool $isIsvEmbed): self { $this->options['isIsvEmbed'] = $isIsvEmbed; return $this; } /** * Theme id for styling the inquiry form. * * @param string $themeSetId Theme id for styling the inquiry form. * @return $this Fluent Builder */ public function setThemeSetId(string $themeSetId): self { $this->options['themeSetId'] = $themeSetId; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.UpdateComplianceRegistrationInquiriesOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentList.php 0000644 00000014571 15021223077 0017633 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class SupportingDocumentList extends ListResource { /** * Construct the SupportingDocumentList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/SupportingDocuments'; } /** * Create the SupportingDocumentInstance * * @param string $friendlyName The string that you assigned to describe the resource. * @param string $type The type of the Supporting Document. * @param array|Options $options Optional Arguments * @return SupportingDocumentInstance Created SupportingDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $options = []): SupportingDocumentInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Attributes' => Serialize::jsonObject($options['attributes']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new SupportingDocumentInstance( $this->version, $payload ); } /** * Reads SupportingDocumentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SupportingDocumentInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SupportingDocumentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SupportingDocumentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SupportingDocumentPage Page of SupportingDocumentInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SupportingDocumentPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SupportingDocumentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SupportingDocumentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SupportingDocumentPage Page of SupportingDocumentInstance */ public function getPage(string $targetUrl): SupportingDocumentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SupportingDocumentPage($this->version, $response, $this->solution); } /** * Constructs a SupportingDocumentContext * * @param string $sid The unique string created by Twilio to identify the Supporting Document resource. */ public function getContext( string $sid ): SupportingDocumentContext { return new SupportingDocumentContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.SupportingDocumentList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesContext.php 0000644 00000005451 15021223077 0023026 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class ComplianceRegistrationInquiriesContext extends InstanceContext { /** * Initialize the ComplianceRegistrationInquiriesContext * * @param Version $version Version that contains the resource * @param string $registrationId The unique RegistrationId matching the Regulatory Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Regulatory Compliance Inquiry creation call. */ public function __construct( Version $version, $registrationId ) { parent::__construct($version); // Path Solution $this->solution = [ 'registrationId' => $registrationId, ]; $this->uri = '/ComplianceInquiries/Registration/' . \rawurlencode($registrationId) .'/RegulatoryCompliance/GB/Initialize'; } /** * Update the ComplianceRegistrationInquiriesInstance * * @param array|Options $options Optional Arguments * @return ComplianceRegistrationInquiriesInstance Updated ComplianceRegistrationInquiriesInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ComplianceRegistrationInquiriesInstance { $options = new Values($options); $data = Values::of([ 'IsIsvEmbed' => Serialize::booleanToString($options['isIsvEmbed']), 'ThemeSetId' => $options['themeSetId'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ComplianceRegistrationInquiriesInstance( $this->version, $payload, $this->solution['registrationId'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.ComplianceRegistrationInquiriesContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsContext.php 0000644 00000015414 15021223077 0017335 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsChannelEndpointAssignmentList; use Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsEvaluationsList; use Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsEntityAssignmentsList; /** * @property TrustProductsChannelEndpointAssignmentList $trustProductsChannelEndpointAssignment * @property TrustProductsEvaluationsList $trustProductsEvaluations * @property TrustProductsEntityAssignmentsList $trustProductsEntityAssignments * @method \Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsChannelEndpointAssignmentContext trustProductsChannelEndpointAssignment(string $sid) * @method \Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsEntityAssignmentsContext trustProductsEntityAssignments(string $sid) * @method \Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsEvaluationsContext trustProductsEvaluations(string $sid) */ class TrustProductsContext extends InstanceContext { protected $_trustProductsChannelEndpointAssignment; protected $_trustProductsEvaluations; protected $_trustProductsEntityAssignments; /** * Initialize the TrustProductsContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that we created to identify the Trust Product resource. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/TrustProducts/' . \rawurlencode($sid) .''; } /** * Delete the TrustProductsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the TrustProductsInstance * * @return TrustProductsInstance Fetched TrustProductsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new TrustProductsInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the TrustProductsInstance * * @param array|Options $options Optional Arguments * @return TrustProductsInstance Updated TrustProductsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TrustProductsInstance { $options = new Values($options); $data = Values::of([ 'Status' => $options['status'], 'StatusCallback' => $options['statusCallback'], 'FriendlyName' => $options['friendlyName'], 'Email' => $options['email'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new TrustProductsInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the trustProductsChannelEndpointAssignment */ protected function getTrustProductsChannelEndpointAssignment(): TrustProductsChannelEndpointAssignmentList { if (!$this->_trustProductsChannelEndpointAssignment) { $this->_trustProductsChannelEndpointAssignment = new TrustProductsChannelEndpointAssignmentList( $this->version, $this->solution['sid'] ); } return $this->_trustProductsChannelEndpointAssignment; } /** * Access the trustProductsEvaluations */ protected function getTrustProductsEvaluations(): TrustProductsEvaluationsList { if (!$this->_trustProductsEvaluations) { $this->_trustProductsEvaluations = new TrustProductsEvaluationsList( $this->version, $this->solution['sid'] ); } return $this->_trustProductsEvaluations; } /** * Access the trustProductsEntityAssignments */ protected function getTrustProductsEntityAssignments(): TrustProductsEntityAssignmentsList { if (!$this->_trustProductsEntityAssignments) { $this->_trustProductsEntityAssignments = new TrustProductsEntityAssignmentsList( $this->version, $this->solution['sid'] ); } return $this->_trustProductsEntityAssignments; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeList.php 0000644 00000012604 15021223077 0020470 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class SupportingDocumentTypeList extends ListResource { /** * Construct the SupportingDocumentTypeList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/SupportingDocumentTypes'; } /** * Reads SupportingDocumentTypeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SupportingDocumentTypeInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams SupportingDocumentTypeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of SupportingDocumentTypeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return SupportingDocumentTypePage Page of SupportingDocumentTypeInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): SupportingDocumentTypePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new SupportingDocumentTypePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SupportingDocumentTypeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return SupportingDocumentTypePage Page of SupportingDocumentTypeInstance */ public function getPage(string $targetUrl): SupportingDocumentTypePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SupportingDocumentTypePage($this->version, $response, $this->solution); } /** * Constructs a SupportingDocumentTypeContext * * @param string $sid The unique string that identifies the Supporting Document Type resource. */ public function getContext( string $sid ): SupportingDocumentTypeContext { return new SupportingDocumentTypeContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.SupportingDocumentTypeList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesPage.php 0000644 00000003242 15021223077 0022252 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ComplianceRegistrationInquiriesPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ComplianceRegistrationInquiriesInstance \Twilio\Rest\Trusthub\V1\ComplianceRegistrationInquiriesInstance */ public function buildInstance(array $payload): ComplianceRegistrationInquiriesInstance { return new ComplianceRegistrationInquiriesInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.ComplianceRegistrationInquiriesPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeContext.php 0000644 00000004152 15021223077 0021200 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class SupportingDocumentTypeContext extends InstanceContext { /** * Initialize the SupportingDocumentTypeContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the Supporting Document Type resource. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/SupportingDocumentTypes/' . \rawurlencode($sid) .''; } /** * Fetch the SupportingDocumentTypeInstance * * @return SupportingDocumentTypeInstance Fetched SupportingDocumentTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SupportingDocumentTypeInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SupportingDocumentTypeInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.SupportingDocumentTypeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesList.php 0000644 00000010040 15021223077 0021405 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ComplianceTollfreeInquiriesList extends ListResource { /** * Construct the ComplianceTollfreeInquiriesList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/ComplianceInquiries/Tollfree/Initialize'; } /** * Create the ComplianceTollfreeInquiriesInstance * * @param string $tollfreePhoneNumber The Tollfree phone number to be verified * @param string $notificationEmail The email address to receive the notification about the verification result. * @param array|Options $options Optional Arguments * @return ComplianceTollfreeInquiriesInstance Created ComplianceTollfreeInquiriesInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $tollfreePhoneNumber, string $notificationEmail, array $options = []): ComplianceTollfreeInquiriesInstance { $options = new Values($options); $data = Values::of([ 'TollfreePhoneNumber' => $tollfreePhoneNumber, 'NotificationEmail' => $notificationEmail, 'BusinessName' => $options['businessName'], 'BusinessWebsite' => $options['businessWebsite'], 'UseCaseCategories' => Serialize::map($options['useCaseCategories'], function ($e) { return $e; }), 'UseCaseSummary' => $options['useCaseSummary'], 'ProductionMessageSample' => $options['productionMessageSample'], 'OptInImageUrls' => Serialize::map($options['optInImageUrls'], function ($e) { return $e; }), 'OptInType' => $options['optInType'], 'MessageVolume' => $options['messageVolume'], 'BusinessStreetAddress' => $options['businessStreetAddress'], 'BusinessStreetAddress2' => $options['businessStreetAddress2'], 'BusinessCity' => $options['businessCity'], 'BusinessStateProvinceRegion' => $options['businessStateProvinceRegion'], 'BusinessPostalCode' => $options['businessPostalCode'], 'BusinessCountry' => $options['businessCountry'], 'AdditionalInformation' => $options['additionalInformation'], 'BusinessContactFirstName' => $options['businessContactFirstName'], 'BusinessContactLastName' => $options['businessContactLastName'], 'BusinessContactEmail' => $options['businessContactEmail'], 'BusinessContactPhone' => $options['businessContactPhone'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ComplianceTollfreeInquiriesInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.ComplianceTollfreeInquiriesList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserOptions.php 0000644 00000010535 15021223077 0016043 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Options; use Twilio\Values; abstract class EndUserOptions { /** * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. * @return CreateEndUserOptions Options builder */ public static function create( array $attributes = Values::ARRAY_NONE ): CreateEndUserOptions { return new CreateEndUserOptions( $attributes ); } /** * @param string $friendlyName The string that you assigned to describe the resource. * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. * @return UpdateEndUserOptions Options builder */ public static function update( string $friendlyName = Values::NONE, array $attributes = Values::ARRAY_NONE ): UpdateEndUserOptions { return new UpdateEndUserOptions( $friendlyName, $attributes ); } } class CreateEndUserOptions extends Options { /** * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. */ public function __construct( array $attributes = Values::ARRAY_NONE ) { $this->options['attributes'] = $attributes; } /** * The set of parameters that are the attributes of the End User resource which are derived End User Types. * * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. * @return $this Fluent Builder */ public function setAttributes(array $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.CreateEndUserOptions ' . $options . ']'; } } class UpdateEndUserOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the resource. * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. */ public function __construct( string $friendlyName = Values::NONE, array $attributes = Values::ARRAY_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The set of parameters that are the attributes of the End User resource which are derived End User Types. * * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. * @return $this Fluent Builder */ public function setAttributes(array $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.UpdateEndUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeInstance.php 0000644 00000007160 15021223077 0021322 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string|null $friendlyName * @property string|null $machineName * @property array[]|null $fields * @property string|null $url */ class SupportingDocumentTypeInstance extends InstanceResource { /** * Initialize the SupportingDocumentTypeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the Supporting Document Type resource. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'machineName' => Values::array_get($payload, 'machine_name'), 'fields' => Values::array_get($payload, 'fields'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SupportingDocumentTypeContext Context for this SupportingDocumentTypeInstance */ protected function proxy(): SupportingDocumentTypeContext { if (!$this->context) { $this->context = new SupportingDocumentTypeContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the SupportingDocumentTypeInstance * * @return SupportingDocumentTypeInstance Fetched SupportingDocumentTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SupportingDocumentTypeInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.SupportingDocumentTypeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesOptions.php 0000644 00000020234 15021223077 0020000 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Options; use Twilio\Values; abstract class CustomerProfilesOptions { /** * @param string $statusCallback The URL we call to inform your application of status changes. * @return CreateCustomerProfilesOptions Options builder */ public static function create( string $statusCallback = Values::NONE ): CreateCustomerProfilesOptions { return new CreateCustomerProfilesOptions( $statusCallback ); } /** * @param string $status The verification status of the Customer-Profile resource. * @param string $friendlyName The string that you assigned to describe the resource. * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. * @return ReadCustomerProfilesOptions Options builder */ public static function read( string $status = Values::NONE, string $friendlyName = Values::NONE, string $policySid = Values::NONE ): ReadCustomerProfilesOptions { return new ReadCustomerProfilesOptions( $status, $friendlyName, $policySid ); } /** * @param string $status * @param string $statusCallback The URL we call to inform your application of status changes. * @param string $friendlyName The string that you assigned to describe the resource. * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. * @return UpdateCustomerProfilesOptions Options builder */ public static function update( string $status = Values::NONE, string $statusCallback = Values::NONE, string $friendlyName = Values::NONE, string $email = Values::NONE ): UpdateCustomerProfilesOptions { return new UpdateCustomerProfilesOptions( $status, $statusCallback, $friendlyName, $email ); } } class CreateCustomerProfilesOptions extends Options { /** * @param string $statusCallback The URL we call to inform your application of status changes. */ public function __construct( string $statusCallback = Values::NONE ) { $this->options['statusCallback'] = $statusCallback; } /** * The URL we call to inform your application of status changes. * * @param string $statusCallback The URL we call to inform your application of status changes. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.CreateCustomerProfilesOptions ' . $options . ']'; } } class ReadCustomerProfilesOptions extends Options { /** * @param string $status The verification status of the Customer-Profile resource. * @param string $friendlyName The string that you assigned to describe the resource. * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. */ public function __construct( string $status = Values::NONE, string $friendlyName = Values::NONE, string $policySid = Values::NONE ) { $this->options['status'] = $status; $this->options['friendlyName'] = $friendlyName; $this->options['policySid'] = $policySid; } /** * The verification status of the Customer-Profile resource. * * @param string $status The verification status of the Customer-Profile resource. * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique string of a policy that is associated to the Customer-Profile resource. * * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. * @return $this Fluent Builder */ public function setPolicySid(string $policySid): self { $this->options['policySid'] = $policySid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.ReadCustomerProfilesOptions ' . $options . ']'; } } class UpdateCustomerProfilesOptions extends Options { /** * @param string $status * @param string $statusCallback The URL we call to inform your application of status changes. * @param string $friendlyName The string that you assigned to describe the resource. * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. */ public function __construct( string $status = Values::NONE, string $statusCallback = Values::NONE, string $friendlyName = Values::NONE, string $email = Values::NONE ) { $this->options['status'] = $status; $this->options['statusCallback'] = $statusCallback; $this->options['friendlyName'] = $friendlyName; $this->options['email'] = $email; } /** * @param string $status * @return $this Fluent Builder */ public function setStatus(string $status): self { $this->options['status'] = $status; return $this; } /** * The URL we call to inform your application of status changes. * * @param string $statusCallback The URL we call to inform your application of status changes. * @return $this Fluent Builder */ public function setStatusCallback(string $statusCallback): self { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The email address that will receive updates when the Customer-Profile resource changes status. * * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.UpdateCustomerProfilesOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserContext.php 0000644 00000006065 15021223077 0016037 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class EndUserContext extends InstanceContext { /** * Initialize the EndUserContext * * @param Version $version Version that contains the resource * @param string $sid The unique string created by Twilio to identify the End User resource. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/EndUsers/' . \rawurlencode($sid) .''; } /** * Delete the EndUserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the EndUserInstance * * @return EndUserInstance Fetched EndUserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EndUserInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new EndUserInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the EndUserInstance * * @param array|Options $options Optional Arguments * @return EndUserInstance Updated EndUserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): EndUserInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'Attributes' => Serialize::jsonObject($options['attributes']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new EndUserInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.EndUserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesPage.php 0000644 00000003132 15021223077 0017655 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ComplianceInquiriesPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ComplianceInquiriesInstance \Twilio\Rest\Trusthub\V1\ComplianceInquiriesInstance */ public function buildInstance(array $payload): ComplianceInquiriesInstance { return new ComplianceInquiriesInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.ComplianceInquiriesPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesInstance.php 0000644 00000014257 15021223077 0020121 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesChannelEndpointAssignmentList; use Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesEntityAssignmentsList; use Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesEvaluationsList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $policySid * @property string|null $friendlyName * @property string $status * @property \DateTime|null $validUntil * @property string|null $email * @property string|null $statusCallback * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class CustomerProfilesInstance extends InstanceResource { protected $_customerProfilesChannelEndpointAssignment; protected $_customerProfilesEntityAssignments; protected $_customerProfilesEvaluations; /** * Initialize the CustomerProfilesInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that we created to identify the Customer-Profile resource. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'policySid' => Values::array_get($payload, 'policy_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'validUntil' => Deserialize::dateTime(Values::array_get($payload, 'valid_until')), 'email' => Values::array_get($payload, 'email'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CustomerProfilesContext Context for this CustomerProfilesInstance */ protected function proxy(): CustomerProfilesContext { if (!$this->context) { $this->context = new CustomerProfilesContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CustomerProfilesInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CustomerProfilesInstance * * @return CustomerProfilesInstance Fetched CustomerProfilesInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesInstance { return $this->proxy()->fetch(); } /** * Update the CustomerProfilesInstance * * @param array|Options $options Optional Arguments * @return CustomerProfilesInstance Updated CustomerProfilesInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CustomerProfilesInstance { return $this->proxy()->update($options); } /** * Access the customerProfilesChannelEndpointAssignment */ protected function getCustomerProfilesChannelEndpointAssignment(): CustomerProfilesChannelEndpointAssignmentList { return $this->proxy()->customerProfilesChannelEndpointAssignment; } /** * Access the customerProfilesEntityAssignments */ protected function getCustomerProfilesEntityAssignments(): CustomerProfilesEntityAssignmentsList { return $this->proxy()->customerProfilesEntityAssignments; } /** * Access the customerProfilesEvaluations */ protected function getCustomerProfilesEvaluations(): CustomerProfilesEvaluationsList { return $this->proxy()->customerProfilesEvaluations; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentPage.php 0000644 00000003414 15021223077 0026452 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\TrustProducts; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TrustProductsChannelEndpointAssignmentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TrustProductsChannelEndpointAssignmentInstance \Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsChannelEndpointAssignmentInstance */ public function buildInstance(array $payload): TrustProductsChannelEndpointAssignmentInstance { return new TrustProductsChannelEndpointAssignmentInstance($this->version, $payload, $this->solution['trustProductSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentInstance.php 0000644 00000011207 15021223077 0027341 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\TrustProducts; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $trustProductSid * @property string|null $accountSid * @property string|null $channelEndpointType * @property string|null $channelEndpointSid * @property \DateTime|null $dateCreated * @property string|null $url */ class TrustProductsChannelEndpointAssignmentInstance extends InstanceResource { /** * Initialize the TrustProductsChannelEndpointAssignmentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trustProductSid The unique string that we created to identify the CustomerProfile resource. * @param string $sid The unique string that we created to identify the resource. */ public function __construct(Version $version, array $payload, string $trustProductSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelEndpointType' => Values::array_get($payload, 'channel_endpoint_type'), 'channelEndpointSid' => Values::array_get($payload, 'channel_endpoint_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['trustProductSid' => $trustProductSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TrustProductsChannelEndpointAssignmentContext Context for this TrustProductsChannelEndpointAssignmentInstance */ protected function proxy(): TrustProductsChannelEndpointAssignmentContext { if (!$this->context) { $this->context = new TrustProductsChannelEndpointAssignmentContext( $this->version, $this->solution['trustProductSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the TrustProductsChannelEndpointAssignmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TrustProductsChannelEndpointAssignmentInstance * * @return TrustProductsChannelEndpointAssignmentInstance Fetched TrustProductsChannelEndpointAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsChannelEndpointAssignmentInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsContext.php 0000644 00000004640 15021223077 0024414 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\TrustProducts; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class TrustProductsEvaluationsContext extends InstanceContext { /** * Initialize the TrustProductsEvaluationsContext * * @param Version $version Version that contains the resource * @param string $trustProductSid The unique string that we created to identify the trust_product resource. * @param string $sid The unique string that identifies the Evaluation resource. */ public function __construct( Version $version, $trustProductSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trustProductSid' => $trustProductSid, 'sid' => $sid, ]; $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) .'/Evaluations/' . \rawurlencode($sid) .''; } /** * Fetch the TrustProductsEvaluationsInstance * * @return TrustProductsEvaluationsInstance Fetched TrustProductsEvaluationsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsEvaluationsInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new TrustProductsEvaluationsInstance( $this->version, $payload, $this->solution['trustProductSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsEvaluationsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsInstance.php 0000644 00000010610 15021223077 0025724 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\TrustProducts; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $trustProductSid * @property string|null $accountSid * @property string|null $objectSid * @property \DateTime|null $dateCreated * @property string|null $url */ class TrustProductsEntityAssignmentsInstance extends InstanceResource { /** * Initialize the TrustProductsEntityAssignmentsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trustProductSid The unique string that we created to identify the TrustProduct resource. * @param string $sid The unique string that we created to identify the Identity resource. */ public function __construct(Version $version, array $payload, string $trustProductSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'objectSid' => Values::array_get($payload, 'object_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['trustProductSid' => $trustProductSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TrustProductsEntityAssignmentsContext Context for this TrustProductsEntityAssignmentsInstance */ protected function proxy(): TrustProductsEntityAssignmentsContext { if (!$this->context) { $this->context = new TrustProductsEntityAssignmentsContext( $this->version, $this->solution['trustProductSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the TrustProductsEntityAssignmentsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TrustProductsEntityAssignmentsInstance * * @return TrustProductsEntityAssignmentsInstance Fetched TrustProductsEntityAssignmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsEntityAssignmentsInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsPage.php 0000644 00000003334 15021223077 0025041 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\TrustProducts; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TrustProductsEntityAssignmentsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TrustProductsEntityAssignmentsInstance \Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsEntityAssignmentsInstance */ public function buildInstance(array $payload): TrustProductsEntityAssignmentsInstance { return new TrustProductsEntityAssignmentsInstance($this->version, $payload, $this->solution['trustProductSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsOptions.php 0000644 00000005167 15021223077 0025626 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\TrustProducts; use Twilio\Options; use Twilio\Values; abstract class TrustProductsEntityAssignmentsOptions { /** * @param string $objectType A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. * @return ReadTrustProductsEntityAssignmentsOptions Options builder */ public static function read( string $objectType = Values::NONE ): ReadTrustProductsEntityAssignmentsOptions { return new ReadTrustProductsEntityAssignmentsOptions( $objectType ); } } class ReadTrustProductsEntityAssignmentsOptions extends Options { /** * @param string $objectType A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. */ public function __construct( string $objectType = Values::NONE ) { $this->options['objectType'] = $objectType; } /** * A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. * * @param string $objectType A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. * @return $this Fluent Builder */ public function setObjectType(string $objectType): self { $this->options['objectType'] = $objectType; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.ReadTrustProductsEntityAssignmentsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentOptions.php 0000644 00000005552 15021223077 0027236 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\TrustProducts; use Twilio\Options; use Twilio\Values; abstract class TrustProductsChannelEndpointAssignmentOptions { /** * @param string $channelEndpointSid The SID of an channel endpoint * @param string $channelEndpointSids comma separated list of channel endpoint sids * @return ReadTrustProductsChannelEndpointAssignmentOptions Options builder */ public static function read( string $channelEndpointSid = Values::NONE, string $channelEndpointSids = Values::NONE ): ReadTrustProductsChannelEndpointAssignmentOptions { return new ReadTrustProductsChannelEndpointAssignmentOptions( $channelEndpointSid, $channelEndpointSids ); } } class ReadTrustProductsChannelEndpointAssignmentOptions extends Options { /** * @param string $channelEndpointSid The SID of an channel endpoint * @param string $channelEndpointSids comma separated list of channel endpoint sids */ public function __construct( string $channelEndpointSid = Values::NONE, string $channelEndpointSids = Values::NONE ) { $this->options['channelEndpointSid'] = $channelEndpointSid; $this->options['channelEndpointSids'] = $channelEndpointSids; } /** * The SID of an channel endpoint * * @param string $channelEndpointSid The SID of an channel endpoint * @return $this Fluent Builder */ public function setChannelEndpointSid(string $channelEndpointSid): self { $this->options['channelEndpointSid'] = $channelEndpointSid; return $this; } /** * comma separated list of channel endpoint sids * * @param string $channelEndpointSids comma separated list of channel endpoint sids * @return $this Fluent Builder */ public function setChannelEndpointSids(string $channelEndpointSids): self { $this->options['channelEndpointSids'] = $channelEndpointSids; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.ReadTrustProductsChannelEndpointAssignmentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsInstance.php 0000644 00000010333 15021223077 0024530 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\TrustProducts; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $policySid * @property string|null $trustProductSid * @property string $status * @property array[]|null $results * @property \DateTime|null $dateCreated * @property string|null $url */ class TrustProductsEvaluationsInstance extends InstanceResource { /** * Initialize the TrustProductsEvaluationsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trustProductSid The unique string that we created to identify the trust_product resource. * @param string $sid The unique string that identifies the Evaluation resource. */ public function __construct(Version $version, array $payload, string $trustProductSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'policySid' => Values::array_get($payload, 'policy_sid'), 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), 'status' => Values::array_get($payload, 'status'), 'results' => Values::array_get($payload, 'results'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['trustProductSid' => $trustProductSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TrustProductsEvaluationsContext Context for this TrustProductsEvaluationsInstance */ protected function proxy(): TrustProductsEvaluationsContext { if (!$this->context) { $this->context = new TrustProductsEvaluationsContext( $this->version, $this->solution['trustProductSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the TrustProductsEvaluationsInstance * * @return TrustProductsEvaluationsInstance Fetched TrustProductsEvaluationsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsEvaluationsInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsEvaluationsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentList.php 0000644 00000016710 15021223077 0026514 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\TrustProducts; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TrustProductsChannelEndpointAssignmentList extends ListResource { /** * Construct the TrustProductsChannelEndpointAssignmentList * * @param Version $version Version that contains the resource * @param string $trustProductSid The unique string that we created to identify the CustomerProfile resource. */ public function __construct( Version $version, string $trustProductSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trustProductSid' => $trustProductSid, ]; $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) .'/ChannelEndpointAssignments'; } /** * Create the TrustProductsChannelEndpointAssignmentInstance * * @param string $channelEndpointType The type of channel endpoint. eg: phone-number * @param string $channelEndpointSid The SID of an channel endpoint * @return TrustProductsChannelEndpointAssignmentInstance Created TrustProductsChannelEndpointAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $channelEndpointType, string $channelEndpointSid): TrustProductsChannelEndpointAssignmentInstance { $data = Values::of([ 'ChannelEndpointType' => $channelEndpointType, 'ChannelEndpointSid' => $channelEndpointSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TrustProductsChannelEndpointAssignmentInstance( $this->version, $payload, $this->solution['trustProductSid'] ); } /** * Reads TrustProductsChannelEndpointAssignmentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TrustProductsChannelEndpointAssignmentInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TrustProductsChannelEndpointAssignmentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TrustProductsChannelEndpointAssignmentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TrustProductsChannelEndpointAssignmentPage Page of TrustProductsChannelEndpointAssignmentInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TrustProductsChannelEndpointAssignmentPage { $options = new Values($options); $params = Values::of([ 'ChannelEndpointSid' => $options['channelEndpointSid'], 'ChannelEndpointSids' => $options['channelEndpointSids'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TrustProductsChannelEndpointAssignmentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TrustProductsChannelEndpointAssignmentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TrustProductsChannelEndpointAssignmentPage Page of TrustProductsChannelEndpointAssignmentInstance */ public function getPage(string $targetUrl): TrustProductsChannelEndpointAssignmentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TrustProductsChannelEndpointAssignmentPage($this->version, $response, $this->solution); } /** * Constructs a TrustProductsChannelEndpointAssignmentContext * * @param string $sid The unique string that we created to identify the resource. */ public function getContext( string $sid ): TrustProductsChannelEndpointAssignmentContext { return new TrustProductsChannelEndpointAssignmentContext( $this->version, $this->solution['trustProductSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsList.php 0000644 00000015743 15021223077 0025107 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\TrustProducts; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TrustProductsEntityAssignmentsList extends ListResource { /** * Construct the TrustProductsEntityAssignmentsList * * @param Version $version Version that contains the resource * @param string $trustProductSid The unique string that we created to identify the TrustProduct resource. */ public function __construct( Version $version, string $trustProductSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trustProductSid' => $trustProductSid, ]; $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) .'/EntityAssignments'; } /** * Create the TrustProductsEntityAssignmentsInstance * * @param string $objectSid The SID of an object bag that holds information of the different items. * @return TrustProductsEntityAssignmentsInstance Created TrustProductsEntityAssignmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $objectSid): TrustProductsEntityAssignmentsInstance { $data = Values::of([ 'ObjectSid' => $objectSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TrustProductsEntityAssignmentsInstance( $this->version, $payload, $this->solution['trustProductSid'] ); } /** * Reads TrustProductsEntityAssignmentsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TrustProductsEntityAssignmentsInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TrustProductsEntityAssignmentsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TrustProductsEntityAssignmentsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TrustProductsEntityAssignmentsPage Page of TrustProductsEntityAssignmentsInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TrustProductsEntityAssignmentsPage { $options = new Values($options); $params = Values::of([ 'ObjectType' => $options['objectType'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TrustProductsEntityAssignmentsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TrustProductsEntityAssignmentsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TrustProductsEntityAssignmentsPage Page of TrustProductsEntityAssignmentsInstance */ public function getPage(string $targetUrl): TrustProductsEntityAssignmentsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TrustProductsEntityAssignmentsPage($this->version, $response, $this->solution); } /** * Constructs a TrustProductsEntityAssignmentsContext * * @param string $sid The unique string that we created to identify the Identity resource. */ public function getContext( string $sid ): TrustProductsEntityAssignmentsContext { return new TrustProductsEntityAssignmentsContext( $this->version, $this->solution['trustProductSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentContext.php 0000644 00000005540 15021223077 0027224 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\TrustProducts; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class TrustProductsChannelEndpointAssignmentContext extends InstanceContext { /** * Initialize the TrustProductsChannelEndpointAssignmentContext * * @param Version $version Version that contains the resource * @param string $trustProductSid The unique string that we created to identify the CustomerProfile resource. * @param string $sid The unique string that we created to identify the resource. */ public function __construct( Version $version, $trustProductSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trustProductSid' => $trustProductSid, 'sid' => $sid, ]; $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) .'/ChannelEndpointAssignments/' . \rawurlencode($sid) .''; } /** * Delete the TrustProductsChannelEndpointAssignmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the TrustProductsChannelEndpointAssignmentInstance * * @return TrustProductsChannelEndpointAssignmentInstance Fetched TrustProductsChannelEndpointAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsChannelEndpointAssignmentInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new TrustProductsChannelEndpointAssignmentInstance( $this->version, $payload, $this->solution['trustProductSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsPage.php 0000644 00000003270 15021223077 0023642 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\TrustProducts; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class TrustProductsEvaluationsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return TrustProductsEvaluationsInstance \Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsEvaluationsInstance */ public function buildInstance(array $payload): TrustProductsEvaluationsInstance { return new TrustProductsEvaluationsInstance($this->version, $payload, $this->solution['trustProductSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsEvaluationsPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsList.php 0000644 00000015003 15021223077 0023676 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\TrustProducts; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TrustProductsEvaluationsList extends ListResource { /** * Construct the TrustProductsEvaluationsList * * @param Version $version Version that contains the resource * @param string $trustProductSid The unique string that we created to identify the trust_product resource. */ public function __construct( Version $version, string $trustProductSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trustProductSid' => $trustProductSid, ]; $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) .'/Evaluations'; } /** * Create the TrustProductsEvaluationsInstance * * @param string $policySid The unique string of a policy that is associated to the customer_profile resource. * @return TrustProductsEvaluationsInstance Created TrustProductsEvaluationsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $policySid): TrustProductsEvaluationsInstance { $data = Values::of([ 'PolicySid' => $policySid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TrustProductsEvaluationsInstance( $this->version, $payload, $this->solution['trustProductSid'] ); } /** * Reads TrustProductsEvaluationsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TrustProductsEvaluationsInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams TrustProductsEvaluationsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TrustProductsEvaluationsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TrustProductsEvaluationsPage Page of TrustProductsEvaluationsInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TrustProductsEvaluationsPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TrustProductsEvaluationsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TrustProductsEvaluationsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TrustProductsEvaluationsPage Page of TrustProductsEvaluationsInstance */ public function getPage(string $targetUrl): TrustProductsEvaluationsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TrustProductsEvaluationsPage($this->version, $response, $this->solution); } /** * Constructs a TrustProductsEvaluationsContext * * @param string $sid The unique string that identifies the Evaluation resource. */ public function getContext( string $sid ): TrustProductsEvaluationsContext { return new TrustProductsEvaluationsContext( $this->version, $this->solution['trustProductSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsEvaluationsList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsContext.php 0000644 00000005425 15021223077 0025614 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\TrustProducts; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class TrustProductsEntityAssignmentsContext extends InstanceContext { /** * Initialize the TrustProductsEntityAssignmentsContext * * @param Version $version Version that contains the resource * @param string $trustProductSid The unique string that we created to identify the TrustProduct resource. * @param string $sid The unique string that we created to identify the Identity resource. */ public function __construct( Version $version, $trustProductSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'trustProductSid' => $trustProductSid, 'sid' => $sid, ]; $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) .'/EntityAssignments/' . \rawurlencode($sid) .''; } /** * Delete the TrustProductsEntityAssignmentsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the TrustProductsEntityAssignmentsInstance * * @return TrustProductsEntityAssignmentsInstance Fetched TrustProductsEntityAssignmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsEntityAssignmentsInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new TrustProductsEntityAssignmentsInstance( $this->version, $payload, $this->solution['trustProductSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserList.php 0000644 00000014207 15021223077 0015323 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class EndUserList extends ListResource { /** * Construct the EndUserList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/EndUsers'; } /** * Create the EndUserInstance * * @param string $friendlyName The string that you assigned to describe the resource. * @param string $type The type of end user of the Bundle resource - can be `individual` or `business`. * @param array|Options $options Optional Arguments * @return EndUserInstance Created EndUserInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $options = []): EndUserInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Attributes' => Serialize::jsonObject($options['attributes']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new EndUserInstance( $this->version, $payload ); } /** * Reads EndUserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EndUserInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams EndUserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EndUserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EndUserPage Page of EndUserInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EndUserPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EndUserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EndUserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EndUserPage Page of EndUserInstance */ public function getPage(string $targetUrl): EndUserPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EndUserPage($this->version, $response, $this->solution); } /** * Constructs a EndUserContext * * @param string $sid The unique string created by Twilio to identify the End User resource. */ public function getContext( string $sid ): EndUserContext { return new EndUserContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.EndUserList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/PoliciesInstance.php 0000644 00000006544 15021223077 0016363 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string|null $friendlyName * @property array|null $requirements * @property string|null $url */ class PoliciesInstance extends InstanceResource { /** * Initialize the PoliciesInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the Policy resource. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'requirements' => Values::array_get($payload, 'requirements'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PoliciesContext Context for this PoliciesInstance */ protected function proxy(): PoliciesContext { if (!$this->context) { $this->context = new PoliciesContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the PoliciesInstance * * @return PoliciesInstance Fetched PoliciesInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PoliciesInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.PoliciesInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentPage.php 0000644 00000003447 15021223077 0027560 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\CustomerProfiles; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CustomerProfilesChannelEndpointAssignmentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CustomerProfilesChannelEndpointAssignmentInstance \Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesChannelEndpointAssignmentInstance */ public function buildInstance(array $payload): CustomerProfilesChannelEndpointAssignmentInstance { return new CustomerProfilesChannelEndpointAssignmentInstance($this->version, $payload, $this->solution['customerProfileSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsOptions.php 0000644 00000005214 15021223077 0026717 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\CustomerProfiles; use Twilio\Options; use Twilio\Values; abstract class CustomerProfilesEntityAssignmentsOptions { /** * @param string $objectType A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. * @return ReadCustomerProfilesEntityAssignmentsOptions Options builder */ public static function read( string $objectType = Values::NONE ): ReadCustomerProfilesEntityAssignmentsOptions { return new ReadCustomerProfilesEntityAssignmentsOptions( $objectType ); } } class ReadCustomerProfilesEntityAssignmentsOptions extends Options { /** * @param string $objectType A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. */ public function __construct( string $objectType = Values::NONE ) { $this->options['objectType'] = $objectType; } /** * A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. * * @param string $objectType A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. * @return $this Fluent Builder */ public function setObjectType(string $objectType): self { $this->options['objectType'] = $objectType; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.ReadCustomerProfilesEntityAssignmentsOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsContext.php 0000644 00000005513 15021223077 0026712 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\CustomerProfiles; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class CustomerProfilesEntityAssignmentsContext extends InstanceContext { /** * Initialize the CustomerProfilesEntityAssignmentsContext * * @param Version $version Version that contains the resource * @param string $customerProfileSid The unique string that we created to identify the CustomerProfile resource. * @param string $sid The unique string that we created to identify the Identity resource. */ public function __construct( Version $version, $customerProfileSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'customerProfileSid' => $customerProfileSid, 'sid' => $sid, ]; $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) .'/EntityAssignments/' . \rawurlencode($sid) .''; } /** * Delete the CustomerProfilesEntityAssignmentsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CustomerProfilesEntityAssignmentsInstance * * @return CustomerProfilesEntityAssignmentsInstance Fetched CustomerProfilesEntityAssignmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesEntityAssignmentsInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CustomerProfilesEntityAssignmentsInstance( $this->version, $payload, $this->solution['customerProfileSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentList.php 0000644 00000017053 15021223077 0027615 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\CustomerProfiles; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CustomerProfilesChannelEndpointAssignmentList extends ListResource { /** * Construct the CustomerProfilesChannelEndpointAssignmentList * * @param Version $version Version that contains the resource * @param string $customerProfileSid The unique string that we created to identify the CustomerProfile resource. */ public function __construct( Version $version, string $customerProfileSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'customerProfileSid' => $customerProfileSid, ]; $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) .'/ChannelEndpointAssignments'; } /** * Create the CustomerProfilesChannelEndpointAssignmentInstance * * @param string $channelEndpointType The type of channel endpoint. eg: phone-number * @param string $channelEndpointSid The SID of an channel endpoint * @return CustomerProfilesChannelEndpointAssignmentInstance Created CustomerProfilesChannelEndpointAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $channelEndpointType, string $channelEndpointSid): CustomerProfilesChannelEndpointAssignmentInstance { $data = Values::of([ 'ChannelEndpointType' => $channelEndpointType, 'ChannelEndpointSid' => $channelEndpointSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CustomerProfilesChannelEndpointAssignmentInstance( $this->version, $payload, $this->solution['customerProfileSid'] ); } /** * Reads CustomerProfilesChannelEndpointAssignmentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CustomerProfilesChannelEndpointAssignmentInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CustomerProfilesChannelEndpointAssignmentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CustomerProfilesChannelEndpointAssignmentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CustomerProfilesChannelEndpointAssignmentPage Page of CustomerProfilesChannelEndpointAssignmentInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CustomerProfilesChannelEndpointAssignmentPage { $options = new Values($options); $params = Values::of([ 'ChannelEndpointSid' => $options['channelEndpointSid'], 'ChannelEndpointSids' => $options['channelEndpointSids'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CustomerProfilesChannelEndpointAssignmentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CustomerProfilesChannelEndpointAssignmentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CustomerProfilesChannelEndpointAssignmentPage Page of CustomerProfilesChannelEndpointAssignmentInstance */ public function getPage(string $targetUrl): CustomerProfilesChannelEndpointAssignmentPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CustomerProfilesChannelEndpointAssignmentPage($this->version, $response, $this->solution); } /** * Constructs a CustomerProfilesChannelEndpointAssignmentContext * * @param string $sid The unique string that we created to identify the resource. */ public function getContext( string $sid ): CustomerProfilesChannelEndpointAssignmentContext { return new CustomerProfilesChannelEndpointAssignmentContext( $this->version, $this->solution['customerProfileSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsPage.php 0000644 00000003323 15021223077 0024741 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\CustomerProfiles; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CustomerProfilesEvaluationsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CustomerProfilesEvaluationsInstance \Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesEvaluationsInstance */ public function buildInstance(array $payload): CustomerProfilesEvaluationsInstance { return new CustomerProfilesEvaluationsInstance($this->version, $payload, $this->solution['customerProfileSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsPage]'; } } src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentOptions.php 0000644 00000005577 15021223077 0030266 0 ustar 00 sdk <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\CustomerProfiles; use Twilio\Options; use Twilio\Values; abstract class CustomerProfilesChannelEndpointAssignmentOptions { /** * @param string $channelEndpointSid The SID of an channel endpoint * @param string $channelEndpointSids comma separated list of channel endpoint sids * @return ReadCustomerProfilesChannelEndpointAssignmentOptions Options builder */ public static function read( string $channelEndpointSid = Values::NONE, string $channelEndpointSids = Values::NONE ): ReadCustomerProfilesChannelEndpointAssignmentOptions { return new ReadCustomerProfilesChannelEndpointAssignmentOptions( $channelEndpointSid, $channelEndpointSids ); } } class ReadCustomerProfilesChannelEndpointAssignmentOptions extends Options { /** * @param string $channelEndpointSid The SID of an channel endpoint * @param string $channelEndpointSids comma separated list of channel endpoint sids */ public function __construct( string $channelEndpointSid = Values::NONE, string $channelEndpointSids = Values::NONE ) { $this->options['channelEndpointSid'] = $channelEndpointSid; $this->options['channelEndpointSids'] = $channelEndpointSids; } /** * The SID of an channel endpoint * * @param string $channelEndpointSid The SID of an channel endpoint * @return $this Fluent Builder */ public function setChannelEndpointSid(string $channelEndpointSid): self { $this->options['channelEndpointSid'] = $channelEndpointSid; return $this; } /** * comma separated list of channel endpoint sids * * @param string $channelEndpointSids comma separated list of channel endpoint sids * @return $this Fluent Builder */ public function setChannelEndpointSids(string $channelEndpointSids): self { $this->options['channelEndpointSids'] = $channelEndpointSids; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.ReadCustomerProfilesChannelEndpointAssignmentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsInstance.php 0000644 00000010431 15021223077 0025627 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\CustomerProfiles; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $policySid * @property string|null $customerProfileSid * @property string $status * @property array[]|null $results * @property \DateTime|null $dateCreated * @property string|null $url */ class CustomerProfilesEvaluationsInstance extends InstanceResource { /** * Initialize the CustomerProfilesEvaluationsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $customerProfileSid The unique string that we created to identify the CustomerProfile resource. * @param string $sid The unique string that identifies the Evaluation resource. */ public function __construct(Version $version, array $payload, string $customerProfileSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'policySid' => Values::array_get($payload, 'policy_sid'), 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), 'status' => Values::array_get($payload, 'status'), 'results' => Values::array_get($payload, 'results'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['customerProfileSid' => $customerProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CustomerProfilesEvaluationsContext Context for this CustomerProfilesEvaluationsInstance */ protected function proxy(): CustomerProfilesEvaluationsContext { if (!$this->context) { $this->context = new CustomerProfilesEvaluationsContext( $this->version, $this->solution['customerProfileSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the CustomerProfilesEvaluationsInstance * * @return CustomerProfilesEvaluationsInstance Fetched CustomerProfilesEvaluationsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesEvaluationsInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsPage.php 0000644 00000003367 15021223077 0026147 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\CustomerProfiles; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CustomerProfilesEntityAssignmentsPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CustomerProfilesEntityAssignmentsInstance \Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesEntityAssignmentsInstance */ public function buildInstance(array $payload): CustomerProfilesEntityAssignmentsInstance { return new CustomerProfilesEntityAssignmentsInstance($this->version, $payload, $this->solution['customerProfileSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsInstance.php 0000644 00000010712 15021223077 0027027 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\CustomerProfiles; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $customerProfileSid * @property string|null $accountSid * @property string|null $objectSid * @property \DateTime|null $dateCreated * @property string|null $url */ class CustomerProfilesEntityAssignmentsInstance extends InstanceResource { /** * Initialize the CustomerProfilesEntityAssignmentsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $customerProfileSid The unique string that we created to identify the CustomerProfile resource. * @param string $sid The unique string that we created to identify the Identity resource. */ public function __construct(Version $version, array $payload, string $customerProfileSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'objectSid' => Values::array_get($payload, 'object_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['customerProfileSid' => $customerProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CustomerProfilesEntityAssignmentsContext Context for this CustomerProfilesEntityAssignmentsInstance */ protected function proxy(): CustomerProfilesEntityAssignmentsContext { if (!$this->context) { $this->context = new CustomerProfilesEntityAssignmentsContext( $this->version, $this->solution['customerProfileSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the CustomerProfilesEntityAssignmentsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CustomerProfilesEntityAssignmentsInstance * * @return CustomerProfilesEntityAssignmentsInstance Fetched CustomerProfilesEntityAssignmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesEntityAssignmentsInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsList.php 0000644 00000015150 15021223077 0025001 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\CustomerProfiles; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CustomerProfilesEvaluationsList extends ListResource { /** * Construct the CustomerProfilesEvaluationsList * * @param Version $version Version that contains the resource * @param string $customerProfileSid The unique string that we created to identify the CustomerProfile resource. */ public function __construct( Version $version, string $customerProfileSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'customerProfileSid' => $customerProfileSid, ]; $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) .'/Evaluations'; } /** * Create the CustomerProfilesEvaluationsInstance * * @param string $policySid The unique string of a policy that is associated to the customer_profile resource. * @return CustomerProfilesEvaluationsInstance Created CustomerProfilesEvaluationsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $policySid): CustomerProfilesEvaluationsInstance { $data = Values::of([ 'PolicySid' => $policySid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CustomerProfilesEvaluationsInstance( $this->version, $payload, $this->solution['customerProfileSid'] ); } /** * Reads CustomerProfilesEvaluationsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CustomerProfilesEvaluationsInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CustomerProfilesEvaluationsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CustomerProfilesEvaluationsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CustomerProfilesEvaluationsPage Page of CustomerProfilesEvaluationsInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CustomerProfilesEvaluationsPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CustomerProfilesEvaluationsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CustomerProfilesEvaluationsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CustomerProfilesEvaluationsPage Page of CustomerProfilesEvaluationsInstance */ public function getPage(string $targetUrl): CustomerProfilesEvaluationsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CustomerProfilesEvaluationsPage($this->version, $response, $this->solution); } /** * Constructs a CustomerProfilesEvaluationsContext * * @param string $sid The unique string that identifies the Evaluation resource. */ public function getContext( string $sid ): CustomerProfilesEvaluationsContext { return new CustomerProfilesEvaluationsContext( $this->version, $this->solution['customerProfileSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsList]'; } } src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentContext.php 0000644 00000005623 15021223077 0030247 0 ustar 00 sdk <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\CustomerProfiles; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class CustomerProfilesChannelEndpointAssignmentContext extends InstanceContext { /** * Initialize the CustomerProfilesChannelEndpointAssignmentContext * * @param Version $version Version that contains the resource * @param string $customerProfileSid The unique string that we created to identify the CustomerProfile resource. * @param string $sid The unique string that we created to identify the resource. */ public function __construct( Version $version, $customerProfileSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'customerProfileSid' => $customerProfileSid, 'sid' => $sid, ]; $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) .'/ChannelEndpointAssignments/' . \rawurlencode($sid) .''; } /** * Delete the CustomerProfilesChannelEndpointAssignmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CustomerProfilesChannelEndpointAssignmentInstance * * @return CustomerProfilesChannelEndpointAssignmentInstance Fetched CustomerProfilesChannelEndpointAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesChannelEndpointAssignmentInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CustomerProfilesChannelEndpointAssignmentInstance( $this->version, $payload, $this->solution['customerProfileSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsContext.php 0000644 00000004722 15021223077 0025515 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\CustomerProfiles; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class CustomerProfilesEvaluationsContext extends InstanceContext { /** * Initialize the CustomerProfilesEvaluationsContext * * @param Version $version Version that contains the resource * @param string $customerProfileSid The unique string that we created to identify the CustomerProfile resource. * @param string $sid The unique string that identifies the Evaluation resource. */ public function __construct( Version $version, $customerProfileSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'customerProfileSid' => $customerProfileSid, 'sid' => $sid, ]; $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) .'/Evaluations/' . \rawurlencode($sid) .''; } /** * Fetch the CustomerProfilesEvaluationsInstance * * @return CustomerProfilesEvaluationsInstance Fetched CustomerProfilesEvaluationsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesEvaluationsInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CustomerProfilesEvaluationsInstance( $this->version, $payload, $this->solution['customerProfileSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsList.php 0000644 00000016111 15021223077 0026175 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\CustomerProfiles; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CustomerProfilesEntityAssignmentsList extends ListResource { /** * Construct the CustomerProfilesEntityAssignmentsList * * @param Version $version Version that contains the resource * @param string $customerProfileSid The unique string that we created to identify the CustomerProfile resource. */ public function __construct( Version $version, string $customerProfileSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'customerProfileSid' => $customerProfileSid, ]; $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) .'/EntityAssignments'; } /** * Create the CustomerProfilesEntityAssignmentsInstance * * @param string $objectSid The SID of an object bag that holds information of the different items. * @return CustomerProfilesEntityAssignmentsInstance Created CustomerProfilesEntityAssignmentsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $objectSid): CustomerProfilesEntityAssignmentsInstance { $data = Values::of([ 'ObjectSid' => $objectSid, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CustomerProfilesEntityAssignmentsInstance( $this->version, $payload, $this->solution['customerProfileSid'] ); } /** * Reads CustomerProfilesEntityAssignmentsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CustomerProfilesEntityAssignmentsInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CustomerProfilesEntityAssignmentsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CustomerProfilesEntityAssignmentsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CustomerProfilesEntityAssignmentsPage Page of CustomerProfilesEntityAssignmentsInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CustomerProfilesEntityAssignmentsPage { $options = new Values($options); $params = Values::of([ 'ObjectType' => $options['objectType'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CustomerProfilesEntityAssignmentsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CustomerProfilesEntityAssignmentsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CustomerProfilesEntityAssignmentsPage Page of CustomerProfilesEntityAssignmentsInstance */ public function getPage(string $targetUrl): CustomerProfilesEntityAssignmentsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CustomerProfilesEntityAssignmentsPage($this->version, $response, $this->solution); } /** * Constructs a CustomerProfilesEntityAssignmentsContext * * @param string $sid The unique string that we created to identify the Identity resource. */ public function getContext( string $sid ): CustomerProfilesEntityAssignmentsContext { return new CustomerProfilesEntityAssignmentsContext( $this->version, $this->solution['customerProfileSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsList]'; } } src/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentInstance.php 0000644 00000011306 15021223077 0030362 0 ustar 00 sdk <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1\CustomerProfiles; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $customerProfileSid * @property string|null $accountSid * @property string|null $channelEndpointType * @property string|null $channelEndpointSid * @property \DateTime|null $dateCreated * @property string|null $url */ class CustomerProfilesChannelEndpointAssignmentInstance extends InstanceResource { /** * Initialize the CustomerProfilesChannelEndpointAssignmentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $customerProfileSid The unique string that we created to identify the CustomerProfile resource. * @param string $sid The unique string that we created to identify the resource. */ public function __construct(Version $version, array $payload, string $customerProfileSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelEndpointType' => Values::array_get($payload, 'channel_endpoint_type'), 'channelEndpointSid' => Values::array_get($payload, 'channel_endpoint_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['customerProfileSid' => $customerProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CustomerProfilesChannelEndpointAssignmentContext Context for this CustomerProfilesChannelEndpointAssignmentInstance */ protected function proxy(): CustomerProfilesChannelEndpointAssignmentContext { if (!$this->context) { $this->context = new CustomerProfilesChannelEndpointAssignmentContext( $this->version, $this->solution['customerProfileSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the CustomerProfilesChannelEndpointAssignmentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CustomerProfilesChannelEndpointAssignmentInstance * * @return CustomerProfilesChannelEndpointAssignmentInstance Fetched CustomerProfilesChannelEndpointAssignmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesChannelEndpointAssignmentInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserPage.php 0000644 00000003022 15021223077 0015255 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EndUserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return EndUserInstance \Twilio\Rest\Trusthub\V1\EndUserInstance */ public function buildInstance(array $payload): EndUserInstance { return new EndUserInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.EndUserPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesList.php 0000644 00000015721 15021223077 0017265 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class CustomerProfilesList extends ListResource { /** * Construct the CustomerProfilesList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/CustomerProfiles'; } /** * Create the CustomerProfilesInstance * * @param string $friendlyName The string that you assigned to describe the resource. * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. * @param array|Options $options Optional Arguments * @return CustomerProfilesInstance Created CustomerProfilesInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $email, string $policySid, array $options = []): CustomerProfilesInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Email' => $email, 'PolicySid' => $policySid, 'StatusCallback' => $options['statusCallback'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CustomerProfilesInstance( $this->version, $payload ); } /** * Reads CustomerProfilesInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CustomerProfilesInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams CustomerProfilesInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CustomerProfilesInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CustomerProfilesPage Page of CustomerProfilesInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CustomerProfilesPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'FriendlyName' => $options['friendlyName'], 'PolicySid' => $options['policySid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CustomerProfilesPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CustomerProfilesInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CustomerProfilesPage Page of CustomerProfilesInstance */ public function getPage(string $targetUrl): CustomerProfilesPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CustomerProfilesPage($this->version, $response, $this->solution); } /** * Constructs a CustomerProfilesContext * * @param string $sid The unique string that we created to identify the Customer-Profile resource. */ public function getContext( string $sid ): CustomerProfilesContext { return new CustomerProfilesContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesInstance.php 0000644 00000004605 15021223077 0022250 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $inquiryId * @property string|null $inquirySessionToken * @property string|null $registrationId * @property string|null $url */ class ComplianceTollfreeInquiriesInstance extends InstanceResource { /** * Initialize the ComplianceTollfreeInquiriesInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'inquiryId' => Values::array_get($payload, 'inquiry_id'), 'inquirySessionToken' => Values::array_get($payload, 'inquiry_session_token'), 'registrationId' => Values::array_get($payload, 'registration_id'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.ComplianceTollfreeInquiriesInstance]'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypePage.php 0000644 00000003052 15021223077 0016122 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EndUserTypePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return EndUserTypeInstance \Twilio\Rest\Trusthub\V1\EndUserTypeInstance */ public function buildInstance(array $payload): EndUserTypeInstance { return new EndUserTypeInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.EndUserTypePage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesInstance.php 0000644 00000007722 15021223077 0023151 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $inquiryId * @property string|null $inquirySessionToken * @property string|null $registrationId * @property string|null $url */ class ComplianceRegistrationInquiriesInstance extends InstanceResource { /** * Initialize the ComplianceRegistrationInquiriesInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $registrationId The unique RegistrationId matching the Regulatory Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Regulatory Compliance Inquiry creation call. */ public function __construct(Version $version, array $payload, string $registrationId = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'inquiryId' => Values::array_get($payload, 'inquiry_id'), 'inquirySessionToken' => Values::array_get($payload, 'inquiry_session_token'), 'registrationId' => Values::array_get($payload, 'registration_id'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['registrationId' => $registrationId ?: $this->properties['registrationId'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ComplianceRegistrationInquiriesContext Context for this ComplianceRegistrationInquiriesInstance */ protected function proxy(): ComplianceRegistrationInquiriesContext { if (!$this->context) { $this->context = new ComplianceRegistrationInquiriesContext( $this->version, $this->solution['registrationId'] ); } return $this->context; } /** * Update the ComplianceRegistrationInquiriesInstance * * @param array|Options $options Optional Arguments * @return ComplianceRegistrationInquiriesInstance Updated ComplianceRegistrationInquiriesInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ComplianceRegistrationInquiriesInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.ComplianceRegistrationInquiriesInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentOptions.php 0000644 00000011212 15021223077 0020340 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Options; use Twilio\Values; abstract class SupportingDocumentOptions { /** * @param array $attributes The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. * @return CreateSupportingDocumentOptions Options builder */ public static function create( array $attributes = Values::ARRAY_NONE ): CreateSupportingDocumentOptions { return new CreateSupportingDocumentOptions( $attributes ); } /** * @param string $friendlyName The string that you assigned to describe the resource. * @param array $attributes The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. * @return UpdateSupportingDocumentOptions Options builder */ public static function update( string $friendlyName = Values::NONE, array $attributes = Values::ARRAY_NONE ): UpdateSupportingDocumentOptions { return new UpdateSupportingDocumentOptions( $friendlyName, $attributes ); } } class CreateSupportingDocumentOptions extends Options { /** * @param array $attributes The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. */ public function __construct( array $attributes = Values::ARRAY_NONE ) { $this->options['attributes'] = $attributes; } /** * The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. * * @param array $attributes The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. * @return $this Fluent Builder */ public function setAttributes(array $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.CreateSupportingDocumentOptions ' . $options . ']'; } } class UpdateSupportingDocumentOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the resource. * @param array $attributes The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. */ public function __construct( string $friendlyName = Values::NONE, array $attributes = Values::ARRAY_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; } /** * The string that you assigned to describe the resource. * * @param string $friendlyName The string that you assigned to describe the resource. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. * * @param array $attributes The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. * @return $this Fluent Builder */ public function setAttributes(array $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.UpdateSupportingDocumentOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesList.php 0000644 00000005441 15021223077 0017721 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ComplianceInquiriesList extends ListResource { /** * Construct the ComplianceInquiriesList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/ComplianceInquiries/Customers/Initialize'; } /** * Create the ComplianceInquiriesInstance * * @param string $primaryProfileSid The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. * @param array|Options $options Optional Arguments * @return ComplianceInquiriesInstance Created ComplianceInquiriesInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $primaryProfileSid, array $options = []): ComplianceInquiriesInstance { $options = new Values($options); $data = Values::of([ 'PrimaryProfileSid' => $primaryProfileSid, 'NotificationEmail' => $options['notificationEmail'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ComplianceInquiriesInstance( $this->version, $payload ); } /** * Constructs a ComplianceInquiriesContext * * @param string $customerId The unique CustomerId matching the Customer Profile/Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Compliance Inquiry creation call. */ public function getContext( string $customerId ): ComplianceInquiriesContext { return new ComplianceInquiriesContext( $this->version, $customerId ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.ComplianceInquiriesList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesInstance.php 0000644 00000007643 15021223077 0020560 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $inquiryId * @property string|null $inquirySessionToken * @property string|null $customerId * @property string|null $url */ class ComplianceInquiriesInstance extends InstanceResource { /** * Initialize the ComplianceInquiriesInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $customerId The unique CustomerId matching the Customer Profile/Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Compliance Inquiry creation call. */ public function __construct(Version $version, array $payload, string $customerId = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'inquiryId' => Values::array_get($payload, 'inquiry_id'), 'inquirySessionToken' => Values::array_get($payload, 'inquiry_session_token'), 'customerId' => Values::array_get($payload, 'customer_id'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['customerId' => $customerId ?: $this->properties['customerId'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ComplianceInquiriesContext Context for this ComplianceInquiriesInstance */ protected function proxy(): ComplianceInquiriesContext { if (!$this->context) { $this->context = new ComplianceInquiriesContext( $this->version, $this->solution['customerId'] ); } return $this->context; } /** * Update the ComplianceInquiriesInstance * * @param string $primaryProfileSid The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. * @return ComplianceInquiriesInstance Updated ComplianceInquiriesInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $primaryProfileSid): ComplianceInquiriesInstance { return $this->proxy()->update($primaryProfileSid); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.ComplianceInquiriesInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypeList.php 0000644 00000012235 15021223077 0016164 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class EndUserTypeList extends ListResource { /** * Construct the EndUserTypeList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/EndUserTypes'; } /** * Reads EndUserTypeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EndUserTypeInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams EndUserTypeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EndUserTypeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EndUserTypePage Page of EndUserTypeInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EndUserTypePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EndUserTypePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EndUserTypeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EndUserTypePage Page of EndUserTypeInstance */ public function getPage(string $targetUrl): EndUserTypePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EndUserTypePage($this->version, $response, $this->solution); } /** * Constructs a EndUserTypeContext * * @param string $sid The unique string that identifies the End-User Type resource. */ public function getContext( string $sid ): EndUserTypeContext { return new EndUserTypeContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.EndUserTypeList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentInstance.php 0000644 00000011523 15021223077 0020456 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string|null $mimeType * @property string $status * @property string|null $type * @property array|null $attributes * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class SupportingDocumentInstance extends InstanceResource { /** * Initialize the SupportingDocumentInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string created by Twilio to identify the Supporting Document resource. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'mimeType' => Values::array_get($payload, 'mime_type'), 'status' => Values::array_get($payload, 'status'), 'type' => Values::array_get($payload, 'type'), 'attributes' => Values::array_get($payload, 'attributes'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return SupportingDocumentContext Context for this SupportingDocumentInstance */ protected function proxy(): SupportingDocumentContext { if (!$this->context) { $this->context = new SupportingDocumentContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the SupportingDocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the SupportingDocumentInstance * * @return SupportingDocumentInstance Fetched SupportingDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SupportingDocumentInstance { return $this->proxy()->fetch(); } /** * Update the SupportingDocumentInstance * * @param array|Options $options Optional Arguments * @return SupportingDocumentInstance Updated SupportingDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SupportingDocumentInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.SupportingDocumentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesContext.php 0000644 00000015703 15021223077 0017776 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesChannelEndpointAssignmentList; use Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesEntityAssignmentsList; use Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesEvaluationsList; /** * @property CustomerProfilesChannelEndpointAssignmentList $customerProfilesChannelEndpointAssignment * @property CustomerProfilesEntityAssignmentsList $customerProfilesEntityAssignments * @property CustomerProfilesEvaluationsList $customerProfilesEvaluations * @method \Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesChannelEndpointAssignmentContext customerProfilesChannelEndpointAssignment(string $sid) * @method \Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesEntityAssignmentsContext customerProfilesEntityAssignments(string $sid) * @method \Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesEvaluationsContext customerProfilesEvaluations(string $sid) */ class CustomerProfilesContext extends InstanceContext { protected $_customerProfilesChannelEndpointAssignment; protected $_customerProfilesEntityAssignments; protected $_customerProfilesEvaluations; /** * Initialize the CustomerProfilesContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that we created to identify the Customer-Profile resource. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/CustomerProfiles/' . \rawurlencode($sid) .''; } /** * Delete the CustomerProfilesInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CustomerProfilesInstance * * @return CustomerProfilesInstance Fetched CustomerProfilesInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CustomerProfilesInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CustomerProfilesInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the CustomerProfilesInstance * * @param array|Options $options Optional Arguments * @return CustomerProfilesInstance Updated CustomerProfilesInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CustomerProfilesInstance { $options = new Values($options); $data = Values::of([ 'Status' => $options['status'], 'StatusCallback' => $options['statusCallback'], 'FriendlyName' => $options['friendlyName'], 'Email' => $options['email'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CustomerProfilesInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the customerProfilesChannelEndpointAssignment */ protected function getCustomerProfilesChannelEndpointAssignment(): CustomerProfilesChannelEndpointAssignmentList { if (!$this->_customerProfilesChannelEndpointAssignment) { $this->_customerProfilesChannelEndpointAssignment = new CustomerProfilesChannelEndpointAssignmentList( $this->version, $this->solution['sid'] ); } return $this->_customerProfilesChannelEndpointAssignment; } /** * Access the customerProfilesEntityAssignments */ protected function getCustomerProfilesEntityAssignments(): CustomerProfilesEntityAssignmentsList { if (!$this->_customerProfilesEntityAssignments) { $this->_customerProfilesEntityAssignments = new CustomerProfilesEntityAssignmentsList( $this->version, $this->solution['sid'] ); } return $this->_customerProfilesEntityAssignments; } /** * Access the customerProfilesEvaluations */ protected function getCustomerProfilesEvaluations(): CustomerProfilesEvaluationsList { if (!$this->_customerProfilesEvaluations) { $this->_customerProfilesEvaluations = new CustomerProfilesEvaluationsList( $this->version, $this->solution['sid'] ); } return $this->_customerProfilesEvaluations; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.CustomerProfilesContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceTollfreeInquiriesPage.php 0000644 00000003212 15021223077 0021351 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ComplianceTollfreeInquiriesPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ComplianceTollfreeInquiriesInstance \Twilio\Rest\Trusthub\V1\ComplianceTollfreeInquiriesInstance */ public function buildInstance(array $payload): ComplianceTollfreeInquiriesInstance { return new ComplianceTollfreeInquiriesInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.ComplianceTollfreeInquiriesPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/CustomerProfilesPage.php 0000644 00000003110 15021223077 0017213 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CustomerProfilesPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CustomerProfilesInstance \Twilio\Rest\Trusthub\V1\CustomerProfilesInstance */ public function buildInstance(array $payload): CustomerProfilesInstance { return new CustomerProfilesInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.CustomerProfilesPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsList.php 0000644 00000015575 15021223077 0016634 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class TrustProductsList extends ListResource { /** * Construct the TrustProductsList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/TrustProducts'; } /** * Create the TrustProductsInstance * * @param string $friendlyName The string that you assigned to describe the resource. * @param string $email The email address that will receive updates when the Trust Product resource changes status. * @param string $policySid The unique string of a policy that is associated to the Trust Product resource. * @param array|Options $options Optional Arguments * @return TrustProductsInstance Created TrustProductsInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $email, string $policySid, array $options = []): TrustProductsInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Email' => $email, 'PolicySid' => $policySid, 'StatusCallback' => $options['statusCallback'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new TrustProductsInstance( $this->version, $payload ); } /** * Reads TrustProductsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TrustProductsInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams TrustProductsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of TrustProductsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return TrustProductsPage Page of TrustProductsInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): TrustProductsPage { $options = new Values($options); $params = Values::of([ 'Status' => $options['status'], 'FriendlyName' => $options['friendlyName'], 'PolicySid' => $options['policySid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new TrustProductsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TrustProductsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return TrustProductsPage Page of TrustProductsInstance */ public function getPage(string $targetUrl): TrustProductsPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TrustProductsPage($this->version, $response, $this->solution); } /** * Constructs a TrustProductsContext * * @param string $sid The unique string that we created to identify the Trust Product resource. */ public function getContext( string $sid ): TrustProductsContext { return new TrustProductsContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.TrustProductsList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypeContext.php 0000644 00000003774 15021223077 0016705 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class EndUserTypeContext extends InstanceContext { /** * Initialize the EndUserTypeContext * * @param Version $version Version that contains the resource * @param string $sid The unique string that identifies the End-User Type resource. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/EndUserTypes/' . \rawurlencode($sid) .''; } /** * Fetch the EndUserTypeInstance * * @return EndUserTypeInstance Fetched EndUserTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EndUserTypeInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new EndUserTypeInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.EndUserTypeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/PoliciesPage.php 0000644 00000003030 15021223077 0015456 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PoliciesPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return PoliciesInstance \Twilio\Rest\Trusthub\V1\PoliciesInstance */ public function buildInstance(array $payload): PoliciesInstance { return new PoliciesInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.PoliciesPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesOptions.php 0000644 00000004753 15021223077 0020446 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Options; use Twilio\Values; abstract class ComplianceInquiriesOptions { /** * @param string $notificationEmail The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. * @return CreateComplianceInquiriesOptions Options builder */ public static function create( string $notificationEmail = Values::NONE ): CreateComplianceInquiriesOptions { return new CreateComplianceInquiriesOptions( $notificationEmail ); } } class CreateComplianceInquiriesOptions extends Options { /** * @param string $notificationEmail The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. */ public function __construct( string $notificationEmail = Values::NONE ) { $this->options['notificationEmail'] = $notificationEmail; } /** * The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. * * @param string $notificationEmail The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. * @return $this Fluent Builder */ public function setNotificationEmail(string $notificationEmail): self { $this->options['notificationEmail'] = $notificationEmail; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Trusthub.V1.CreateComplianceInquiriesOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserInstance.php 0000644 00000010726 15021223077 0016156 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string|null $type * @property array|null $attributes * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class EndUserInstance extends InstanceResource { /** * Initialize the EndUserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string created by Twilio to identify the End User resource. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'attributes' => Values::array_get($payload, 'attributes'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EndUserContext Context for this EndUserInstance */ protected function proxy(): EndUserContext { if (!$this->context) { $this->context = new EndUserContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the EndUserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the EndUserInstance * * @return EndUserInstance Fetched EndUserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EndUserInstance { return $this->proxy()->fetch(); } /** * Update the EndUserInstance * * @param array|Options $options Optional Arguments * @return EndUserInstance Updated EndUserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): EndUserInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.EndUserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentContext.php 0000644 00000006345 15021223077 0020344 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class SupportingDocumentContext extends InstanceContext { /** * Initialize the SupportingDocumentContext * * @param Version $version Version that contains the resource * @param string $sid The unique string created by Twilio to identify the Supporting Document resource. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/SupportingDocuments/' . \rawurlencode($sid) .''; } /** * Delete the SupportingDocumentInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the SupportingDocumentInstance * * @return SupportingDocumentInstance Fetched SupportingDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): SupportingDocumentInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new SupportingDocumentInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the SupportingDocumentInstance * * @param array|Options $options Optional Arguments * @return SupportingDocumentInstance Updated SupportingDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): SupportingDocumentInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'Attributes' => Serialize::jsonObject($options['attributes']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new SupportingDocumentInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.SupportingDocumentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/EndUserTypeInstance.php 0000644 00000006754 15021223077 0017026 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string|null $friendlyName * @property string|null $machineName * @property array[]|null $fields * @property string|null $url */ class EndUserTypeInstance extends InstanceResource { /** * Initialize the EndUserTypeInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the End-User Type resource. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'machineName' => Values::array_get($payload, 'machine_name'), 'fields' => Values::array_get($payload, 'fields'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EndUserTypeContext Context for this EndUserTypeInstance */ protected function proxy(): EndUserTypeContext { if (!$this->context) { $this->context = new EndUserTypeContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the EndUserTypeInstance * * @return EndUserTypeInstance Fetched EndUserTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EndUserTypeInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.EndUserTypeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/TrustProductsInstance.php 0000644 00000014075 15021223077 0017457 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsChannelEndpointAssignmentList; use Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsEvaluationsList; use Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsEntityAssignmentsList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $policySid * @property string|null $friendlyName * @property string $status * @property \DateTime|null $validUntil * @property string|null $email * @property string|null $statusCallback * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class TrustProductsInstance extends InstanceResource { protected $_trustProductsChannelEndpointAssignment; protected $_trustProductsEvaluations; protected $_trustProductsEntityAssignments; /** * Initialize the TrustProductsInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that we created to identify the Trust Product resource. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'policySid' => Values::array_get($payload, 'policy_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'validUntil' => Deserialize::dateTime(Values::array_get($payload, 'valid_until')), 'email' => Values::array_get($payload, 'email'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return TrustProductsContext Context for this TrustProductsInstance */ protected function proxy(): TrustProductsContext { if (!$this->context) { $this->context = new TrustProductsContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the TrustProductsInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the TrustProductsInstance * * @return TrustProductsInstance Fetched TrustProductsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): TrustProductsInstance { return $this->proxy()->fetch(); } /** * Update the TrustProductsInstance * * @param array|Options $options Optional Arguments * @return TrustProductsInstance Updated TrustProductsInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): TrustProductsInstance { return $this->proxy()->update($options); } /** * Access the trustProductsChannelEndpointAssignment */ protected function getTrustProductsChannelEndpointAssignment(): TrustProductsChannelEndpointAssignmentList { return $this->proxy()->trustProductsChannelEndpointAssignment; } /** * Access the trustProductsEvaluations */ protected function getTrustProductsEvaluations(): TrustProductsEvaluationsList { return $this->proxy()->trustProductsEvaluations; } /** * Access the trustProductsEntityAssignments */ protected function getTrustProductsEntityAssignments(): TrustProductsEntityAssignmentsList { return $this->proxy()->trustProductsEntityAssignments; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.TrustProductsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceInquiriesContext.php 0000644 00000005150 15021223077 0020427 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class ComplianceInquiriesContext extends InstanceContext { /** * Initialize the ComplianceInquiriesContext * * @param Version $version Version that contains the resource * @param string $customerId The unique CustomerId matching the Customer Profile/Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Compliance Inquiry creation call. */ public function __construct( Version $version, $customerId ) { parent::__construct($version); // Path Solution $this->solution = [ 'customerId' => $customerId, ]; $this->uri = '/ComplianceInquiries/Customers/' . \rawurlencode($customerId) .'/Initialize'; } /** * Update the ComplianceInquiriesInstance * * @param string $primaryProfileSid The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. * @return ComplianceInquiriesInstance Updated ComplianceInquiriesInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $primaryProfileSid): ComplianceInquiriesInstance { $data = Values::of([ 'PrimaryProfileSid' => $primaryProfileSid, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ComplianceInquiriesInstance( $this->version, $payload, $this->solution['customerId'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trusthub.V1.ComplianceInquiriesContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiriesList.php 0000644 00000014203 15021223077 0022310 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ComplianceRegistrationInquiriesList extends ListResource { /** * Construct the ComplianceRegistrationInquiriesList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/ComplianceInquiries/Registration/RegulatoryCompliance/GB/Initialize'; } /** * Create the ComplianceRegistrationInquiriesInstance * * @param string $endUserType * @param string $phoneNumberType * @param array|Options $options Optional Arguments * @return ComplianceRegistrationInquiriesInstance Created ComplianceRegistrationInquiriesInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $endUserType, string $phoneNumberType, array $options = []): ComplianceRegistrationInquiriesInstance { $options = new Values($options); $data = Values::of([ 'EndUserType' => $endUserType, 'PhoneNumberType' => $phoneNumberType, 'BusinessIdentityType' => $options['businessIdentityType'], 'BusinessRegistrationAuthority' => $options['businessRegistrationAuthority'], 'BusinessLegalName' => $options['businessLegalName'], 'NotificationEmail' => $options['notificationEmail'], 'AcceptedNotificationReceipt' => Serialize::booleanToString($options['acceptedNotificationReceipt']), 'BusinessRegistrationNumber' => $options['businessRegistrationNumber'], 'BusinessWebsiteUrl' => $options['businessWebsiteUrl'], 'FriendlyName' => $options['friendlyName'], 'AuthorizedRepresentative1FirstName' => $options['authorizedRepresentative1FirstName'], 'AuthorizedRepresentative1LastName' => $options['authorizedRepresentative1LastName'], 'AuthorizedRepresentative1Phone' => $options['authorizedRepresentative1Phone'], 'AuthorizedRepresentative1Email' => $options['authorizedRepresentative1Email'], 'AuthorizedRepresentative1DateOfBirth' => $options['authorizedRepresentative1DateOfBirth'], 'AddressStreet' => $options['addressStreet'], 'AddressStreetSecondary' => $options['addressStreetSecondary'], 'AddressCity' => $options['addressCity'], 'AddressSubdivision' => $options['addressSubdivision'], 'AddressPostalCode' => $options['addressPostalCode'], 'AddressCountryCode' => $options['addressCountryCode'], 'EmergencyAddressStreet' => $options['emergencyAddressStreet'], 'EmergencyAddressStreetSecondary' => $options['emergencyAddressStreetSecondary'], 'EmergencyAddressCity' => $options['emergencyAddressCity'], 'EmergencyAddressSubdivision' => $options['emergencyAddressSubdivision'], 'EmergencyAddressPostalCode' => $options['emergencyAddressPostalCode'], 'EmergencyAddressCountryCode' => $options['emergencyAddressCountryCode'], 'UseAddressAsEmergencyAddress' => Serialize::booleanToString($options['useAddressAsEmergencyAddress']), 'FileName' => $options['fileName'], 'File' => $options['file'], 'FirstName' => $options['firstName'], 'LastName' => $options['lastName'], 'DateOfBirth' => $options['dateOfBirth'], 'IndividualEmail' => $options['individualEmail'], 'IndividualPhone' => $options['individualPhone'], 'IsIsvEmbed' => Serialize::booleanToString($options['isIsvEmbed']), 'IsvRegisteringForSelfOrTenant' => $options['isvRegisteringForSelfOrTenant'], 'StatusCallbackUrl' => $options['statusCallbackUrl'], 'ThemeSetId' => $options['themeSetId'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ComplianceRegistrationInquiriesInstance( $this->version, $payload ); } /** * Constructs a ComplianceRegistrationInquiriesContext * * @param string $registrationId The unique RegistrationId matching the Regulatory Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Regulatory Compliance Inquiry creation call. */ public function getContext( string $registrationId ): ComplianceRegistrationInquiriesContext { return new ComplianceRegistrationInquiriesContext( $this->version, $registrationId ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.ComplianceRegistrationInquiriesList]'; } } sdk/src/Twilio/Rest/Trusthub/V1/SupportingDocumentPage.php 0000644 00000003124 15021223077 0017564 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class SupportingDocumentPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return SupportingDocumentInstance \Twilio\Rest\Trusthub\V1\SupportingDocumentInstance */ public function buildInstance(array $payload): SupportingDocumentInstance { return new SupportingDocumentInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1.SupportingDocumentPage]'; } } sdk/src/Twilio/Rest/Trusthub/V1.php 0000644 00000015220 15021223077 0013116 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Trusthub * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Trusthub; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Trusthub\V1\ComplianceInquiriesList; use Twilio\Rest\Trusthub\V1\ComplianceRegistrationInquiriesList; use Twilio\Rest\Trusthub\V1\ComplianceTollfreeInquiriesList; use Twilio\Rest\Trusthub\V1\CustomerProfilesList; use Twilio\Rest\Trusthub\V1\EndUserList; use Twilio\Rest\Trusthub\V1\EndUserTypeList; use Twilio\Rest\Trusthub\V1\PoliciesList; use Twilio\Rest\Trusthub\V1\SupportingDocumentList; use Twilio\Rest\Trusthub\V1\SupportingDocumentTypeList; use Twilio\Rest\Trusthub\V1\TrustProductsList; use Twilio\Version; /** * @property ComplianceInquiriesList $complianceInquiries * @property ComplianceRegistrationInquiriesList $complianceRegistrationInquiries * @property ComplianceTollfreeInquiriesList $complianceTollfreeInquiries * @property CustomerProfilesList $customerProfiles * @property EndUserList $endUsers * @property EndUserTypeList $endUserTypes * @property PoliciesList $policies * @property SupportingDocumentList $supportingDocuments * @property SupportingDocumentTypeList $supportingDocumentTypes * @property TrustProductsList $trustProducts * @method \Twilio\Rest\Trusthub\V1\CustomerProfilesContext customerProfiles(string $sid) * @method \Twilio\Rest\Trusthub\V1\EndUserContext endUsers(string $sid) * @method \Twilio\Rest\Trusthub\V1\EndUserTypeContext endUserTypes(string $sid) * @method \Twilio\Rest\Trusthub\V1\PoliciesContext policies(string $sid) * @method \Twilio\Rest\Trusthub\V1\SupportingDocumentContext supportingDocuments(string $sid) * @method \Twilio\Rest\Trusthub\V1\SupportingDocumentTypeContext supportingDocumentTypes(string $sid) * @method \Twilio\Rest\Trusthub\V1\TrustProductsContext trustProducts(string $sid) */ class V1 extends Version { protected $_complianceInquiries; protected $_complianceRegistrationInquiries; protected $_complianceTollfreeInquiries; protected $_customerProfiles; protected $_endUsers; protected $_endUserTypes; protected $_policies; protected $_supportingDocuments; protected $_supportingDocumentTypes; protected $_trustProducts; /** * Construct the V1 version of Trusthub * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getComplianceInquiries(): ComplianceInquiriesList { if (!$this->_complianceInquiries) { $this->_complianceInquiries = new ComplianceInquiriesList($this); } return $this->_complianceInquiries; } protected function getComplianceRegistrationInquiries(): ComplianceRegistrationInquiriesList { if (!$this->_complianceRegistrationInquiries) { $this->_complianceRegistrationInquiries = new ComplianceRegistrationInquiriesList($this); } return $this->_complianceRegistrationInquiries; } protected function getComplianceTollfreeInquiries(): ComplianceTollfreeInquiriesList { if (!$this->_complianceTollfreeInquiries) { $this->_complianceTollfreeInquiries = new ComplianceTollfreeInquiriesList($this); } return $this->_complianceTollfreeInquiries; } protected function getCustomerProfiles(): CustomerProfilesList { if (!$this->_customerProfiles) { $this->_customerProfiles = new CustomerProfilesList($this); } return $this->_customerProfiles; } protected function getEndUsers(): EndUserList { if (!$this->_endUsers) { $this->_endUsers = new EndUserList($this); } return $this->_endUsers; } protected function getEndUserTypes(): EndUserTypeList { if (!$this->_endUserTypes) { $this->_endUserTypes = new EndUserTypeList($this); } return $this->_endUserTypes; } protected function getPolicies(): PoliciesList { if (!$this->_policies) { $this->_policies = new PoliciesList($this); } return $this->_policies; } protected function getSupportingDocuments(): SupportingDocumentList { if (!$this->_supportingDocuments) { $this->_supportingDocuments = new SupportingDocumentList($this); } return $this->_supportingDocuments; } protected function getSupportingDocumentTypes(): SupportingDocumentTypeList { if (!$this->_supportingDocumentTypes) { $this->_supportingDocumentTypes = new SupportingDocumentTypeList($this); } return $this->_supportingDocumentTypes; } protected function getTrustProducts(): TrustProductsList { if (!$this->_trustProducts) { $this->_trustProducts = new TrustProductsList($this); } return $this->_trustProducts; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Trusthub.V1]'; } } sdk/src/Twilio/Rest/ContentBase.php 0000644 00000004531 15021223077 0013220 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Content\V1; /** * @property \Twilio\Rest\Content\V1 $v1 */ class ContentBase extends Domain { protected $_v1; /** * Construct the Content Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://content.twilio.com'; } /** * @return V1 Version v1 of content */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Content]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationList.php 0000644 00000003113 15021223077 0020463 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\ListResource; use Twilio\Version; class ExportConfigurationList extends ListResource { /** * Construct the ExportConfigurationList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a ExportConfigurationContext * * @param string $resourceType The type of communication – Messages, Calls, Conferences, and Participants */ public function getContext( string $resourceType ): ExportConfigurationContext { return new ExportConfigurationContext( $this->version, $resourceType ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports.V1.ExportConfigurationList]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportInstance.php 0000644 00000007420 15021223077 0016571 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Rest\Bulkexports\V1\Export\ExportCustomJobList; use Twilio\Rest\Bulkexports\V1\Export\DayList; /** * @property string|null $resourceType * @property string|null $url * @property array|null $links */ class ExportInstance extends InstanceResource { protected $_exportCustomJobs; protected $_days; /** * Initialize the ExportInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $resourceType The type of communication – Messages, Calls, Conferences, and Participants */ public function __construct(Version $version, array $payload, string $resourceType = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'resourceType' => Values::array_get($payload, 'resource_type'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['resourceType' => $resourceType ?: $this->properties['resourceType'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ExportContext Context for this ExportInstance */ protected function proxy(): ExportContext { if (!$this->context) { $this->context = new ExportContext( $this->version, $this->solution['resourceType'] ); } return $this->context; } /** * Fetch the ExportInstance * * @return ExportInstance Fetched ExportInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExportInstance { return $this->proxy()->fetch(); } /** * Access the exportCustomJobs */ protected function getExportCustomJobs(): ExportCustomJobList { return $this->proxy()->exportCustomJobs; } /** * Access the days */ protected function getDays(): DayList { return $this->proxy()->days; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Bulkexports.V1.ExportInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationInstance.php 0000644 00000010124 15021223077 0021314 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property bool|null $enabled * @property string|null $webhookUrl * @property string|null $webhookMethod * @property string|null $resourceType * @property string|null $url */ class ExportConfigurationInstance extends InstanceResource { /** * Initialize the ExportConfigurationInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $resourceType The type of communication – Messages, Calls, Conferences, and Participants */ public function __construct(Version $version, array $payload, string $resourceType = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'enabled' => Values::array_get($payload, 'enabled'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'resourceType' => Values::array_get($payload, 'resource_type'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['resourceType' => $resourceType ?: $this->properties['resourceType'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ExportConfigurationContext Context for this ExportConfigurationInstance */ protected function proxy(): ExportConfigurationContext { if (!$this->context) { $this->context = new ExportConfigurationContext( $this->version, $this->solution['resourceType'] ); } return $this->context; } /** * Fetch the ExportConfigurationInstance * * @return ExportConfigurationInstance Fetched ExportConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExportConfigurationInstance { return $this->proxy()->fetch(); } /** * Update the ExportConfigurationInstance * * @param array|Options $options Optional Arguments * @return ExportConfigurationInstance Updated ExportConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ExportConfigurationInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Bulkexports.V1.ExportConfigurationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportPage.php 0000644 00000003030 15021223077 0015672 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExportPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ExportInstance \Twilio\Rest\Bulkexports\V1\ExportInstance */ public function buildInstance(array $payload): ExportInstance { return new ExportInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports.V1.ExportPage]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobList.php 0000644 00000002732 15021223077 0016453 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\ListResource; use Twilio\Version; class JobList extends ListResource { /** * Construct the JobList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a JobContext * * @param string $jobSid The unique string that that we created to identify the Bulk Export job */ public function getContext( string $jobSid ): JobContext { return new JobContext( $this->version, $jobSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports.V1.JobList]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobContext.php 0000644 00000004402 15021223077 0017160 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class JobContext extends InstanceContext { /** * Initialize the JobContext * * @param Version $version Version that contains the resource * @param string $jobSid The unique string that that we created to identify the Bulk Export job */ public function __construct( Version $version, $jobSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'jobSid' => $jobSid, ]; $this->uri = '/Exports/Jobs/' . \rawurlencode($jobSid) .''; } /** * Delete the JobInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the JobInstance * * @return JobInstance Fetched JobInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): JobInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new JobInstance( $this->version, $payload, $this->solution['jobSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Bulkexports.V1.JobContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayContext.php 0000644 00000004350 15021223077 0017165 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class DayContext extends InstanceContext { /** * Initialize the DayContext * * @param Version $version Version that contains the resource * @param string $resourceType The type of communication – Messages, Calls, Conferences, and Participants * @param string $day The ISO 8601 format date of the resources in the file, for a UTC day */ public function __construct( Version $version, $resourceType, $day ) { parent::__construct($version); // Path Solution $this->solution = [ 'resourceType' => $resourceType, 'day' => $day, ]; $this->uri = '/Exports/' . \rawurlencode($resourceType) .'/Days/' . \rawurlencode($day) .''; } /** * Fetch the DayInstance * * @return DayInstance Fetched DayInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DayInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new DayInstance( $this->version, $payload, $this->solution['resourceType'], $this->solution['day'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Bulkexports.V1.DayContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobInstance.php 0000644 00000010760 15021223077 0017304 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $resourceType * @property string|null $friendlyName * @property array|null $details * @property string|null $startDay * @property string|null $endDay * @property string|null $jobSid * @property string|null $webhookUrl * @property string|null $webhookMethod * @property string|null $email * @property string|null $url * @property string|null $jobQueuePosition * @property string|null $estimatedCompletionTime */ class JobInstance extends InstanceResource { /** * Initialize the JobInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $jobSid The unique string that that we created to identify the Bulk Export job */ public function __construct(Version $version, array $payload, string $jobSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'resourceType' => Values::array_get($payload, 'resource_type'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'details' => Values::array_get($payload, 'details'), 'startDay' => Values::array_get($payload, 'start_day'), 'endDay' => Values::array_get($payload, 'end_day'), 'jobSid' => Values::array_get($payload, 'job_sid'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'email' => Values::array_get($payload, 'email'), 'url' => Values::array_get($payload, 'url'), 'jobQueuePosition' => Values::array_get($payload, 'job_queue_position'), 'estimatedCompletionTime' => Values::array_get($payload, 'estimated_completion_time'), ]; $this->solution = ['jobSid' => $jobSid ?: $this->properties['jobSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return JobContext Context for this JobInstance */ protected function proxy(): JobContext { if (!$this->context) { $this->context = new JobContext( $this->version, $this->solution['jobSid'] ); } return $this->context; } /** * Delete the JobInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the JobInstance * * @return JobInstance Fetched JobInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): JobInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Bulkexports.V1.JobInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobPage.php 0000644 00000003175 15021223077 0021013 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExportCustomJobPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ExportCustomJobInstance \Twilio\Rest\Bulkexports\V1\Export\ExportCustomJobInstance */ public function buildInstance(array $payload): ExportCustomJobInstance { return new ExportCustomJobInstance($this->version, $payload, $this->solution['resourceType']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports.V1.ExportCustomJobPage]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobOptions.php 0000644 00000011471 15021223077 0021570 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Options; use Twilio\Values; abstract class ExportCustomJobOptions { /** * @param string $webhookUrl The optional webhook url called on completion of the job. If this is supplied, `WebhookMethod` must also be supplied. If you set neither webhook nor email, you will have to check your job's status manually. * @param string $webhookMethod This is the method used to call the webhook on completion of the job. If this is supplied, `WebhookUrl` must also be supplied. * @param string $email The optional email to send the completion notification to. You can set both webhook, and email, or one or the other. If you set neither, the job will run but you will have to query to determine your job's status. * @return CreateExportCustomJobOptions Options builder */ public static function create( string $webhookUrl = Values::NONE, string $webhookMethod = Values::NONE, string $email = Values::NONE ): CreateExportCustomJobOptions { return new CreateExportCustomJobOptions( $webhookUrl, $webhookMethod, $email ); } } class CreateExportCustomJobOptions extends Options { /** * @param string $webhookUrl The optional webhook url called on completion of the job. If this is supplied, `WebhookMethod` must also be supplied. If you set neither webhook nor email, you will have to check your job's status manually. * @param string $webhookMethod This is the method used to call the webhook on completion of the job. If this is supplied, `WebhookUrl` must also be supplied. * @param string $email The optional email to send the completion notification to. You can set both webhook, and email, or one or the other. If you set neither, the job will run but you will have to query to determine your job's status. */ public function __construct( string $webhookUrl = Values::NONE, string $webhookMethod = Values::NONE, string $email = Values::NONE ) { $this->options['webhookUrl'] = $webhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['email'] = $email; } /** * The optional webhook url called on completion of the job. If this is supplied, `WebhookMethod` must also be supplied. If you set neither webhook nor email, you will have to check your job's status manually. * * @param string $webhookUrl The optional webhook url called on completion of the job. If this is supplied, `WebhookMethod` must also be supplied. If you set neither webhook nor email, you will have to check your job's status manually. * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * This is the method used to call the webhook on completion of the job. If this is supplied, `WebhookUrl` must also be supplied. * * @param string $webhookMethod This is the method used to call the webhook on completion of the job. If this is supplied, `WebhookUrl` must also be supplied. * @return $this Fluent Builder */ public function setWebhookMethod(string $webhookMethod): self { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * The optional email to send the completion notification to. You can set both webhook, and email, or one or the other. If you set neither, the job will run but you will have to query to determine your job's status. * * @param string $email The optional email to send the completion notification to. You can set both webhook, and email, or one or the other. If you set neither, the job will run but you will have to query to determine your job's status. * @return $this Fluent Builder */ public function setEmail(string $email): self { $this->options['email'] = $email; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Bulkexports.V1.CreateExportCustomJobOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayList.php 0000644 00000012501 15021223077 0016451 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class DayList extends ListResource { /** * Construct the DayList * * @param Version $version Version that contains the resource * @param string $resourceType The type of communication – Messages, Calls, Conferences, and Participants */ public function __construct( Version $version, string $resourceType ) { parent::__construct($version); // Path Solution $this->solution = [ 'resourceType' => $resourceType, ]; $this->uri = '/Exports/' . \rawurlencode($resourceType) .'/Days'; } /** * Reads DayInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DayInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams DayInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of DayInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return DayPage Page of DayInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): DayPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new DayPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DayInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return DayPage Page of DayInstance */ public function getPage(string $targetUrl): DayPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DayPage($this->version, $response, $this->solution); } /** * Constructs a DayContext * * @param string $day The ISO 8601 format date of the resources in the file, for a UTC day */ public function getContext( string $day ): DayContext { return new DayContext( $this->version, $this->solution['resourceType'], $day ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports.V1.DayList]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/JobPage.php 0000644 00000003024 15021223077 0016407 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class JobPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return JobInstance \Twilio\Rest\Bulkexports\V1\Export\JobInstance */ public function buildInstance(array $payload): JobInstance { return new JobInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports.V1.JobPage]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayPage.php 0000644 00000003065 15021223077 0016417 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class DayPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return DayInstance \Twilio\Rest\Bulkexports\V1\Export\DayInstance */ public function buildInstance(array $payload): DayInstance { return new DayInstance($this->version, $payload, $this->solution['resourceType']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports.V1.DayPage]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/DayInstance.php 0000644 00000007377 15021223077 0017321 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $redirectTo * @property string|null $day * @property int|null $size * @property string|null $createDate * @property string|null $friendlyName * @property string|null $resourceType */ class DayInstance extends InstanceResource { /** * Initialize the DayInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $resourceType The type of communication – Messages, Calls, Conferences, and Participants * @param string $day The ISO 8601 format date of the resources in the file, for a UTC day */ public function __construct(Version $version, array $payload, string $resourceType, string $day = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'redirectTo' => Values::array_get($payload, 'redirect_to'), 'day' => Values::array_get($payload, 'day'), 'size' => Values::array_get($payload, 'size'), 'createDate' => Values::array_get($payload, 'create_date'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'resourceType' => Values::array_get($payload, 'resource_type'), ]; $this->solution = ['resourceType' => $resourceType, 'day' => $day ?: $this->properties['day'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DayContext Context for this DayInstance */ protected function proxy(): DayContext { if (!$this->context) { $this->context = new DayContext( $this->version, $this->solution['resourceType'], $this->solution['day'] ); } return $this->context; } /** * Fetch the DayInstance * * @return DayInstance Fetched DayInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DayInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Bulkexports.V1.DayInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobList.php 0000644 00000015170 15021223077 0021050 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ExportCustomJobList extends ListResource { /** * Construct the ExportCustomJobList * * @param Version $version Version that contains the resource * @param string $resourceType The type of communication – Messages or Calls, Conferences, and Participants */ public function __construct( Version $version, string $resourceType ) { parent::__construct($version); // Path Solution $this->solution = [ 'resourceType' => $resourceType, ]; $this->uri = '/Exports/' . \rawurlencode($resourceType) .'/Jobs'; } /** * Create the ExportCustomJobInstance * * @param string $startDay The start day for the custom export specified as a string in the format of yyyy-mm-dd * @param string $endDay The end day for the custom export specified as a string in the format of yyyy-mm-dd. End day is inclusive and must be 2 days earlier than the current UTC day. * @param string $friendlyName The friendly name specified when creating the job * @param array|Options $options Optional Arguments * @return ExportCustomJobInstance Created ExportCustomJobInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $startDay, string $endDay, string $friendlyName, array $options = []): ExportCustomJobInstance { $options = new Values($options); $data = Values::of([ 'StartDay' => $startDay, 'EndDay' => $endDay, 'FriendlyName' => $friendlyName, 'WebhookUrl' => $options['webhookUrl'], 'WebhookMethod' => $options['webhookMethod'], 'Email' => $options['email'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ExportCustomJobInstance( $this->version, $payload, $this->solution['resourceType'] ); } /** * Reads ExportCustomJobInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ExportCustomJobInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ExportCustomJobInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ExportCustomJobInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ExportCustomJobPage Page of ExportCustomJobInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ExportCustomJobPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ExportCustomJobPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ExportCustomJobInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ExportCustomJobPage Page of ExportCustomJobInstance */ public function getPage(string $targetUrl): ExportCustomJobPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ExportCustomJobPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports.V1.ExportCustomJobList]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobInstance.php 0000644 00000006435 15021223077 0021705 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1\Export; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $friendlyName * @property string|null $resourceType * @property string|null $startDay * @property string|null $endDay * @property string|null $webhookUrl * @property string|null $webhookMethod * @property string|null $email * @property string|null $jobSid * @property array|null $details * @property string|null $jobQueuePosition * @property string|null $estimatedCompletionTime */ class ExportCustomJobInstance extends InstanceResource { /** * Initialize the ExportCustomJobInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $resourceType The type of communication – Messages or Calls, Conferences, and Participants */ public function __construct(Version $version, array $payload, string $resourceType) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'resourceType' => Values::array_get($payload, 'resource_type'), 'startDay' => Values::array_get($payload, 'start_day'), 'endDay' => Values::array_get($payload, 'end_day'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'email' => Values::array_get($payload, 'email'), 'jobSid' => Values::array_get($payload, 'job_sid'), 'details' => Values::array_get($payload, 'details'), 'jobQueuePosition' => Values::array_get($payload, 'job_queue_position'), 'estimatedCompletionTime' => Values::array_get($payload, 'estimated_completion_time'), ]; $this->solution = ['resourceType' => $resourceType, ]; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports.V1.ExportCustomJobInstance]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportList.php 0000644 00000006135 15021223077 0015742 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Bulkexports\V1\Export\JobList; /** * @property JobList $jobs * @method \Twilio\Rest\Bulkexports\V1\Export\JobContext jobs(string $jobSid) */ class ExportList extends ListResource { protected $_jobs = null; /** * Construct the ExportList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a ExportContext * * @param string $resourceType The type of communication – Messages, Calls, Conferences, and Participants */ public function getContext( string $resourceType ): ExportContext { return new ExportContext( $this->version, $resourceType ); } /** * Access the jobs */ protected function getJobs(): JobList { if (!$this->_jobs) { $this->_jobs = new JobList( $this->version ); } return $this->_jobs; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports.V1.ExportList]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationPage.php 0000644 00000003146 15021223077 0020432 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExportConfigurationPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ExportConfigurationInstance \Twilio\Rest\Bulkexports\V1\ExportConfigurationInstance */ public function buildInstance(array $payload): ExportConfigurationInstance { return new ExportConfigurationInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports.V1.ExportConfigurationPage]'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationOptions.php 0000644 00000007660 15021223077 0021216 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Options; use Twilio\Values; abstract class ExportConfigurationOptions { /** * @param bool $enabled If true, Twilio will automatically generate every day's file when the day is over. * @param string $webhookUrl Stores the URL destination for the method specified in webhook_method. * @param string $webhookMethod Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url * @return UpdateExportConfigurationOptions Options builder */ public static function update( bool $enabled = Values::BOOL_NONE, string $webhookUrl = Values::NONE, string $webhookMethod = Values::NONE ): UpdateExportConfigurationOptions { return new UpdateExportConfigurationOptions( $enabled, $webhookUrl, $webhookMethod ); } } class UpdateExportConfigurationOptions extends Options { /** * @param bool $enabled If true, Twilio will automatically generate every day's file when the day is over. * @param string $webhookUrl Stores the URL destination for the method specified in webhook_method. * @param string $webhookMethod Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url */ public function __construct( bool $enabled = Values::BOOL_NONE, string $webhookUrl = Values::NONE, string $webhookMethod = Values::NONE ) { $this->options['enabled'] = $enabled; $this->options['webhookUrl'] = $webhookUrl; $this->options['webhookMethod'] = $webhookMethod; } /** * If true, Twilio will automatically generate every day's file when the day is over. * * @param bool $enabled If true, Twilio will automatically generate every day's file when the day is over. * @return $this Fluent Builder */ public function setEnabled(bool $enabled): self { $this->options['enabled'] = $enabled; return $this; } /** * Stores the URL destination for the method specified in webhook_method. * * @param string $webhookUrl Stores the URL destination for the method specified in webhook_method. * @return $this Fluent Builder */ public function setWebhookUrl(string $webhookUrl): self { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url * * @param string $webhookMethod Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url * @return $this Fluent Builder */ public function setWebhookMethod(string $webhookMethod): self { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Bulkexports.V1.UpdateExportConfigurationOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportContext.php 0000644 00000010217 15021223077 0016447 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Bulkexports\V1\Export\ExportCustomJobList; use Twilio\Rest\Bulkexports\V1\Export\DayList; /** * @property ExportCustomJobList $exportCustomJobs * @property DayList $days * @method \Twilio\Rest\Bulkexports\V1\Export\DayContext days(string $day) */ class ExportContext extends InstanceContext { protected $_exportCustomJobs; protected $_days; /** * Initialize the ExportContext * * @param Version $version Version that contains the resource * @param string $resourceType The type of communication – Messages, Calls, Conferences, and Participants */ public function __construct( Version $version, $resourceType ) { parent::__construct($version); // Path Solution $this->solution = [ 'resourceType' => $resourceType, ]; $this->uri = '/Exports/' . \rawurlencode($resourceType) .''; } /** * Fetch the ExportInstance * * @return ExportInstance Fetched ExportInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExportInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExportInstance( $this->version, $payload, $this->solution['resourceType'] ); } /** * Access the exportCustomJobs */ protected function getExportCustomJobs(): ExportCustomJobList { if (!$this->_exportCustomJobs) { $this->_exportCustomJobs = new ExportCustomJobList( $this->version, $this->solution['resourceType'] ); } return $this->_exportCustomJobs; } /** * Access the days */ protected function getDays(): DayList { if (!$this->_days) { $this->_days = new DayList( $this->version, $this->solution['resourceType'] ); } return $this->_days; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Bulkexports.V1.ExportContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1/ExportConfigurationContext.php 0000644 00000006122 15021223077 0021177 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class ExportConfigurationContext extends InstanceContext { /** * Initialize the ExportConfigurationContext * * @param Version $version Version that contains the resource * @param string $resourceType The type of communication – Messages, Calls, Conferences, and Participants */ public function __construct( Version $version, $resourceType ) { parent::__construct($version); // Path Solution $this->solution = [ 'resourceType' => $resourceType, ]; $this->uri = '/Exports/' . \rawurlencode($resourceType) .'/Configuration'; } /** * Fetch the ExportConfigurationInstance * * @return ExportConfigurationInstance Fetched ExportConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExportConfigurationInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExportConfigurationInstance( $this->version, $payload, $this->solution['resourceType'] ); } /** * Update the ExportConfigurationInstance * * @param array|Options $options Optional Arguments * @return ExportConfigurationInstance Updated ExportConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ExportConfigurationInstance { $options = new Values($options); $data = Values::of([ 'Enabled' => Serialize::booleanToString($options['enabled']), 'WebhookUrl' => $options['webhookUrl'], 'WebhookMethod' => $options['webhookMethod'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ExportConfigurationInstance( $this->version, $payload, $this->solution['resourceType'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Bulkexports.V1.ExportConfigurationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Bulkexports/V1.php 0000644 00000005755 15021223077 0013634 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Bulkexports * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Bulkexports; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Bulkexports\V1\ExportList; use Twilio\Rest\Bulkexports\V1\ExportConfigurationList; use Twilio\Version; /** * @property ExportList $exports * @property ExportConfigurationList $exportConfiguration * @method \Twilio\Rest\Bulkexports\V1\ExportContext exports(string $resourceType) */ class V1 extends Version { protected $_exports; protected $_exportConfiguration; /** * Construct the V1 version of Bulkexports * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getExports(): ExportList { if (!$this->_exports) { $this->_exports = new ExportList($this); } return $this->_exports; } protected function getExportConfiguration(): ExportConfigurationList { if (!$this->_exportConfiguration) { $this->_exportConfiguration = new ExportConfigurationList($this); } return $this->_exportConfiguration; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Bulkexports.V1]'; } } sdk/src/Twilio/Rest/Monitor/V1/AlertContext.php 0000644 00000003655 15021223077 0015352 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Monitor * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Monitor\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class AlertContext extends InstanceContext { /** * Initialize the AlertContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Alert resource to fetch. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Alerts/' . \rawurlencode($sid) .''; } /** * Fetch the AlertInstance * * @return AlertInstance Fetched AlertInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AlertInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new AlertInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Monitor.V1.AlertContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/EventOptions.php 0000644 00000015743 15021223077 0015374 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Monitor * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Monitor\V1; use Twilio\Options; use Twilio\Values; abstract class EventOptions { /** * @param string $actorSid Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials. * @param string $eventType Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types). * @param string $resourceSid Only include events that refer to this resource. Useful for discovering the history of a specific resource. * @param string $sourceIpAddress Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console. * @param \DateTime $startDate Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @param \DateTime $endDate Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return ReadEventOptions Options builder */ public static function read( string $actorSid = Values::NONE, string $eventType = Values::NONE, string $resourceSid = Values::NONE, string $sourceIpAddress = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null ): ReadEventOptions { return new ReadEventOptions( $actorSid, $eventType, $resourceSid, $sourceIpAddress, $startDate, $endDate ); } } class ReadEventOptions extends Options { /** * @param string $actorSid Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials. * @param string $eventType Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types). * @param string $resourceSid Only include events that refer to this resource. Useful for discovering the history of a specific resource. * @param string $sourceIpAddress Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console. * @param \DateTime $startDate Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @param \DateTime $endDate Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. */ public function __construct( string $actorSid = Values::NONE, string $eventType = Values::NONE, string $resourceSid = Values::NONE, string $sourceIpAddress = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null ) { $this->options['actorSid'] = $actorSid; $this->options['eventType'] = $eventType; $this->options['resourceSid'] = $resourceSid; $this->options['sourceIpAddress'] = $sourceIpAddress; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials. * * @param string $actorSid Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials. * @return $this Fluent Builder */ public function setActorSid(string $actorSid): self { $this->options['actorSid'] = $actorSid; return $this; } /** * Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types). * * @param string $eventType Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types). * @return $this Fluent Builder */ public function setEventType(string $eventType): self { $this->options['eventType'] = $eventType; return $this; } /** * Only include events that refer to this resource. Useful for discovering the history of a specific resource. * * @param string $resourceSid Only include events that refer to this resource. Useful for discovering the history of a specific resource. * @return $this Fluent Builder */ public function setResourceSid(string $resourceSid): self { $this->options['resourceSid'] = $resourceSid; return $this; } /** * Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console. * * @param string $sourceIpAddress Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console. * @return $this Fluent Builder */ public function setSourceIpAddress(string $sourceIpAddress): self { $this->options['sourceIpAddress'] = $sourceIpAddress; return $this; } /** * Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $endDate Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Monitor.V1.ReadEventOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/EventInstance.php 0000644 00000010605 15021223077 0015475 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Monitor * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Monitor\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $actorSid * @property string|null $actorType * @property string|null $description * @property array|null $eventData * @property \DateTime|null $eventDate * @property string|null $eventType * @property string|null $resourceSid * @property string|null $resourceType * @property string|null $sid * @property string|null $source * @property string|null $sourceIpAddress * @property string|null $url * @property array|null $links */ class EventInstance extends InstanceResource { /** * Initialize the EventInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Event resource to fetch. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'actorSid' => Values::array_get($payload, 'actor_sid'), 'actorType' => Values::array_get($payload, 'actor_type'), 'description' => Values::array_get($payload, 'description'), 'eventData' => Values::array_get($payload, 'event_data'), 'eventDate' => Deserialize::dateTime(Values::array_get($payload, 'event_date')), 'eventType' => Values::array_get($payload, 'event_type'), 'resourceSid' => Values::array_get($payload, 'resource_sid'), 'resourceType' => Values::array_get($payload, 'resource_type'), 'sid' => Values::array_get($payload, 'sid'), 'source' => Values::array_get($payload, 'source'), 'sourceIpAddress' => Values::array_get($payload, 'source_ip_address'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EventContext Context for this EventInstance */ protected function proxy(): EventContext { if (!$this->context) { $this->context = new EventContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the EventInstance * * @return EventInstance Fetched EventInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EventInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Monitor.V1.EventInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/AlertInstance.php 0000644 00000012054 15021223077 0015463 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Monitor * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Monitor\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $accountSid * @property string|null $alertText * @property string|null $apiVersion * @property \DateTime|null $dateCreated * @property \DateTime|null $dateGenerated * @property \DateTime|null $dateUpdated * @property string|null $errorCode * @property string|null $logLevel * @property string|null $moreInfo * @property string|null $requestMethod * @property string|null $requestUrl * @property string|null $requestVariables * @property string|null $resourceSid * @property string|null $responseBody * @property string|null $responseHeaders * @property string|null $sid * @property string|null $url * @property string|null $requestHeaders * @property string|null $serviceSid */ class AlertInstance extends InstanceResource { /** * Initialize the AlertInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Alert resource to fetch. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'alertText' => Values::array_get($payload, 'alert_text'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateGenerated' => Deserialize::dateTime(Values::array_get($payload, 'date_generated')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'errorCode' => Values::array_get($payload, 'error_code'), 'logLevel' => Values::array_get($payload, 'log_level'), 'moreInfo' => Values::array_get($payload, 'more_info'), 'requestMethod' => Values::array_get($payload, 'request_method'), 'requestUrl' => Values::array_get($payload, 'request_url'), 'requestVariables' => Values::array_get($payload, 'request_variables'), 'resourceSid' => Values::array_get($payload, 'resource_sid'), 'responseBody' => Values::array_get($payload, 'response_body'), 'responseHeaders' => Values::array_get($payload, 'response_headers'), 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'requestHeaders' => Values::array_get($payload, 'request_headers'), 'serviceSid' => Values::array_get($payload, 'service_sid'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AlertContext Context for this AlertInstance */ protected function proxy(): AlertContext { if (!$this->context) { $this->context = new AlertContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the AlertInstance * * @return AlertInstance Fetched AlertInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AlertInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Monitor.V1.AlertInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/AlertPage.php 0000644 00000003002 15021223077 0014564 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Monitor * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Monitor\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class AlertPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return AlertInstance \Twilio\Rest\Monitor\V1\AlertInstance */ public function buildInstance(array $payload): AlertInstance { return new AlertInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Monitor.V1.AlertPage]'; } } sdk/src/Twilio/Rest/Monitor/V1/AlertOptions.php 0000644 00000011032 15021223077 0015345 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Monitor * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Monitor\V1; use Twilio\Options; use Twilio\Values; abstract class AlertOptions { /** * @param string $logLevel Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`. * @param \DateTime $startDate Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. * @param \DateTime $endDate Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. * @return ReadAlertOptions Options builder */ public static function read( string $logLevel = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null ): ReadAlertOptions { return new ReadAlertOptions( $logLevel, $startDate, $endDate ); } } class ReadAlertOptions extends Options { /** * @param string $logLevel Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`. * @param \DateTime $startDate Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. * @param \DateTime $endDate Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. */ public function __construct( string $logLevel = Values::NONE, \DateTime $startDate = null, \DateTime $endDate = null ) { $this->options['logLevel'] = $logLevel; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`. * * @param string $logLevel Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`. * @return $this Fluent Builder */ public function setLogLevel(string $logLevel): self { $this->options['logLevel'] = $logLevel; return $this; } /** * Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. * * @param \DateTime $startDate Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. * @return $this Fluent Builder */ public function setStartDate(\DateTime $startDate): self { $this->options['startDate'] = $startDate; return $this; } /** * Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. * * @param \DateTime $endDate Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. * @return $this Fluent Builder */ public function setEndDate(\DateTime $endDate): self { $this->options['endDate'] = $endDate; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Monitor.V1.ReadAlertOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/AlertList.php 0000644 00000013042 15021223077 0014630 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Monitor * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Monitor\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class AlertList extends ListResource { /** * Construct the AlertList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Alerts'; } /** * Reads AlertInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AlertInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams AlertInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of AlertInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return AlertPage Page of AlertInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): AlertPage { $options = new Values($options); $params = Values::of([ 'LogLevel' => $options['logLevel'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new AlertPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AlertInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return AlertPage Page of AlertInstance */ public function getPage(string $targetUrl): AlertPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AlertPage($this->version, $response, $this->solution); } /** * Constructs a AlertContext * * @param string $sid The SID of the Alert resource to fetch. */ public function getContext( string $sid ): AlertContext { return new AlertContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Monitor.V1.AlertList]'; } } sdk/src/Twilio/Rest/Monitor/V1/EventList.php 0000644 00000013370 15021223077 0014646 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Monitor * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Monitor\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class EventList extends ListResource { /** * Construct the EventList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Events'; } /** * Reads EventInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EventInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams EventInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EventInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EventPage Page of EventInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EventPage { $options = new Values($options); $params = Values::of([ 'ActorSid' => $options['actorSid'], 'EventType' => $options['eventType'], 'ResourceSid' => $options['resourceSid'], 'SourceIpAddress' => $options['sourceIpAddress'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EventPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EventInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EventPage Page of EventInstance */ public function getPage(string $targetUrl): EventPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EventPage($this->version, $response, $this->solution); } /** * Constructs a EventContext * * @param string $sid The SID of the Event resource to fetch. */ public function getContext( string $sid ): EventContext { return new EventContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Monitor.V1.EventList]'; } } sdk/src/Twilio/Rest/Monitor/V1/EventPage.php 0000644 00000003002 15021223077 0014576 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Monitor * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Monitor\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EventPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return EventInstance \Twilio\Rest\Monitor\V1\EventInstance */ public function buildInstance(array $payload): EventInstance { return new EventInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Monitor.V1.EventPage]'; } } sdk/src/Twilio/Rest/Monitor/V1/EventContext.php 0000644 00000003655 15021223077 0015364 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Monitor * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Monitor\V1; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class EventContext extends InstanceContext { /** * Initialize the EventContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Event resource to fetch. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Events/' . \rawurlencode($sid) .''; } /** * Fetch the EventInstance * * @return EventInstance Fetched EventInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EventInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new EventInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Monitor.V1.EventContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Monitor/V1.php 0000644 00000005572 15021223077 0012736 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Monitor * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Monitor; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Monitor\V1\AlertList; use Twilio\Rest\Monitor\V1\EventList; use Twilio\Version; /** * @property AlertList $alerts * @property EventList $events * @method \Twilio\Rest\Monitor\V1\AlertContext alerts(string $sid) * @method \Twilio\Rest\Monitor\V1\EventContext events(string $sid) */ class V1 extends Version { protected $_alerts; protected $_events; /** * Construct the V1 version of Monitor * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getAlerts(): AlertList { if (!$this->_alerts) { $this->_alerts = new AlertList($this); } return $this->_alerts; } protected function getEvents(): EventList { if (!$this->_events) { $this->_events = new EventList($this); } return $this->_events; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Monitor.V1]'; } } sdk/src/Twilio/Rest/FlexApi.php 0000644 00000007706 15021223077 0012352 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\FlexApi\V1; use Twilio\Rest\FlexApi\V2; class FlexApi extends FlexApiBase { /** * @deprecated Use v1->assessments instead. */ protected function getAssessments(): \Twilio\Rest\FlexApi\V1\AssessmentsList { echo "assessments is deprecated. Use v1->assessments instead."; return $this->v1->assessments; } /** * @deprecated Use v1->assessments() instead. */ protected function contextAssessments(): \Twilio\Rest\FlexApi\V1\AssessmentsContext { echo "assessments() is deprecated. Use v1->assessments() instead."; return $this->v1->assessments(); } /** * @deprecated Use v1->channel instead. */ protected function getChannel(): \Twilio\Rest\FlexApi\V1\ChannelList { echo "channel is deprecated. Use v1->channel instead."; return $this->v1->channel; } /** * @deprecated Use v1->channel(\$sid) instead. * @param string $sid The SID that identifies the Flex chat channel resource to * fetch */ protected function contextChannel(string $sid): \Twilio\Rest\FlexApi\V1\ChannelContext { echo "channel(\$sid) is deprecated. Use v1->channel(\$sid) instead."; return $this->v1->channel($sid); } /** * @deprecated Use v1->configuration instead. */ protected function getConfiguration(): \Twilio\Rest\FlexApi\V1\ConfigurationList { echo "configuration is deprecated. Use v1->configuration instead."; return $this->v1->configuration; } /** * @deprecated Use v1->configuration() instead. */ protected function contextConfiguration(): \Twilio\Rest\FlexApi\V1\ConfigurationContext { echo "configuration() is deprecated. Use v1->configuration() instead."; return $this->v1->configuration(); } /** * @deprecated Use v1->flexFlow instead. */ protected function getFlexFlow(): \Twilio\Rest\FlexApi\V1\FlexFlowList { echo "flexFlow is deprecated. Use v1->flexFlow instead."; return $this->v1->flexFlow; } /** * @deprecated Use v1->flexFlow(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextFlexFlow(string $sid): \Twilio\Rest\FlexApi\V1\FlexFlowContext { echo "flexFlow(\$sid) is deprecated. Use v1->flexFlow(\$sid) instead."; return $this->v1->flexFlow($sid); } /** * @deprecated Use v1->interaction instead. */ protected function getInteraction(): \Twilio\Rest\FlexApi\V1\InteractionList { echo "interaction is deprecated. Use v1->interaction instead."; return $this->v1->interaction; } /** * @deprecated Use v1->interaction(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextInteraction(string $sid): \Twilio\Rest\FlexApi\V1\InteractionContext { echo "interaction(\$sid) is deprecated. Use v1->interaction(\$sid) instead."; return $this->v1->interaction($sid); } /** * @deprecated Use v1->webChannel instead. */ protected function getWebChannel(): \Twilio\Rest\FlexApi\V1\WebChannelList { echo "webChannel is deprecated. Use v1->webChannel instead."; return $this->v1->webChannel; } /** * @deprecated Use v1->webChannel(\$sid) instead. * @param string $sid The SID of the WebChannel resource to fetch */ protected function contextWebChannel(string $sid): \Twilio\Rest\FlexApi\V1\WebChannelContext { echo "webChannel(\$sid) is deprecated. Use v1->webChannel(\$sid) instead."; return $this->v1->webChannel($sid); } /** * @deprecated Use v2->webChannels instead. */ protected function getWebChannels(): \Twilio\Rest\FlexApi\V2\WebChannelsList { echo "webChannels is deprecated. Use v2->webChannels instead."; return $this->v2->webChannels; } } sdk/src/Twilio/Rest/Preview.php 0000644 00000015647 15021223077 0012446 0 ustar 00 <?php namespace Twilio\Rest; class Preview extends PreviewBase { /** * @deprecated Use deployedDevices->fleets instead. */ protected function getFleets(): \Twilio\Rest\Preview\DeployedDevices\FleetList { echo "fleets is deprecated. Use deployedDevices->fleets instead."; return $this->deployedDevices->fleets; } /** * @deprecated Use deployedDevices->fleets(\$sid) instead. * @param string $sid A string that uniquely identifies the Fleet. */ protected function contextFleets(string $sid): \Twilio\Rest\Preview\DeployedDevices\FleetContext { echo "fleets(\$sid) is deprecated. Use deployedDevices->fleets(\$sid) instead."; return $this->deployedDevices->fleets($sid); } /** * @deprecated Use hostedNumbers->authorizationDocuments instead. */ protected function getAuthorizationDocuments(): \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentList { echo "authorizationDocuments is deprecated. Use hostedNumbers->authorizationDocuments instead."; return $this->hostedNumbers->authorizationDocuments; } /** * @deprecated Use hostedNumbers->authorizationDocuments(\$sid) instead. * @param string $sid AuthorizationDocument sid. */ protected function contextAuthorizationDocuments(string $sid): \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentContext { echo "authorizationDocuments(\$sid) is deprecated. Use hostedNumbers->authorizationDocuments(\$sid) instead."; return $this->hostedNumbers->authorizationDocuments($sid); } /** * @deprecated Use hostedNumbers->hostedNumberOrders instead. */ protected function getHostedNumberOrders(): \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderList { echo "hostedNumberOrders is deprecated. Use hostedNumbers->hostedNumberOrders instead."; return $this->hostedNumbers->hostedNumberOrders; } /** * @deprecated Use hostedNumbers->hostedNumberOrders(\$sid) instead * @param string $sid HostedNumberOrder sid. */ protected function contextHostedNumberOrders(string $sid): \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderContext { echo "hostedNumberOrders(\$sid) is deprecated. Use hostedNumbers->hostedNumberOrders(\$sid) instead."; return $this->hostedNumbers->hostedNumberOrders($sid); } /** * @deprecated Use marketplace->availableAddOns instead. */ protected function getAvailableAddOns(): \Twilio\Rest\Preview\Marketplace\AvailableAddOnList { echo "availableAddOns is deprecated. Use marketplace->availableAddOns instead."; return $this->marketplace->availableAddOns; } /** * @deprecated Use marketplace->availableAddOns(\$sid) instead. * @param string $sid The SID of the AvailableAddOn resource to fetch */ protected function contextAvailableAddOns(string $sid): \Twilio\Rest\Preview\Marketplace\AvailableAddOnContext { echo "availableAddOns(\$sid) is deprecated. Use marketplace->availableAddOns(\$sid) instead."; return $this->marketplace->availableAddOns($sid); } /** * @deprecated Use marketplace->installedAddOns instead. */ protected function getInstalledAddOns(): \Twilio\Rest\Preview\Marketplace\InstalledAddOnList { echo "installedAddOns is deprecated. Use marketplace->installedAddOns instead."; return $this->marketplace->installedAddOns; } /** * @deprecated Use marketplace->installedAddOns(\$sid) instead. * @param string $sid The SID of the InstalledAddOn resource to fetch */ protected function contextInstalledAddOns(string $sid): \Twilio\Rest\Preview\Marketplace\InstalledAddOnContext { echo "installedAddOns(\$sid) is deprecated. Use marketplace->installedAddOns(\$sid) instead."; return $this->marketplace->installedAddOns($sid); } /** * @deprecated Use sync->services instead. */ protected function getServices(): \Twilio\Rest\Preview\Sync\ServiceList { echo "services is deprecated. Use sync->services instead."; return $this->sync->services; } /** * @deprecated Use sync->services(\$sid) instead. * @param string $sid The sid */ protected function contextServices(string $sid): \Twilio\Rest\Preview\Sync\ServiceContext { echo "services(\$sid) is deprecated. Use sync->services(\$sid) instead."; return $this->sync->services($sid); } /** * @deprecated Use understand->assistants instead. */ protected function getAssistants(): \Twilio\Rest\Preview\Understand\AssistantList { echo "assistants is deprecated. Use understand->assistants instead."; return $this->understand->assistants; } /** * @deprecated Use understand->assistants(\$sid) instead. * @param string $sid A 34 character string that uniquely identifies this * resource. */ protected function contextAssistants(string $sid): \Twilio\Rest\Preview\Understand\AssistantContext { echo "assistants(\$sid) is deprecated. Use understand->assistants(\$sid) instead."; return $this->understand->assistants($sid); } /** * @deprecated Use wireless->commands instead. */ protected function getCommands(): \Twilio\Rest\Preview\Wireless\CommandList { echo "commands is deprecated. Use wireless->commands instead."; return $this->wireless->commands; } /** * @deprecated Use wireless->commands(\$sid) instead. * @param string $sid The sid */ protected function contextCommands(string $sid): \Twilio\Rest\Preview\Wireless\CommandContext { echo "commands(\$sid) is deprecated. Use wireless->commands(\$sid) instead."; return $this->wireless->commands($sid); } /** * @deprecated Use wireless->ratePlans instead. */ protected function getRatePlans(): \Twilio\Rest\Preview\Wireless\RatePlanList { echo "ratePlans is deprecated. Use wireless->ratePlans instead."; return $this->wireless->ratePlans; } /** * @deprecated Use wireless->ratePlans(\$sid) instead. * @param string $sid The sid */ protected function contextRatePlans(string $sid): \Twilio\Rest\Preview\Wireless\RatePlanContext { echo "ratePlans(\$sid) is deprecated. Use wireless->ratePlans(\$sid) instead."; return $this->wireless->ratePlans($sid); } /** * @deprecated Use wireless->sims instead. */ protected function getSims(): \Twilio\Rest\Preview\Wireless\SimList { echo "sims is deprecated. Use wireless->sims instead."; return $this->wireless->sims; } /** * @deprecated Use wireless->sims(\$sid) instead. * @param string $sid The sid */ protected function contextSims(string $sid): \Twilio\Rest\Preview\Wireless\SimContext { echo "sims(\$sid) is deprecated. Use wireless->sims(\$sid) instead."; return $this->wireless->sims($sid); } } sdk/src/Twilio/Rest/TaskrouterBase.php 0000644 00000004556 15021223077 0013760 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Taskrouter\V1; /** * @property \Twilio\Rest\Taskrouter\V1 $v1 */ class TaskrouterBase extends Domain { protected $_v1; /** * Construct the Taskrouter Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://taskrouter.twilio.com'; } /** * @return V1 Version v1 of taskrouter */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Taskrouter]'; } } sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberInstance.php 0000644 00000012005 15021223077 0016640 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Lookups\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $callingCountryCode * @property string|null $countryCode * @property string|null $phoneNumber * @property string|null $nationalFormat * @property bool|null $valid * @property string[]|null $validationErrors * @property array|null $callerName * @property array|null $simSwap * @property array|null $callForwarding * @property array|null $lineStatus * @property array|null $lineTypeIntelligence * @property array|null $identityMatch * @property array|null $reassignedNumber * @property array|null $smsPumpingRisk * @property array|null $phoneNumberQualityScore * @property string|null $url */ class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $phoneNumber The phone number to lookup in E.164 or national format. Default country code is +1 (North America). */ public function __construct(Version $version, array $payload, string $phoneNumber = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'callingCountryCode' => Values::array_get($payload, 'calling_country_code'), 'countryCode' => Values::array_get($payload, 'country_code'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'nationalFormat' => Values::array_get($payload, 'national_format'), 'valid' => Values::array_get($payload, 'valid'), 'validationErrors' => Values::array_get($payload, 'validation_errors'), 'callerName' => Values::array_get($payload, 'caller_name'), 'simSwap' => Values::array_get($payload, 'sim_swap'), 'callForwarding' => Values::array_get($payload, 'call_forwarding'), 'lineStatus' => Values::array_get($payload, 'line_status'), 'lineTypeIntelligence' => Values::array_get($payload, 'line_type_intelligence'), 'identityMatch' => Values::array_get($payload, 'identity_match'), 'reassignedNumber' => Values::array_get($payload, 'reassigned_number'), 'smsPumpingRisk' => Values::array_get($payload, 'sms_pumping_risk'), 'phoneNumberQualityScore' => Values::array_get($payload, 'phone_number_quality_score'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['phoneNumber' => $phoneNumber ?: $this->properties['phoneNumber'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PhoneNumberContext Context for this PhoneNumberInstance */ protected function proxy(): PhoneNumberContext { if (!$this->context) { $this->context = new PhoneNumberContext( $this->version, $this->solution['phoneNumber'] ); } return $this->context; } /** * Fetch the PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): PhoneNumberInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Lookups.V2.PhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberPage.php 0000644 00000003046 15021223077 0015755 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Lookups\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PhoneNumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return PhoneNumberInstance \Twilio\Rest\Lookups\V2\PhoneNumberInstance */ public function buildInstance(array $payload): PhoneNumberInstance { return new PhoneNumberInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Lookups.V2.PhoneNumberPage]'; } } sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberOptions.php 0000644 00000034610 15021223077 0016535 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Lookups\V2; use Twilio\Options; use Twilio\Values; abstract class PhoneNumberOptions { /** * @param string $fields A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. * @param string $countryCode The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. * @param string $firstName User’s first name. This query parameter is only used (optionally) for identity_match package requests. * @param string $lastName User’s last name. This query parameter is only used (optionally) for identity_match package requests. * @param string $addressLine1 User’s first address line. This query parameter is only used (optionally) for identity_match package requests. * @param string $addressLine2 User’s second address line. This query parameter is only used (optionally) for identity_match package requests. * @param string $city User’s city. This query parameter is only used (optionally) for identity_match package requests. * @param string $state User’s country subdivision, such as state, province, or locality. This query parameter is only used (optionally) for identity_match package requests. * @param string $postalCode User’s postal zip code. This query parameter is only used (optionally) for identity_match package requests. * @param string $addressCountryCode User’s country, up to two characters. This query parameter is only used (optionally) for identity_match package requests. * @param string $nationalId User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests. * @param string $dateOfBirth User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. * @param string $lastVerifiedDate The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. * @return FetchPhoneNumberOptions Options builder */ public static function fetch( string $fields = Values::NONE, string $countryCode = Values::NONE, string $firstName = Values::NONE, string $lastName = Values::NONE, string $addressLine1 = Values::NONE, string $addressLine2 = Values::NONE, string $city = Values::NONE, string $state = Values::NONE, string $postalCode = Values::NONE, string $addressCountryCode = Values::NONE, string $nationalId = Values::NONE, string $dateOfBirth = Values::NONE, string $lastVerifiedDate = Values::NONE ): FetchPhoneNumberOptions { return new FetchPhoneNumberOptions( $fields, $countryCode, $firstName, $lastName, $addressLine1, $addressLine2, $city, $state, $postalCode, $addressCountryCode, $nationalId, $dateOfBirth, $lastVerifiedDate ); } } class FetchPhoneNumberOptions extends Options { /** * @param string $fields A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. * @param string $countryCode The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. * @param string $firstName User’s first name. This query parameter is only used (optionally) for identity_match package requests. * @param string $lastName User’s last name. This query parameter is only used (optionally) for identity_match package requests. * @param string $addressLine1 User’s first address line. This query parameter is only used (optionally) for identity_match package requests. * @param string $addressLine2 User’s second address line. This query parameter is only used (optionally) for identity_match package requests. * @param string $city User’s city. This query parameter is only used (optionally) for identity_match package requests. * @param string $state User’s country subdivision, such as state, province, or locality. This query parameter is only used (optionally) for identity_match package requests. * @param string $postalCode User’s postal zip code. This query parameter is only used (optionally) for identity_match package requests. * @param string $addressCountryCode User’s country, up to two characters. This query parameter is only used (optionally) for identity_match package requests. * @param string $nationalId User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests. * @param string $dateOfBirth User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. * @param string $lastVerifiedDate The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. */ public function __construct( string $fields = Values::NONE, string $countryCode = Values::NONE, string $firstName = Values::NONE, string $lastName = Values::NONE, string $addressLine1 = Values::NONE, string $addressLine2 = Values::NONE, string $city = Values::NONE, string $state = Values::NONE, string $postalCode = Values::NONE, string $addressCountryCode = Values::NONE, string $nationalId = Values::NONE, string $dateOfBirth = Values::NONE, string $lastVerifiedDate = Values::NONE ) { $this->options['fields'] = $fields; $this->options['countryCode'] = $countryCode; $this->options['firstName'] = $firstName; $this->options['lastName'] = $lastName; $this->options['addressLine1'] = $addressLine1; $this->options['addressLine2'] = $addressLine2; $this->options['city'] = $city; $this->options['state'] = $state; $this->options['postalCode'] = $postalCode; $this->options['addressCountryCode'] = $addressCountryCode; $this->options['nationalId'] = $nationalId; $this->options['dateOfBirth'] = $dateOfBirth; $this->options['lastVerifiedDate'] = $lastVerifiedDate; } /** * A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. * * @param string $fields A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. * @return $this Fluent Builder */ public function setFields(string $fields): self { $this->options['fields'] = $fields; return $this; } /** * The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. * * @param string $countryCode The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. * @return $this Fluent Builder */ public function setCountryCode(string $countryCode): self { $this->options['countryCode'] = $countryCode; return $this; } /** * User’s first name. This query parameter is only used (optionally) for identity_match package requests. * * @param string $firstName User’s first name. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setFirstName(string $firstName): self { $this->options['firstName'] = $firstName; return $this; } /** * User’s last name. This query parameter is only used (optionally) for identity_match package requests. * * @param string $lastName User’s last name. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setLastName(string $lastName): self { $this->options['lastName'] = $lastName; return $this; } /** * User’s first address line. This query parameter is only used (optionally) for identity_match package requests. * * @param string $addressLine1 User’s first address line. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setAddressLine1(string $addressLine1): self { $this->options['addressLine1'] = $addressLine1; return $this; } /** * User’s second address line. This query parameter is only used (optionally) for identity_match package requests. * * @param string $addressLine2 User’s second address line. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setAddressLine2(string $addressLine2): self { $this->options['addressLine2'] = $addressLine2; return $this; } /** * User’s city. This query parameter is only used (optionally) for identity_match package requests. * * @param string $city User’s city. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setCity(string $city): self { $this->options['city'] = $city; return $this; } /** * User’s country subdivision, such as state, province, or locality. This query parameter is only used (optionally) for identity_match package requests. * * @param string $state User’s country subdivision, such as state, province, or locality. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setState(string $state): self { $this->options['state'] = $state; return $this; } /** * User’s postal zip code. This query parameter is only used (optionally) for identity_match package requests. * * @param string $postalCode User’s postal zip code. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setPostalCode(string $postalCode): self { $this->options['postalCode'] = $postalCode; return $this; } /** * User’s country, up to two characters. This query parameter is only used (optionally) for identity_match package requests. * * @param string $addressCountryCode User’s country, up to two characters. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setAddressCountryCode(string $addressCountryCode): self { $this->options['addressCountryCode'] = $addressCountryCode; return $this; } /** * User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests. * * @param string $nationalId User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setNationalId(string $nationalId): self { $this->options['nationalId'] = $nationalId; return $this; } /** * User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. * * @param string $dateOfBirth User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. * @return $this Fluent Builder */ public function setDateOfBirth(string $dateOfBirth): self { $this->options['dateOfBirth'] = $dateOfBirth; return $this; } /** * The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. * * @param string $lastVerifiedDate The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. * @return $this Fluent Builder */ public function setLastVerifiedDate(string $lastVerifiedDate): self { $this->options['lastVerifiedDate'] = $lastVerifiedDate; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Lookups.V2.FetchPhoneNumberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberContext.php 0000644 00000006224 15021223077 0016526 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Lookups\V2; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class PhoneNumberContext extends InstanceContext { /** * Initialize the PhoneNumberContext * * @param Version $version Version that contains the resource * @param string $phoneNumber The phone number to lookup in E.164 or national format. Default country code is +1 (North America). */ public function __construct( Version $version, $phoneNumber ) { parent::__construct($version); // Path Solution $this->solution = [ 'phoneNumber' => $phoneNumber, ]; $this->uri = '/PhoneNumbers/' . \rawurlencode($phoneNumber) .''; } /** * Fetch the PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): PhoneNumberInstance { $options = new Values($options); $params = Values::of([ 'Fields' => $options['fields'], 'CountryCode' => $options['countryCode'], 'FirstName' => $options['firstName'], 'LastName' => $options['lastName'], 'AddressLine1' => $options['addressLine1'], 'AddressLine2' => $options['addressLine2'], 'City' => $options['city'], 'State' => $options['state'], 'PostalCode' => $options['postalCode'], 'AddressCountryCode' => $options['addressCountryCode'], 'NationalId' => $options['nationalId'], 'DateOfBirth' => $options['dateOfBirth'], 'LastVerifiedDate' => $options['lastVerifiedDate'], ]); $payload = $this->version->fetch('GET', $this->uri, $params, []); return new PhoneNumberInstance( $this->version, $payload, $this->solution['phoneNumber'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Lookups.V2.PhoneNumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Lookups/V2/PhoneNumberList.php 0000644 00000003043 15021223077 0016011 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Lookups\V2; use Twilio\ListResource; use Twilio\Version; class PhoneNumberList extends ListResource { /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a PhoneNumberContext * * @param string $phoneNumber The phone number to lookup in E.164 or national format. Default country code is +1 (North America). */ public function getContext( string $phoneNumber ): PhoneNumberContext { return new PhoneNumberContext( $this->version, $phoneNumber ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Lookups.V2.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Lookups/V2.php 0000644 00000005163 15021223077 0012740 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Lookups; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Lookups\V2\PhoneNumberList; use Twilio\Version; /** * @property PhoneNumberList $phoneNumbers * @method \Twilio\Rest\Lookups\V2\PhoneNumberContext phoneNumbers(string $phoneNumber) */ class V2 extends Version { protected $_phoneNumbers; /** * Construct the V2 version of Lookups * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v2'; } protected function getPhoneNumbers(): PhoneNumberList { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList($this); } return $this->_phoneNumbers; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Lookups.V2]'; } } sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberInstance.php 0000644 00000007726 15021223077 0016655 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Lookups\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property array|null $callerName * @property string|null $countryCode * @property string|null $phoneNumber * @property string|null $nationalFormat * @property array|null $carrier * @property array|null $addOns * @property string|null $url */ class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $phoneNumber The phone number to lookup in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. */ public function __construct(Version $version, array $payload, string $phoneNumber = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'callerName' => Values::array_get($payload, 'caller_name'), 'countryCode' => Values::array_get($payload, 'country_code'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'nationalFormat' => Values::array_get($payload, 'national_format'), 'carrier' => Values::array_get($payload, 'carrier'), 'addOns' => Values::array_get($payload, 'add_ons'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['phoneNumber' => $phoneNumber ?: $this->properties['phoneNumber'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return PhoneNumberContext Context for this PhoneNumberInstance */ protected function proxy(): PhoneNumberContext { if (!$this->context) { $this->context = new PhoneNumberContext( $this->version, $this->solution['phoneNumber'] ); } return $this->context; } /** * Fetch the PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): PhoneNumberInstance { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Lookups.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberPage.php 0000644 00000003046 15021223077 0015754 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Lookups\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class PhoneNumberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return PhoneNumberInstance \Twilio\Rest\Lookups\V1\PhoneNumberInstance */ public function buildInstance(array $payload): PhoneNumberInstance { return new PhoneNumberInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Lookups.V1.PhoneNumberPage]'; } } sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberOptions.php 0000644 00000016017 15021223077 0016535 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Lookups\V1; use Twilio\Options; use Twilio\Values; abstract class PhoneNumberOptions { /** * @param string $countryCode The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. * @param string[] $type The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. * @param string[] $addOns The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). * @param string $addOnsData Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. * @return FetchPhoneNumberOptions Options builder */ public static function fetch( string $countryCode = Values::NONE, array $type = Values::ARRAY_NONE, array $addOns = Values::ARRAY_NONE, string $addOnsData = Values::NONE ): FetchPhoneNumberOptions { return new FetchPhoneNumberOptions( $countryCode, $type, $addOns, $addOnsData ); } } class FetchPhoneNumberOptions extends Options { /** * @param string $countryCode The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. * @param string[] $type The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. * @param string[] $addOns The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). * @param string $addOnsData Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. */ public function __construct( string $countryCode = Values::NONE, array $type = Values::ARRAY_NONE, array $addOns = Values::ARRAY_NONE, string $addOnsData = Values::NONE ) { $this->options['countryCode'] = $countryCode; $this->options['type'] = $type; $this->options['addOns'] = $addOns; $this->options['addOnsData'] = $addOnsData; } /** * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. * * @param string $countryCode The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. * @return $this Fluent Builder */ public function setCountryCode(string $countryCode): self { $this->options['countryCode'] = $countryCode; return $this; } /** * The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. * * @param string[] $type The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. * @return $this Fluent Builder */ public function setType(array $type): self { $this->options['type'] = $type; return $this; } /** * The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). * * @param string[] $addOns The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). * @return $this Fluent Builder */ public function setAddOns(array $addOns): self { $this->options['addOns'] = $addOns; return $this; } /** * Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. * * @param string $addOnsData Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. * @return $this Fluent Builder */ public function setAddOnsData(string $addOnsData): self { $this->options['addOnsData'] = $addOnsData; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Lookups.V1.FetchPhoneNumberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberContext.php 0000644 00000005372 15021223077 0016530 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Lookups\V1; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class PhoneNumberContext extends InstanceContext { /** * Initialize the PhoneNumberContext * * @param Version $version Version that contains the resource * @param string $phoneNumber The phone number to lookup in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. */ public function __construct( Version $version, $phoneNumber ) { parent::__construct($version); // Path Solution $this->solution = [ 'phoneNumber' => $phoneNumber, ]; $this->uri = '/PhoneNumbers/' . \rawurlencode($phoneNumber) .''; } /** * Fetch the PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(array $options = []): PhoneNumberInstance { $options = new Values($options); $params = Values::of([ 'CountryCode' => $options['countryCode'], 'Type' => Serialize::map($options['type'], function ($e) { return $e; }), 'AddOns' => Serialize::map($options['addOns'], function ($e) { return $e; }), ]); $params = \array_merge($params, Serialize::prefixedCollapsibleMap($options['addOnsData'], 'AddOns')); $payload = $this->version->fetch('GET', $this->uri, $params, []); return new PhoneNumberInstance( $this->version, $payload, $this->solution['phoneNumber'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Lookups.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberList.php 0000644 00000003147 15021223077 0016015 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Lookups\V1; use Twilio\ListResource; use Twilio\Version; class PhoneNumberList extends ListResource { /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; } /** * Constructs a PhoneNumberContext * * @param string $phoneNumber The phone number to lookup in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. */ public function getContext( string $phoneNumber ): PhoneNumberContext { return new PhoneNumberContext( $this->version, $phoneNumber ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Lookups.V1.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Lookups/V1.php 0000644 00000005163 15021223077 0012737 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Lookups * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Lookups; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Lookups\V1\PhoneNumberList; use Twilio\Version; /** * @property PhoneNumberList $phoneNumbers * @method \Twilio\Rest\Lookups\V1\PhoneNumberContext phoneNumbers(string $phoneNumber) */ class V1 extends Version { protected $_phoneNumbers; /** * Construct the V1 version of Lookups * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getPhoneNumbers(): PhoneNumberList { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList($this); } return $this->_phoneNumbers; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Lookups.V1]'; } } sdk/src/Twilio/Rest/ChatBase.php 0000644 00000005574 15021223077 0012475 0 ustar 00 <?php /* * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Chat\V1; use Twilio\Rest\Chat\V2; use Twilio\Rest\Chat\V3; /** * @property \Twilio\Rest\Chat\V1 $v1 * @property \Twilio\Rest\Chat\V2 $v2 * @property \Twilio\Rest\Chat\V3 $v3 */ class ChatBase extends Domain { protected $_v1; protected $_v2; protected $_v3; /** * Construct the Chat Domain * * @param Client $client Client to communicate with Twilio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://chat.twilio.com'; } /** * @return V1 Version v1 of chat */ protected function getV1(): V1 { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return V2 Version v2 of chat */ protected function getV2(): V2 { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * @return V3 Version v3 of chat */ protected function getV3(): V3 { if (!$this->_v3) { $this->_v3 = new V3($this); } return $this->_v3; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array([$this, $method], $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Chat]'; } } sdk/src/Twilio/Rest/Studio/V2/FlowValidateOptions.php 0000644 00000003671 15021223077 0016512 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2; use Twilio\Options; use Twilio\Values; abstract class FlowValidateOptions { /** * @param string $commitMessage Description of change made in the revision. * @return UpdateFlowValidateOptions Options builder */ public static function update( string $commitMessage = Values::NONE ): UpdateFlowValidateOptions { return new UpdateFlowValidateOptions( $commitMessage ); } } class UpdateFlowValidateOptions extends Options { /** * @param string $commitMessage Description of change made in the revision. */ public function __construct( string $commitMessage = Values::NONE ) { $this->options['commitMessage'] = $commitMessage; } /** * Description of change made in the revision. * * @param string $commitMessage Description of change made in the revision. * @return $this Fluent Builder */ public function setCommitMessage(string $commitMessage): self { $this->options['commitMessage'] = $commitMessage; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Studio.V2.UpdateFlowValidateOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Studio/V2/FlowPage.php 0000644 00000002770 15021223077 0014260 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FlowPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FlowInstance \Twilio\Rest\Studio\V2\FlowInstance */ public function buildInstance(array $payload): FlowInstance { return new FlowInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.FlowPage]'; } } sdk/src/Twilio/Rest/Studio/V2/FlowInstance.php 0000644 00000013461 15021223077 0015147 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Studio\V2\Flow\ExecutionList; use Twilio\Rest\Studio\V2\Flow\FlowRevisionList; use Twilio\Rest\Studio\V2\Flow\FlowTestUserList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property array|null $definition * @property string $status * @property int|null $revision * @property string|null $commitMessage * @property bool|null $valid * @property array[]|null $errors * @property array[]|null $warnings * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $webhookUrl * @property string|null $url * @property array|null $links */ class FlowInstance extends InstanceResource { protected $_executions; protected $_revisions; protected $_testUsers; /** * Initialize the FlowInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Flow resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'definition' => Values::array_get($payload, 'definition'), 'status' => Values::array_get($payload, 'status'), 'revision' => Values::array_get($payload, 'revision'), 'commitMessage' => Values::array_get($payload, 'commit_message'), 'valid' => Values::array_get($payload, 'valid'), 'errors' => Values::array_get($payload, 'errors'), 'warnings' => Values::array_get($payload, 'warnings'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FlowContext Context for this FlowInstance */ protected function proxy(): FlowContext { if (!$this->context) { $this->context = new FlowContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the FlowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the FlowInstance * * @return FlowInstance Fetched FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlowInstance { return $this->proxy()->fetch(); } /** * Update the FlowInstance * * @param string $status * @param array|Options $options Optional Arguments * @return FlowInstance Updated FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): FlowInstance { return $this->proxy()->update($status, $options); } /** * Access the executions */ protected function getExecutions(): ExecutionList { return $this->proxy()->executions; } /** * Access the revisions */ protected function getRevisions(): FlowRevisionList { return $this->proxy()->revisions; } /** * Access the testUsers */ protected function getTestUsers(): FlowTestUserList { return $this->proxy()->testUsers; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.FlowInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/FlowContext.php 0000644 00000013506 15021223077 0015027 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\Studio\V2\Flow\ExecutionList; use Twilio\Rest\Studio\V2\Flow\FlowRevisionList; use Twilio\Rest\Studio\V2\Flow\FlowTestUserList; /** * @property ExecutionList $executions * @property FlowRevisionList $revisions * @property FlowTestUserList $testUsers * @method \Twilio\Rest\Studio\V2\Flow\ExecutionContext executions(string $sid) * @method \Twilio\Rest\Studio\V2\Flow\FlowTestUserContext testUsers() * @method \Twilio\Rest\Studio\V2\Flow\FlowRevisionContext revisions(string $revision) */ class FlowContext extends InstanceContext { protected $_executions; protected $_revisions; protected $_testUsers; /** * Initialize the FlowContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Flow resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($sid) .''; } /** * Delete the FlowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the FlowInstance * * @return FlowInstance Fetched FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlowInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new FlowInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the FlowInstance * * @param string $status * @param array|Options $options Optional Arguments * @return FlowInstance Updated FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status, array $options = []): FlowInstance { $options = new Values($options); $data = Values::of([ 'Status' => $status, 'FriendlyName' => $options['friendlyName'], 'Definition' => Serialize::jsonObject($options['definition']), 'CommitMessage' => $options['commitMessage'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FlowInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the executions */ protected function getExecutions(): ExecutionList { if (!$this->_executions) { $this->_executions = new ExecutionList( $this->version, $this->solution['sid'] ); } return $this->_executions; } /** * Access the revisions */ protected function getRevisions(): FlowRevisionList { if (!$this->_revisions) { $this->_revisions = new FlowRevisionList( $this->version, $this->solution['sid'] ); } return $this->_revisions; } /** * Access the testUsers */ protected function getTestUsers(): FlowTestUserList { if (!$this->_testUsers) { $this->_testUsers = new FlowTestUserList( $this->version, $this->solution['sid'] ); } return $this->_testUsers; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.FlowContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/FlowOptions.php 0000644 00000010771 15021223077 0015037 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2; use Twilio\Options; use Twilio\Values; abstract class FlowOptions { /** * @param string $commitMessage Description of change made in the revision. * @return CreateFlowOptions Options builder */ public static function create( string $commitMessage = Values::NONE ): CreateFlowOptions { return new CreateFlowOptions( $commitMessage ); } /** * @param string $friendlyName The string that you assigned to describe the Flow. * @param array $definition JSON representation of flow definition. * @param string $commitMessage Description of change made in the revision. * @return UpdateFlowOptions Options builder */ public static function update( string $friendlyName = Values::NONE, array $definition = Values::ARRAY_NONE, string $commitMessage = Values::NONE ): UpdateFlowOptions { return new UpdateFlowOptions( $friendlyName, $definition, $commitMessage ); } } class CreateFlowOptions extends Options { /** * @param string $commitMessage Description of change made in the revision. */ public function __construct( string $commitMessage = Values::NONE ) { $this->options['commitMessage'] = $commitMessage; } /** * Description of change made in the revision. * * @param string $commitMessage Description of change made in the revision. * @return $this Fluent Builder */ public function setCommitMessage(string $commitMessage): self { $this->options['commitMessage'] = $commitMessage; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Studio.V2.CreateFlowOptions ' . $options . ']'; } } class UpdateFlowOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the Flow. * @param array $definition JSON representation of flow definition. * @param string $commitMessage Description of change made in the revision. */ public function __construct( string $friendlyName = Values::NONE, array $definition = Values::ARRAY_NONE, string $commitMessage = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['definition'] = $definition; $this->options['commitMessage'] = $commitMessage; } /** * The string that you assigned to describe the Flow. * * @param string $friendlyName The string that you assigned to describe the Flow. * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * JSON representation of flow definition. * * @param array $definition JSON representation of flow definition. * @return $this Fluent Builder */ public function setDefinition(array $definition): self { $this->options['definition'] = $definition; return $this; } /** * Description of change made in the revision. * * @param string $commitMessage Description of change made in the revision. * @return $this Fluent Builder */ public function setCommitMessage(string $commitMessage): self { $this->options['commitMessage'] = $commitMessage; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Studio.V2.UpdateFlowOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Studio/V2/FlowValidateInstance.php 0000644 00000003752 15021223077 0016623 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property bool|null $valid */ class FlowValidateInstance extends InstanceResource { /** * Initialize the FlowValidateInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'valid' => Values::array_get($payload, 'valid'), ]; $this->solution = []; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.FlowValidateInstance]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionPage.php 0000644 00000003112 15021223077 0016675 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FlowRevisionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FlowRevisionInstance \Twilio\Rest\Studio\V2\Flow\FlowRevisionInstance */ public function buildInstance(array $payload): FlowRevisionInstance { return new FlowRevisionInstance($this->version, $payload, $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.FlowRevisionPage]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserList.php 0000644 00000003006 15021223077 0016716 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\ListResource; use Twilio\Version; class FlowTestUserList extends ListResource { /** * Construct the FlowTestUserList * * @param Version $version Version that contains the resource * @param string $sid Unique identifier of the flow. */ public function __construct( Version $version, string $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; } /** * Constructs a FlowTestUserContext */ public function getContext( ): FlowTestUserContext { return new FlowTestUserContext( $this->version, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.FlowTestUserList]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionPage.php 0000644 00000003074 15021223077 0016221 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ExecutionInstance \Twilio\Rest\Studio\V2\Flow\ExecutionInstance */ public function buildInstance(array $payload): ExecutionInstance { return new ExecutionInstance($this->version, $payload, $this->solution['flowSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.ExecutionPage]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserPage.php 0000644 00000003112 15021223077 0016655 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FlowTestUserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FlowTestUserInstance \Twilio\Rest\Studio\V2\Flow\FlowTestUserInstance */ public function buildInstance(array $payload): FlowTestUserInstance { return new FlowTestUserInstance($this->version, $payload, $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.FlowTestUserPage]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionOptions.php 0000644 00000014576 15021223077 0017011 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Options; use Twilio\Values; abstract class ExecutionOptions { /** * @param array $parameters JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. * @return CreateExecutionOptions Options builder */ public static function create( array $parameters = Values::ARRAY_NONE ): CreateExecutionOptions { return new CreateExecutionOptions( $parameters ); } /** * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @return ReadExecutionOptions Options builder */ public static function read( \DateTime $dateCreatedFrom = null, \DateTime $dateCreatedTo = null ): ReadExecutionOptions { return new ReadExecutionOptions( $dateCreatedFrom, $dateCreatedTo ); } } class CreateExecutionOptions extends Options { /** * @param array $parameters JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. */ public function __construct( array $parameters = Values::ARRAY_NONE ) { $this->options['parameters'] = $parameters; } /** * JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. * * @param array $parameters JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. * @return $this Fluent Builder */ public function setParameters(array $parameters): self { $this->options['parameters'] = $parameters; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Studio.V2.CreateExecutionOptions ' . $options . ']'; } } class ReadExecutionOptions extends Options { /** * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ public function __construct( \DateTime $dateCreatedFrom = null, \DateTime $dateCreatedTo = null ) { $this->options['dateCreatedFrom'] = $dateCreatedFrom; $this->options['dateCreatedTo'] = $dateCreatedTo; } /** * Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @return $this Fluent Builder */ public function setDateCreatedFrom(\DateTime $dateCreatedFrom): self { $this->options['dateCreatedFrom'] = $dateCreatedFrom; return $this; } /** * Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @return $this Fluent Builder */ public function setDateCreatedTo(\DateTime $dateCreatedTo): self { $this->options['dateCreatedTo'] = $dateCreatedTo; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Studio.V2.ReadExecutionOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionInstance.php 0000644 00000012407 15021223077 0017111 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStepList; use Twilio\Rest\Studio\V2\Flow\Execution\ExecutionContextList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $flowSid * @property string|null $contactChannelAddress * @property array|null $context * @property string $status * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class ExecutionInstance extends InstanceResource { protected $_steps; protected $_executionContext; /** * Initialize the ExecutionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Excecution's Flow. * @param string $sid The SID of the Execution resource to delete. */ public function __construct(Version $version, array $payload, string $flowSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'contactChannelAddress' => Values::array_get($payload, 'contact_channel_address'), 'context' => Values::array_get($payload, 'context'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['flowSid' => $flowSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ExecutionContext Context for this ExecutionInstance */ protected function proxy(): ExecutionContext { if (!$this->context) { $this->context = new ExecutionContext( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ExecutionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ExecutionInstance * * @return ExecutionInstance Fetched ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionInstance { return $this->proxy()->fetch(); } /** * Update the ExecutionInstance * * @param string $status * @return ExecutionInstance Updated ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): ExecutionInstance { return $this->proxy()->update($status); } /** * Access the steps */ protected function getSteps(): ExecutionStepList { return $this->proxy()->steps; } /** * Access the executionContext */ protected function getExecutionContext(): ExecutionContextList { return $this->proxy()->executionContext; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.ExecutionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserInstance.php 0000644 00000007202 15021223077 0017551 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $sid * @property string[]|null $testUsers * @property string|null $url */ class FlowTestUserInstance extends InstanceResource { /** * Initialize the FlowTestUserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid Unique identifier of the flow. */ public function __construct(Version $version, array $payload, string $sid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'testUsers' => Values::array_get($payload, 'test_users'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FlowTestUserContext Context for this FlowTestUserInstance */ protected function proxy(): FlowTestUserContext { if (!$this->context) { $this->context = new FlowTestUserContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Fetch the FlowTestUserInstance * * @return FlowTestUserInstance Fetched FlowTestUserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlowTestUserInstance { return $this->proxy()->fetch(); } /** * Update the FlowTestUserInstance * * @param string[] $testUsers List of test user identities that can test draft versions of the flow. * @return FlowTestUserInstance Updated FlowTestUserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $testUsers): FlowTestUserInstance { return $this->proxy()->update($testUsers); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.FlowTestUserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionList.php 0000644 00000012627 15021223077 0016747 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class FlowRevisionList extends ListResource { /** * Construct the FlowRevisionList * * @param Version $version Version that contains the resource * @param string $sid The SID of the Flow resource to fetch. */ public function __construct( Version $version, string $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($sid) .'/Revisions'; } /** * Reads FlowRevisionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FlowRevisionInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams FlowRevisionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FlowRevisionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FlowRevisionPage Page of FlowRevisionInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FlowRevisionPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FlowRevisionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FlowRevisionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FlowRevisionPage Page of FlowRevisionInstance */ public function getPage(string $targetUrl): FlowRevisionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FlowRevisionPage($this->version, $response, $this->solution); } /** * Constructs a FlowRevisionContext * * @param string $revision Specific Revision number or can be `LatestPublished` and `LatestRevision`. */ public function getContext( string $revision ): FlowRevisionContext { return new FlowRevisionContext( $this->version, $this->solution['sid'], $revision ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.FlowRevisionList]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionList.php 0000644 00000015756 15021223077 0016272 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ExecutionList extends ListResource { /** * Construct the ExecutionList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Excecution's Flow. */ public function __construct( Version $version, string $flowSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions'; } /** * Create the ExecutionInstance * * @param string $to The Contact phone number to start a Studio Flow Execution, available as variable `{{contact.channel.address}}`. * @param string $from The Twilio phone number to send messages or initiate calls from during the Flow's Execution. Available as variable `{{flow.channel.address}}`. For SMS, this can also be a Messaging Service SID. * @param array|Options $options Optional Arguments * @return ExecutionInstance Created ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $to, string $from, array $options = []): ExecutionInstance { $options = new Values($options); $data = Values::of([ 'To' => $to, 'From' => $from, 'Parameters' => Serialize::jsonObject($options['parameters']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ExecutionInstance( $this->version, $payload, $this->solution['flowSid'] ); } /** * Reads ExecutionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ExecutionInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ExecutionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ExecutionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ExecutionPage Page of ExecutionInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ExecutionPage { $options = new Values($options); $params = Values::of([ 'DateCreatedFrom' => Serialize::iso8601DateTime($options['dateCreatedFrom']), 'DateCreatedTo' => Serialize::iso8601DateTime($options['dateCreatedTo']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ExecutionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ExecutionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ExecutionPage Page of ExecutionInstance */ public function getPage(string $targetUrl): ExecutionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ExecutionPage($this->version, $response, $this->solution); } /** * Constructs a ExecutionContext * * @param string $sid The SID of the Execution resource to delete. */ public function getContext( string $sid ): ExecutionContext { return new ExecutionContext( $this->version, $this->solution['flowSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.ExecutionList]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextInstance.php 0000644 00000007331 15021223077 0022421 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property array|null $context * @property string|null $flowSid * @property string|null $executionSid * @property string|null $url */ class ExecutionContextInstance extends InstanceResource { /** * Initialize the ExecutionContextInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow with the Execution context to fetch. * @param string $executionSid The SID of the Execution context to fetch. */ public function __construct(Version $version, array $payload, string $flowSid, string $executionSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'context' => Values::array_get($payload, 'context'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'executionSid' => Values::array_get($payload, 'execution_sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ExecutionContextContext Context for this ExecutionContextInstance */ protected function proxy(): ExecutionContextContext { if (!$this->context) { $this->context = new ExecutionContextContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'] ); } return $this->context; } /** * Fetch the ExecutionContextInstance * * @return ExecutionContextInstance Fetched ExecutionContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionContextInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.ExecutionContextInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepList.php 0000644 00000013300 15021223077 0021050 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ExecutionStepList extends ListResource { /** * Construct the ExecutionStepList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $executionSid The SID of the Execution resource with the Step to fetch. */ public function __construct( Version $version, string $flowSid, string $executionSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'executionSid' => $executionSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions/' . \rawurlencode($executionSid) .'/Steps'; } /** * Reads ExecutionStepInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ExecutionStepInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ExecutionStepInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ExecutionStepInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ExecutionStepPage Page of ExecutionStepInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ExecutionStepPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ExecutionStepPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ExecutionStepInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ExecutionStepPage Page of ExecutionStepInstance */ public function getPage(string $targetUrl): ExecutionStepPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ExecutionStepPage($this->version, $response, $this->solution); } /** * Constructs a ExecutionStepContext * * @param string $sid The SID of the ExecutionStep resource to fetch. */ public function getContext( string $sid ): ExecutionStepContext { return new ExecutionStepContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.ExecutionStepList]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php 0000644 00000010011 15021223077 0026041 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property array|null $context * @property string|null $executionSid * @property string|null $flowSid * @property string|null $stepSid * @property string|null $url */ class ExecutionStepContextInstance extends InstanceResource { /** * Initialize the ExecutionStepContextInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $executionSid The SID of the Execution resource with the Step to fetch. * @param string $stepSid The SID of the Step to fetch. */ public function __construct(Version $version, array $payload, string $flowSid, string $executionSid, string $stepSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'context' => Values::array_get($payload, 'context'), 'executionSid' => Values::array_get($payload, 'execution_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'stepSid' => Values::array_get($payload, 'step_sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, 'stepSid' => $stepSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ExecutionStepContextContext Context for this ExecutionStepContextInstance */ protected function proxy(): ExecutionStepContextContext { if (!$this->context) { $this->context = new ExecutionStepContextContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid'] ); } return $this->context; } /** * Fetch the ExecutionStepContextInstance * * @return ExecutionStepContextInstance Fetched ExecutionStepContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionStepContextInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.ExecutionStepContextInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php 0000644 00000005075 15021223077 0025737 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class ExecutionStepContextContext extends InstanceContext { /** * Initialize the ExecutionStepContextContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $executionSid The SID of the Execution resource with the Step to fetch. * @param string $stepSid The SID of the Step to fetch. */ public function __construct( Version $version, $flowSid, $executionSid, $stepSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'executionSid' => $executionSid, 'stepSid' => $stepSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions/' . \rawurlencode($executionSid) .'/Steps/' . \rawurlencode($stepSid) .'/Context'; } /** * Fetch the ExecutionStepContextInstance * * @return ExecutionStepContextInstance Fetched ExecutionStepContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionStepContextInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionStepContextInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.ExecutionStepContextContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php 0000644 00000003353 15021223077 0025164 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionStepContextPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ExecutionStepContextInstance \Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep\ExecutionStepContextInstance */ public function buildInstance(array $payload): ExecutionStepContextInstance { return new ExecutionStepContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.ExecutionStepContextPage]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextList.php 0000644 00000004006 15021223077 0025217 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep; use Twilio\ListResource; use Twilio\Version; class ExecutionStepContextList extends ListResource { /** * Construct the ExecutionStepContextList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $executionSid The SID of the Execution resource with the Step to fetch. * @param string $stepSid The SID of the Step to fetch. */ public function __construct( Version $version, string $flowSid, string $executionSid, string $stepSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'executionSid' => $executionSid, 'stepSid' => $stepSid, ]; } /** * Constructs a ExecutionStepContextContext */ public function getContext( ): ExecutionStepContextContext { return new ExecutionStepContextContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.ExecutionStepContextList]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepPage.php 0000644 00000003211 15021223077 0021011 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionStepPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ExecutionStepInstance \Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStepInstance */ public function buildInstance(array $payload): ExecutionStepInstance { return new ExecutionStepInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.ExecutionStepPage]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepInstance.php 0000644 00000011664 15021223077 0021714 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep\ExecutionStepContextList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $flowSid * @property string|null $executionSid * @property string|null $name * @property array|null $context * @property string|null $transitionedFrom * @property string|null $transitionedTo * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class ExecutionStepInstance extends InstanceResource { protected $_stepContext; /** * Initialize the ExecutionStepInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $executionSid The SID of the Execution resource with the Step to fetch. * @param string $sid The SID of the ExecutionStep resource to fetch. */ public function __construct(Version $version, array $payload, string $flowSid, string $executionSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'executionSid' => Values::array_get($payload, 'execution_sid'), 'name' => Values::array_get($payload, 'name'), 'context' => Values::array_get($payload, 'context'), 'transitionedFrom' => Values::array_get($payload, 'transitioned_from'), 'transitionedTo' => Values::array_get($payload, 'transitioned_to'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ExecutionStepContext Context for this ExecutionStepInstance */ protected function proxy(): ExecutionStepContext { if (!$this->context) { $this->context = new ExecutionStepContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the ExecutionStepInstance * * @return ExecutionStepInstance Fetched ExecutionStepInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionStepInstance { return $this->proxy()->fetch(); } /** * Access the stepContext */ protected function getStepContext(): ExecutionStepContextList { return $this->proxy()->stepContext; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.ExecutionStepInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextContext.php 0000644 00000004477 15021223077 0022311 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class ExecutionContextContext extends InstanceContext { /** * Initialize the ExecutionContextContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Execution context to fetch. * @param string $executionSid The SID of the Execution context to fetch. */ public function __construct( Version $version, $flowSid, $executionSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'executionSid' => $executionSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions/' . \rawurlencode($executionSid) .'/Context'; } /** * Fetch the ExecutionContextInstance * * @return ExecutionContextInstance Fetched ExecutionContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionContextInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionContextInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.ExecutionContextContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextPage.php 0000644 00000003233 15021223077 0021526 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionContextPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ExecutionContextInstance \Twilio\Rest\Studio\V2\Flow\Execution\ExecutionContextInstance */ public function buildInstance(array $payload): ExecutionContextInstance { return new ExecutionContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.ExecutionContextPage]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextList.php 0000644 00000003455 15021223077 0021573 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\ListResource; use Twilio\Version; class ExecutionContextList extends ListResource { /** * Construct the ExecutionContextList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Execution context to fetch. * @param string $executionSid The SID of the Execution context to fetch. */ public function __construct( Version $version, string $flowSid, string $executionSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'executionSid' => $executionSid, ]; } /** * Constructs a ExecutionContextContext */ public function getContext( ): ExecutionContextContext { return new ExecutionContextContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.ExecutionContextList]'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepContext.php 0000644 00000010505 15021223077 0021565 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep\ExecutionStepContextList; /** * @property ExecutionStepContextList $stepContext * @method \Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep\ExecutionStepContextContext stepContext() */ class ExecutionStepContext extends InstanceContext { protected $_stepContext; /** * Initialize the ExecutionStepContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $executionSid The SID of the Execution resource with the Step to fetch. * @param string $sid The SID of the ExecutionStep resource to fetch. */ public function __construct( Version $version, $flowSid, $executionSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'executionSid' => $executionSid, 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions/' . \rawurlencode($executionSid) .'/Steps/' . \rawurlencode($sid) .''; } /** * Fetch the ExecutionStepInstance * * @return ExecutionStepInstance Fetched ExecutionStepInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionStepInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionStepInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['sid'] ); } /** * Access the stepContext */ protected function getStepContext(): ExecutionStepContextList { if (!$this->_stepContext) { $this->_stepContext = new ExecutionStepContextList( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['sid'] ); } return $this->_stepContext; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.ExecutionStepContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowTestUserContext.php 0000644 00000005346 15021223077 0017440 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class FlowTestUserContext extends InstanceContext { /** * Initialize the FlowTestUserContext * * @param Version $version Version that contains the resource * @param string $sid Unique identifier of the flow. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($sid) .'/TestUsers'; } /** * Fetch the FlowTestUserInstance * * @return FlowTestUserInstance Fetched FlowTestUserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlowTestUserInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new FlowTestUserInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the FlowTestUserInstance * * @param string[] $testUsers List of test user identities that can test draft versions of the flow. * @return FlowTestUserInstance Updated FlowTestUserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $testUsers): FlowTestUserInstance { $data = Values::of([ 'TestUsers' => Serialize::map($testUsers,function ($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FlowTestUserInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.FlowTestUserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionInstance.php 0000644 00000010711 15021223077 0017570 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property array|null $definition * @property string $status * @property int|null $revision * @property string|null $commitMessage * @property bool|null $valid * @property array[]|null $errors * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class FlowRevisionInstance extends InstanceResource { /** * Initialize the FlowRevisionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Flow resource to fetch. * @param string $revision Specific Revision number or can be `LatestPublished` and `LatestRevision`. */ public function __construct(Version $version, array $payload, string $sid, string $revision = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'definition' => Values::array_get($payload, 'definition'), 'status' => Values::array_get($payload, 'status'), 'revision' => Values::array_get($payload, 'revision'), 'commitMessage' => Values::array_get($payload, 'commit_message'), 'valid' => Values::array_get($payload, 'valid'), 'errors' => Values::array_get($payload, 'errors'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid, 'revision' => $revision ?: $this->properties['revision'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FlowRevisionContext Context for this FlowRevisionInstance */ protected function proxy(): FlowRevisionContext { if (!$this->context) { $this->context = new FlowRevisionContext( $this->version, $this->solution['sid'], $this->solution['revision'] ); } return $this->context; } /** * Fetch the FlowRevisionInstance * * @return FlowRevisionInstance Fetched FlowRevisionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlowRevisionInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.FlowRevisionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/ExecutionContext.php 0000644 00000012647 15021223077 0016777 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStepList; use Twilio\Rest\Studio\V2\Flow\Execution\ExecutionContextList; /** * @property ExecutionStepList $steps * @property ExecutionContextList $executionContext * @method \Twilio\Rest\Studio\V2\Flow\Execution\ExecutionContextContext executionContext() * @method \Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStepContext steps(string $sid) */ class ExecutionContext extends InstanceContext { protected $_steps; protected $_executionContext; /** * Initialize the ExecutionContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Excecution's Flow. * @param string $sid The SID of the Execution resource to delete. */ public function __construct( Version $version, $flowSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions/' . \rawurlencode($sid) .''; } /** * Delete the ExecutionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ExecutionInstance * * @return ExecutionInstance Fetched ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['sid'] ); } /** * Update the ExecutionInstance * * @param string $status * @return ExecutionInstance Updated ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): ExecutionInstance { $data = Values::of([ 'Status' => $status, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ExecutionInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['sid'] ); } /** * Access the steps */ protected function getSteps(): ExecutionStepList { if (!$this->_steps) { $this->_steps = new ExecutionStepList( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->_steps; } /** * Access the executionContext */ protected function getExecutionContext(): ExecutionContextList { if (!$this->_executionContext) { $this->_executionContext = new ExecutionContextList( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->_executionContext; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.ExecutionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/Flow/FlowRevisionContext.php 0000644 00000004352 15021223077 0017454 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2\Flow; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class FlowRevisionContext extends InstanceContext { /** * Initialize the FlowRevisionContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Flow resource to fetch. * @param string $revision Specific Revision number or can be `LatestPublished` and `LatestRevision`. */ public function __construct( Version $version, $sid, $revision ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, 'revision' => $revision, ]; $this->uri = '/Flows/' . \rawurlencode($sid) .'/Revisions/' . \rawurlencode($revision) .''; } /** * Fetch the FlowRevisionInstance * * @return FlowRevisionInstance Fetched FlowRevisionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlowRevisionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new FlowRevisionInstance( $this->version, $payload, $this->solution['sid'], $this->solution['revision'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V2.FlowRevisionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V2/FlowValidatePage.php 0000644 00000003050 15021223077 0015722 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FlowValidatePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FlowValidateInstance \Twilio\Rest\Studio\V2\FlowValidateInstance */ public function buildInstance(array $payload): FlowValidateInstance { return new FlowValidateInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.FlowValidatePage]'; } } sdk/src/Twilio/Rest/Studio/V2/FlowValidateList.php 0000644 00000004537 15021223077 0015774 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class FlowValidateList extends ListResource { /** * Construct the FlowValidateList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Flows/Validate'; } /** * Update the FlowValidateInstance * * @param string $friendlyName The string that you assigned to describe the Flow. * @param string $status * @param array $definition JSON representation of flow definition. * @param array|Options $options Optional Arguments * @return FlowValidateInstance Updated FlowValidateInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName, string $status, array $definition, array $options = []): FlowValidateInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Status' => $status, 'Definition' => Serialize::jsonObject($definition), 'CommitMessage' => $options['commitMessage'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new FlowValidateInstance( $this->version, $payload ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.FlowValidateList]'; } } sdk/src/Twilio/Rest/Studio/V2/FlowList.php 0000644 00000014144 15021223077 0014315 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class FlowList extends ListResource { /** * Construct the FlowList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Flows'; } /** * Create the FlowInstance * * @param string $friendlyName The string that you assigned to describe the Flow. * @param string $status * @param array $definition JSON representation of flow definition. * @param array|Options $options Optional Arguments * @return FlowInstance Created FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $status, array $definition, array $options = []): FlowInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $friendlyName, 'Status' => $status, 'Definition' => Serialize::jsonObject($definition), 'CommitMessage' => $options['commitMessage'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new FlowInstance( $this->version, $payload ); } /** * Reads FlowInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FlowInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams FlowInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FlowInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FlowPage Page of FlowInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FlowPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FlowPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FlowInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FlowPage Page of FlowInstance */ public function getPage(string $targetUrl): FlowPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FlowPage($this->version, $response, $this->solution); } /** * Constructs a FlowContext * * @param string $sid The SID of the Flow resource to delete. */ public function getContext( string $sid ): FlowContext { return new FlowContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2.FlowList]'; } } sdk/src/Twilio/Rest/Studio/V2.php 0000644 00000005543 15021223077 0012555 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Studio\V2\FlowList; use Twilio\Rest\Studio\V2\FlowValidateList; use Twilio\Version; /** * @property FlowList $flows * @property FlowValidateList $flowValidate * @method \Twilio\Rest\Studio\V2\FlowContext flows(string $sid) */ class V2 extends Version { protected $_flows; protected $_flowValidate; /** * Construct the V2 version of Studio * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v2'; } protected function getFlows(): FlowList { if (!$this->_flows) { $this->_flows = new FlowList($this); } return $this->_flows; } protected function getFlowValidate(): FlowValidateList { if (!$this->_flowValidate) { $this->_flowValidate = new FlowValidateList($this); } return $this->_flowValidate; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V2]'; } } sdk/src/Twilio/Rest/Studio/V1/FlowPage.php 0000644 00000002770 15021223077 0014257 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class FlowPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return FlowInstance \Twilio\Rest\Studio\V1\FlowInstance */ public function buildInstance(array $payload): FlowInstance { return new FlowInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.FlowPage]'; } } sdk/src/Twilio/Rest/Studio/V1/FlowInstance.php 0000644 00000011072 15021223077 0015142 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Studio\V1\Flow\EngagementList; use Twilio\Rest\Studio\V1\Flow\ExecutionList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string $status * @property int|null $version * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class FlowInstance extends InstanceResource { protected $_engagements; protected $_executions; /** * Initialize the FlowInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Flow resource to delete. */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'version' => Values::array_get($payload, 'version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return FlowContext Context for this FlowInstance */ protected function proxy(): FlowContext { if (!$this->context) { $this->context = new FlowContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the FlowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the FlowInstance * * @return FlowInstance Fetched FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlowInstance { return $this->proxy()->fetch(); } /** * Access the engagements */ protected function getEngagements(): EngagementList { return $this->proxy()->engagements; } /** * Access the executions */ protected function getExecutions(): ExecutionList { return $this->proxy()->executions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.FlowInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/FlowContext.php 0000644 00000010561 15021223077 0015024 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Studio\V1\Flow\EngagementList; use Twilio\Rest\Studio\V1\Flow\ExecutionList; /** * @property EngagementList $engagements * @property ExecutionList $executions * @method \Twilio\Rest\Studio\V1\Flow\ExecutionContext executions(string $sid) * @method \Twilio\Rest\Studio\V1\Flow\EngagementContext engagements(string $sid) */ class FlowContext extends InstanceContext { protected $_engagements; protected $_executions; /** * Initialize the FlowContext * * @param Version $version Version that contains the resource * @param string $sid The SID of the Flow resource to delete. */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($sid) .''; } /** * Delete the FlowInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the FlowInstance * * @return FlowInstance Fetched FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): FlowInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new FlowInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the engagements */ protected function getEngagements(): EngagementList { if (!$this->_engagements) { $this->_engagements = new EngagementList( $this->version, $this->solution['sid'] ); } return $this->_engagements; } /** * Access the executions */ protected function getExecutions(): ExecutionList { if (!$this->_executions) { $this->_executions = new ExecutionList( $this->version, $this->solution['sid'] ); } return $this->_executions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.FlowContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionPage.php 0000644 00000003074 15021223077 0016220 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ExecutionInstance \Twilio\Rest\Studio\V1\Flow\ExecutionInstance */ public function buildInstance(array $payload): ExecutionInstance { return new ExecutionInstance($this->version, $payload, $this->solution['flowSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.ExecutionPage]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionOptions.php 0000644 00000014576 15021223077 0017010 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Options; use Twilio\Values; abstract class ExecutionOptions { /** * @param array $parameters JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. * @return CreateExecutionOptions Options builder */ public static function create( array $parameters = Values::ARRAY_NONE ): CreateExecutionOptions { return new CreateExecutionOptions( $parameters ); } /** * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @return ReadExecutionOptions Options builder */ public static function read( \DateTime $dateCreatedFrom = null, \DateTime $dateCreatedTo = null ): ReadExecutionOptions { return new ReadExecutionOptions( $dateCreatedFrom, $dateCreatedTo ); } } class CreateExecutionOptions extends Options { /** * @param array $parameters JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. */ public function __construct( array $parameters = Values::ARRAY_NONE ) { $this->options['parameters'] = $parameters; } /** * JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. * * @param array $parameters JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. * @return $this Fluent Builder */ public function setParameters(array $parameters): self { $this->options['parameters'] = $parameters; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Studio.V1.CreateExecutionOptions ' . $options . ']'; } } class ReadExecutionOptions extends Options { /** * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. */ public function __construct( \DateTime $dateCreatedFrom = null, \DateTime $dateCreatedTo = null ) { $this->options['dateCreatedFrom'] = $dateCreatedFrom; $this->options['dateCreatedTo'] = $dateCreatedTo; } /** * Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @return $this Fluent Builder */ public function setDateCreatedFrom(\DateTime $dateCreatedFrom): self { $this->options['dateCreatedFrom'] = $dateCreatedFrom; return $this; } /** * Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * @return $this Fluent Builder */ public function setDateCreatedTo(\DateTime $dateCreatedTo): self { $this->options['dateCreatedTo'] = $dateCreatedTo; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Studio.V1.ReadExecutionOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionInstance.php 0000644 00000012564 15021223077 0017114 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepList; use Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $flowSid * @property string|null $contactSid * @property string|null $contactChannelAddress * @property array|null $context * @property string $status * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class ExecutionInstance extends InstanceResource { protected $_steps; protected $_executionContext; /** * Initialize the ExecutionInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Excecution's Flow. * @param string $sid The SID of the Execution resource to delete. */ public function __construct(Version $version, array $payload, string $flowSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'contactSid' => Values::array_get($payload, 'contact_sid'), 'contactChannelAddress' => Values::array_get($payload, 'contact_channel_address'), 'context' => Values::array_get($payload, 'context'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['flowSid' => $flowSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ExecutionContext Context for this ExecutionInstance */ protected function proxy(): ExecutionContext { if (!$this->context) { $this->context = new ExecutionContext( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ExecutionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ExecutionInstance * * @return ExecutionInstance Fetched ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionInstance { return $this->proxy()->fetch(); } /** * Update the ExecutionInstance * * @param string $status * @return ExecutionInstance Updated ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): ExecutionInstance { return $this->proxy()->update($status); } /** * Access the steps */ protected function getSteps(): ExecutionStepList { return $this->proxy()->steps; } /** * Access the executionContext */ protected function getExecutionContext(): ExecutionContextList { return $this->proxy()->executionContext; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementOptions.php 0000644 00000007006 15021223077 0017105 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Options; use Twilio\Values; abstract class EngagementOptions { /** * @param array $parameters A JSON string we will add to your flow's context and that you can access as variables inside your flow. For example, if you pass in `Parameters={'name':'Zeke'}` then inside a widget you can reference the variable `{{flow.data.name}}` which will return the string 'Zeke'. Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode your JSON string. * @return CreateEngagementOptions Options builder */ public static function create( array $parameters = Values::ARRAY_NONE ): CreateEngagementOptions { return new CreateEngagementOptions( $parameters ); } } class CreateEngagementOptions extends Options { /** * @param array $parameters A JSON string we will add to your flow's context and that you can access as variables inside your flow. For example, if you pass in `Parameters={'name':'Zeke'}` then inside a widget you can reference the variable `{{flow.data.name}}` which will return the string 'Zeke'. Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode your JSON string. */ public function __construct( array $parameters = Values::ARRAY_NONE ) { $this->options['parameters'] = $parameters; } /** * A JSON string we will add to your flow's context and that you can access as variables inside your flow. For example, if you pass in `Parameters={'name':'Zeke'}` then inside a widget you can reference the variable `{{flow.data.name}}` which will return the string 'Zeke'. Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode your JSON string. * * @param array $parameters A JSON string we will add to your flow's context and that you can access as variables inside your flow. For example, if you pass in `Parameters={'name':'Zeke'}` then inside a widget you can reference the variable `{{flow.data.name}}` which will return the string 'Zeke'. Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode your JSON string. * @return $this Fluent Builder */ public function setParameters(array $parameters): self { $this->options['parameters'] = $parameters; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Studio.V1.CreateEngagementOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepList.php 0000644 00000013014 15021223077 0017274 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class StepList extends ListResource { /** * Construct the StepList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $engagementSid The SID of the Engagement with the Step to fetch. */ public function __construct( Version $version, string $flowSid, string $engagementSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'engagementSid' => $engagementSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Engagements/' . \rawurlencode($engagementSid) .'/Steps'; } /** * Reads StepInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return StepInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams StepInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of StepInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return StepPage Page of StepInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): StepPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new StepPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of StepInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return StepPage Page of StepInstance */ public function getPage(string $targetUrl): StepPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new StepPage($this->version, $response, $this->solution); } /** * Constructs a StepContext * * @param string $sid The SID of the Step resource to fetch. */ public function getContext( string $sid ): StepContext { return new StepContext( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.StepList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextInstance.php 0000644 00000007271 15021223077 0022641 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property array|null $context * @property string|null $engagementSid * @property string|null $flowSid * @property string|null $url */ class EngagementContextInstance extends InstanceResource { /** * Initialize the EngagementContextInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow. * @param string $engagementSid The SID of the Engagement. */ public function __construct(Version $version, array $payload, string $flowSid, string $engagementSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'context' => Values::array_get($payload, 'context'), 'engagementSid' => Values::array_get($payload, 'engagement_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['flowSid' => $flowSid, 'engagementSid' => $engagementSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EngagementContextContext Context for this EngagementContextInstance */ protected function proxy(): EngagementContextContext { if (!$this->context) { $this->context = new EngagementContextContext( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'] ); } return $this->context; } /** * Fetch the EngagementContextInstance * * @return EngagementContextInstance Fetched EngagementContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EngagementContextInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.EngagementContextInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepInstance.php 0000644 00000011457 15021223077 0020136 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $flowSid * @property string|null $engagementSid * @property string|null $name * @property array|null $context * @property string|null $transitionedFrom * @property string|null $transitionedTo * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class StepInstance extends InstanceResource { protected $_stepContext; /** * Initialize the StepInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $engagementSid The SID of the Engagement with the Step to fetch. * @param string $sid The SID of the Step resource to fetch. */ public function __construct(Version $version, array $payload, string $flowSid, string $engagementSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'engagementSid' => Values::array_get($payload, 'engagement_sid'), 'name' => Values::array_get($payload, 'name'), 'context' => Values::array_get($payload, 'context'), 'transitionedFrom' => Values::array_get($payload, 'transitioned_from'), 'transitionedTo' => Values::array_get($payload, 'transitioned_to'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['flowSid' => $flowSid, 'engagementSid' => $engagementSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return StepContext Context for this StepInstance */ protected function proxy(): StepContext { if (!$this->context) { $this->context = new StepContext( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the StepInstance * * @return StepInstance Fetched StepInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): StepInstance { return $this->proxy()->fetch(); } /** * Access the stepContext */ protected function getStepContext(): StepContextList { return $this->proxy()->stepContext; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.StepInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php 0000644 00000010270 15021223077 0020006 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextList; /** * @property StepContextList $stepContext * @method \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextContext stepContext() */ class StepContext extends InstanceContext { protected $_stepContext; /** * Initialize the StepContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $engagementSid The SID of the Engagement with the Step to fetch. * @param string $sid The SID of the Step resource to fetch. */ public function __construct( Version $version, $flowSid, $engagementSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'engagementSid' => $engagementSid, 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Engagements/' . \rawurlencode($engagementSid) .'/Steps/' . \rawurlencode($sid) .''; } /** * Fetch the StepInstance * * @return StepInstance Fetched StepInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): StepInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new StepInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['sid'] ); } /** * Access the stepContext */ protected function getStepContext(): StepContextList { if (!$this->_stepContext) { $this->_stepContext = new StepContextList( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['sid'] ); } return $this->_stepContext; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.StepContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextPage.php 0000644 00000003246 15021223077 0021523 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Engagement\Step; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class StepContextPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return StepContextInstance \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextInstance */ public function buildInstance(array $payload): StepContextInstance { return new StepContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['stepSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.StepContextPage]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextInstance.php 0000644 00000007635 15021223077 0022421 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Engagement\Step; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property array|null $context * @property string|null $engagementSid * @property string|null $flowSid * @property string|null $stepSid * @property string|null $url */ class StepContextInstance extends InstanceResource { /** * Initialize the StepContextInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $engagementSid The SID of the Engagement with the Step to fetch. * @param string $stepSid The SID of the Step to fetch */ public function __construct(Version $version, array $payload, string $flowSid, string $engagementSid, string $stepSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'context' => Values::array_get($payload, 'context'), 'engagementSid' => Values::array_get($payload, 'engagement_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'stepSid' => Values::array_get($payload, 'step_sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['flowSid' => $flowSid, 'engagementSid' => $engagementSid, 'stepSid' => $stepSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return StepContextContext Context for this StepContextInstance */ protected function proxy(): StepContextContext { if (!$this->context) { $this->context = new StepContextContext( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['stepSid'] ); } return $this->context; } /** * Fetch the StepContextInstance * * @return StepContextInstance Fetched StepContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): StepContextInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.StepContextInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextContext.php 0000644 00000004753 15021223077 0022277 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Engagement\Step; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class StepContextContext extends InstanceContext { /** * Initialize the StepContextContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $engagementSid The SID of the Engagement with the Step to fetch. * @param string $stepSid The SID of the Step to fetch */ public function __construct( Version $version, $flowSid, $engagementSid, $stepSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'engagementSid' => $engagementSid, 'stepSid' => $stepSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Engagements/' . \rawurlencode($engagementSid) .'/Steps/' . \rawurlencode($stepSid) .'/Context'; } /** * Fetch the StepContextInstance * * @return StepContextInstance Fetched StepContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): StepContextInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new StepContextInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['stepSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.StepContextContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextList.php 0000644 00000003704 15021223077 0021561 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Engagement\Step; use Twilio\ListResource; use Twilio\Version; class StepContextList extends ListResource { /** * Construct the StepContextList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $engagementSid The SID of the Engagement with the Step to fetch. * @param string $stepSid The SID of the Step to fetch */ public function __construct( Version $version, string $flowSid, string $engagementSid, string $stepSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'engagementSid' => $engagementSid, 'stepSid' => $stepSid, ]; } /** * Constructs a StepContextContext */ public function getContext( ): StepContextContext { return new StepContextContext( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['stepSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.StepContextList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextContext.php 0000644 00000004433 15021223077 0022516 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class EngagementContextContext extends InstanceContext { /** * Initialize the EngagementContextContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow. * @param string $engagementSid The SID of the Engagement. */ public function __construct( Version $version, $flowSid, $engagementSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'engagementSid' => $engagementSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Engagements/' . \rawurlencode($engagementSid) .'/Context'; } /** * Fetch the EngagementContextInstance * * @return EngagementContextInstance Fetched EngagementContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EngagementContextInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new EngagementContextInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.EngagementContextContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextList.php 0000644 00000003405 15021223077 0022003 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\ListResource; use Twilio\Version; class EngagementContextList extends ListResource { /** * Construct the EngagementContextList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow. * @param string $engagementSid The SID of the Engagement. */ public function __construct( Version $version, string $flowSid, string $engagementSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'engagementSid' => $engagementSid, ]; } /** * Constructs a EngagementContextContext */ public function getContext( ): EngagementContextContext { return new EngagementContextContext( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.EngagementContextList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepPage.php 0000644 00000003126 15021223077 0017240 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class StepPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return StepInstance \Twilio\Rest\Studio\V1\Flow\Engagement\StepInstance */ public function buildInstance(array $payload): StepInstance { return new StepInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.StepPage]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextPage.php 0000644 00000003244 15021223077 0021745 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EngagementContextPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return EngagementContextInstance \Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextInstance */ public function buildInstance(array $payload): EngagementContextInstance { return new EngagementContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.EngagementContextPage]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionList.php 0000644 00000015756 15021223077 0016271 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ExecutionList extends ListResource { /** * Construct the ExecutionList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Excecution's Flow. */ public function __construct( Version $version, string $flowSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions'; } /** * Create the ExecutionInstance * * @param string $to The Contact phone number to start a Studio Flow Execution, available as variable `{{contact.channel.address}}`. * @param string $from The Twilio phone number to send messages or initiate calls from during the Flow's Execution. Available as variable `{{flow.channel.address}}`. For SMS, this can also be a Messaging Service SID. * @param array|Options $options Optional Arguments * @return ExecutionInstance Created ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $to, string $from, array $options = []): ExecutionInstance { $options = new Values($options); $data = Values::of([ 'To' => $to, 'From' => $from, 'Parameters' => Serialize::jsonObject($options['parameters']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ExecutionInstance( $this->version, $payload, $this->solution['flowSid'] ); } /** * Reads ExecutionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ExecutionInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ExecutionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ExecutionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ExecutionPage Page of ExecutionInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ExecutionPage { $options = new Values($options); $params = Values::of([ 'DateCreatedFrom' => Serialize::iso8601DateTime($options['dateCreatedFrom']), 'DateCreatedTo' => Serialize::iso8601DateTime($options['dateCreatedTo']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ExecutionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ExecutionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ExecutionPage Page of ExecutionInstance */ public function getPage(string $targetUrl): ExecutionPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ExecutionPage($this->version, $response, $this->solution); } /** * Constructs a ExecutionContext * * @param string $sid The SID of the Execution resource to delete. */ public function getContext( string $sid ): ExecutionContext { return new ExecutionContext( $this->version, $this->solution['flowSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.ExecutionList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementContext.php 0000644 00000011410 15021223077 0017070 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Studio\V1\Flow\Engagement\StepList; use Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextList; /** * @property StepList $steps * @property EngagementContextList $engagementContext * @method \Twilio\Rest\Studio\V1\Flow\Engagement\StepContext steps(string $sid) * @method \Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextContext engagementContext() */ class EngagementContext extends InstanceContext { protected $_steps; protected $_engagementContext; /** * Initialize the EngagementContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow. * @param string $sid The SID of the Engagement resource to delete. */ public function __construct( Version $version, $flowSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Engagements/' . \rawurlencode($sid) .''; } /** * Delete the EngagementInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the EngagementInstance * * @return EngagementInstance Fetched EngagementInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EngagementInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new EngagementInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['sid'] ); } /** * Access the steps */ protected function getSteps(): StepList { if (!$this->_steps) { $this->_steps = new StepList( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->_steps; } /** * Access the engagementContext */ protected function getEngagementContext(): EngagementContextList { if (!$this->_engagementContext) { $this->_engagementContext = new EngagementContextList( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->_engagementContext; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.EngagementContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextInstance.php 0000644 00000007331 15021223077 0022420 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property array|null $context * @property string|null $flowSid * @property string|null $executionSid * @property string|null $url */ class ExecutionContextInstance extends InstanceResource { /** * Initialize the ExecutionContextInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow with the Execution context to fetch. * @param string $executionSid The SID of the Execution context to fetch. */ public function __construct(Version $version, array $payload, string $flowSid, string $executionSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'context' => Values::array_get($payload, 'context'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'executionSid' => Values::array_get($payload, 'execution_sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ExecutionContextContext Context for this ExecutionContextInstance */ protected function proxy(): ExecutionContextContext { if (!$this->context) { $this->context = new ExecutionContextContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'] ); } return $this->context; } /** * Fetch the ExecutionContextInstance * * @return ExecutionContextInstance Fetched ExecutionContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionContextInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionContextInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepList.php 0000644 00000013300 15021223077 0021047 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ExecutionStepList extends ListResource { /** * Construct the ExecutionStepList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $executionSid The SID of the Execution resource with the Step to fetch. */ public function __construct( Version $version, string $flowSid, string $executionSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'executionSid' => $executionSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions/' . \rawurlencode($executionSid) .'/Steps'; } /** * Reads ExecutionStepInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ExecutionStepInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ExecutionStepInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ExecutionStepInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ExecutionStepPage Page of ExecutionStepInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ExecutionStepPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ExecutionStepPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ExecutionStepInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ExecutionStepPage Page of ExecutionStepInstance */ public function getPage(string $targetUrl): ExecutionStepPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ExecutionStepPage($this->version, $response, $this->solution); } /** * Constructs a ExecutionStepContext * * @param string $sid The SID of the ExecutionStep resource to fetch. */ public function getContext( string $sid ): ExecutionStepContext { return new ExecutionStepContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.ExecutionStepList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php 0000644 00000010011 15021223077 0026040 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property array|null $context * @property string|null $executionSid * @property string|null $flowSid * @property string|null $stepSid * @property string|null $url */ class ExecutionStepContextInstance extends InstanceResource { /** * Initialize the ExecutionStepContextInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $executionSid The SID of the Execution resource with the Step to fetch. * @param string $stepSid The SID of the Step to fetch. */ public function __construct(Version $version, array $payload, string $flowSid, string $executionSid, string $stepSid) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'context' => Values::array_get($payload, 'context'), 'executionSid' => Values::array_get($payload, 'execution_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'stepSid' => Values::array_get($payload, 'step_sid'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, 'stepSid' => $stepSid, ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ExecutionStepContextContext Context for this ExecutionStepContextInstance */ protected function proxy(): ExecutionStepContextContext { if (!$this->context) { $this->context = new ExecutionStepContextContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid'] ); } return $this->context; } /** * Fetch the ExecutionStepContextInstance * * @return ExecutionStepContextInstance Fetched ExecutionStepContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionStepContextInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionStepContextInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php 0000644 00000005075 15021223077 0025736 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class ExecutionStepContextContext extends InstanceContext { /** * Initialize the ExecutionStepContextContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $executionSid The SID of the Execution resource with the Step to fetch. * @param string $stepSid The SID of the Step to fetch. */ public function __construct( Version $version, $flowSid, $executionSid, $stepSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'executionSid' => $executionSid, 'stepSid' => $stepSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions/' . \rawurlencode($executionSid) .'/Steps/' . \rawurlencode($stepSid) .'/Context'; } /** * Fetch the ExecutionStepContextInstance * * @return ExecutionStepContextInstance Fetched ExecutionStepContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionStepContextInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionStepContextInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionStepContextContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php 0000644 00000003353 15021223077 0025163 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionStepContextPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ExecutionStepContextInstance \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextInstance */ public function buildInstance(array $payload): ExecutionStepContextInstance { return new ExecutionStepContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.ExecutionStepContextPage]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextList.php 0000644 00000004006 15021223077 0025216 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep; use Twilio\ListResource; use Twilio\Version; class ExecutionStepContextList extends ListResource { /** * Construct the ExecutionStepContextList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $executionSid The SID of the Execution resource with the Step to fetch. * @param string $stepSid The SID of the Step to fetch. */ public function __construct( Version $version, string $flowSid, string $executionSid, string $stepSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'executionSid' => $executionSid, 'stepSid' => $stepSid, ]; } /** * Constructs a ExecutionStepContextContext */ public function getContext( ): ExecutionStepContextContext { return new ExecutionStepContextContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.ExecutionStepContextList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepPage.php 0000644 00000003211 15021223077 0021010 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionStepPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ExecutionStepInstance \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepInstance */ public function buildInstance(array $payload): ExecutionStepInstance { return new ExecutionStepInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.ExecutionStepPage]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepInstance.php 0000644 00000011664 15021223077 0021713 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $flowSid * @property string|null $executionSid * @property string|null $name * @property array|null $context * @property string|null $transitionedFrom * @property string|null $transitionedTo * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class ExecutionStepInstance extends InstanceResource { protected $_stepContext; /** * Initialize the ExecutionStepInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $executionSid The SID of the Execution resource with the Step to fetch. * @param string $sid The SID of the ExecutionStep resource to fetch. */ public function __construct(Version $version, array $payload, string $flowSid, string $executionSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'executionSid' => Values::array_get($payload, 'execution_sid'), 'name' => Values::array_get($payload, 'name'), 'context' => Values::array_get($payload, 'context'), 'transitionedFrom' => Values::array_get($payload, 'transitioned_from'), 'transitionedTo' => Values::array_get($payload, 'transitioned_to'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ExecutionStepContext Context for this ExecutionStepInstance */ protected function proxy(): ExecutionStepContext { if (!$this->context) { $this->context = new ExecutionStepContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the ExecutionStepInstance * * @return ExecutionStepInstance Fetched ExecutionStepInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionStepInstance { return $this->proxy()->fetch(); } /** * Access the stepContext */ protected function getStepContext(): ExecutionStepContextList { return $this->proxy()->stepContext; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionStepInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextContext.php 0000644 00000004477 15021223077 0022310 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class ExecutionContextContext extends InstanceContext { /** * Initialize the ExecutionContextContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Execution context to fetch. * @param string $executionSid The SID of the Execution context to fetch. */ public function __construct( Version $version, $flowSid, $executionSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'executionSid' => $executionSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions/' . \rawurlencode($executionSid) .'/Context'; } /** * Fetch the ExecutionContextInstance * * @return ExecutionContextInstance Fetched ExecutionContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionContextInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionContextInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionContextContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextPage.php 0000644 00000003233 15021223077 0021525 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ExecutionContextPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ExecutionContextInstance \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextInstance */ public function buildInstance(array $payload): ExecutionContextInstance { return new ExecutionContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.ExecutionContextPage]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextList.php 0000644 00000003455 15021223077 0021572 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\ListResource; use Twilio\Version; class ExecutionContextList extends ListResource { /** * Construct the ExecutionContextList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Execution context to fetch. * @param string $executionSid The SID of the Execution context to fetch. */ public function __construct( Version $version, string $flowSid, string $executionSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'executionSid' => $executionSid, ]; } /** * Constructs a ExecutionContextContext */ public function getContext( ): ExecutionContextContext { return new ExecutionContextContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.ExecutionContextList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepContext.php 0000644 00000010505 15021223077 0021564 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextList; /** * @property ExecutionStepContextList $stepContext * @method \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextContext stepContext() */ class ExecutionStepContext extends InstanceContext { protected $_stepContext; /** * Initialize the ExecutionStepContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow with the Step to fetch. * @param string $executionSid The SID of the Execution resource with the Step to fetch. * @param string $sid The SID of the ExecutionStep resource to fetch. */ public function __construct( Version $version, $flowSid, $executionSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'executionSid' => $executionSid, 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions/' . \rawurlencode($executionSid) .'/Steps/' . \rawurlencode($sid) .''; } /** * Fetch the ExecutionStepInstance * * @return ExecutionStepInstance Fetched ExecutionStepInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionStepInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionStepInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['sid'] ); } /** * Access the stepContext */ protected function getStepContext(): ExecutionStepContextList { if (!$this->_stepContext) { $this->_stepContext = new ExecutionStepContextList( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['sid'] ); } return $this->_stepContext; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionStepContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementInstance.php 0000644 00000012041 15021223077 0017211 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\Studio\V1\Flow\Engagement\StepList; use Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $flowSid * @property string|null $contactSid * @property string|null $contactChannelAddress * @property array|null $context * @property string $status * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url * @property array|null $links */ class EngagementInstance extends InstanceResource { protected $_steps; protected $_engagementContext; /** * Initialize the EngagementInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow. * @param string $sid The SID of the Engagement resource to delete. */ public function __construct(Version $version, array $payload, string $flowSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'contactSid' => Values::array_get($payload, 'contact_sid'), 'contactChannelAddress' => Values::array_get($payload, 'contact_channel_address'), 'context' => Values::array_get($payload, 'context'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['flowSid' => $flowSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return EngagementContext Context for this EngagementInstance */ protected function proxy(): EngagementContext { if (!$this->context) { $this->context = new EngagementContext( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the EngagementInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the EngagementInstance * * @return EngagementInstance Fetched EngagementInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): EngagementInstance { return $this->proxy()->fetch(); } /** * Access the steps */ protected function getSteps(): StepList { return $this->proxy()->steps; } /** * Access the engagementContext */ protected function getEngagementContext(): EngagementContextList { return $this->proxy()->engagementContext; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.EngagementInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionContext.php 0000644 00000012647 15021223077 0016776 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepList; use Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextList; /** * @property ExecutionStepList $steps * @property ExecutionContextList $executionContext * @method \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextContext executionContext() * @method \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepContext steps(string $sid) */ class ExecutionContext extends InstanceContext { protected $_steps; protected $_executionContext; /** * Initialize the ExecutionContext * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Excecution's Flow. * @param string $sid The SID of the Execution resource to delete. */ public function __construct( Version $version, $flowSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, 'sid' => $sid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Executions/' . \rawurlencode($sid) .''; } /** * Delete the ExecutionInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ExecutionInstance * * @return ExecutionInstance Fetched ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ExecutionInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ExecutionInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['sid'] ); } /** * Update the ExecutionInstance * * @param string $status * @return ExecutionInstance Updated ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $status): ExecutionInstance { $data = Values::of([ 'Status' => $status, ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ExecutionInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['sid'] ); } /** * Access the steps */ protected function getSteps(): ExecutionStepList { if (!$this->_steps) { $this->_steps = new ExecutionStepList( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->_steps; } /** * Access the executionContext */ protected function getExecutionContext(): ExecutionContextList { if (!$this->_executionContext) { $this->_executionContext = new ExecutionContextList( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->_executionContext; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementList.php 0000644 00000015003 15021223077 0016361 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class EngagementList extends ListResource { /** * Construct the EngagementList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow. */ public function __construct( Version $version, string $flowSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'flowSid' => $flowSid, ]; $this->uri = '/Flows/' . \rawurlencode($flowSid) .'/Engagements'; } /** * Create the EngagementInstance * * @param string $to The Contact phone number to start a Studio Flow Engagement, available as variable `{{contact.channel.address}}`. * @param string $from The Twilio phone number to send messages or initiate calls from during the Flow Engagement. Available as variable `{{flow.channel.address}}` * @param array|Options $options Optional Arguments * @return EngagementInstance Created EngagementInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $to, string $from, array $options = []): EngagementInstance { $options = new Values($options); $data = Values::of([ 'To' => $to, 'From' => $from, 'Parameters' => Serialize::jsonObject($options['parameters']), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new EngagementInstance( $this->version, $payload, $this->solution['flowSid'] ); } /** * Reads EngagementInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EngagementInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams EngagementInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of EngagementInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return EngagementPage Page of EngagementInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): EngagementPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new EngagementPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EngagementInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return EngagementPage Page of EngagementInstance */ public function getPage(string $targetUrl): EngagementPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EngagementPage($this->version, $response, $this->solution); } /** * Constructs a EngagementContext * * @param string $sid The SID of the Engagement resource to delete. */ public function getContext( string $sid ): EngagementContext { return new EngagementContext( $this->version, $this->solution['flowSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.EngagementList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementPage.php 0000644 00000003102 15021223077 0016317 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class EngagementPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return EngagementInstance \Twilio\Rest\Studio\V1\Flow\EngagementInstance */ public function buildInstance(array $payload): EngagementInstance { return new EngagementInstance($this->version, $payload, $this->solution['flowSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.EngagementPage]'; } } sdk/src/Twilio/Rest/Studio/V1/FlowList.php 0000644 00000011765 15021223077 0014322 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio\V1; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class FlowList extends ListResource { /** * Construct the FlowList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Flows'; } /** * Reads FlowInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FlowInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams FlowInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of FlowInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return FlowPage Page of FlowInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): FlowPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new FlowPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FlowInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return FlowPage Page of FlowInstance */ public function getPage(string $targetUrl): FlowPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FlowPage($this->version, $response, $this->solution); } /** * Constructs a FlowContext * * @param string $sid The SID of the Flow resource to delete. */ public function getContext( string $sid ): FlowContext { return new FlowContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1.FlowList]'; } } sdk/src/Twilio/Rest/Studio/V1.php 0000644 00000005021 15021223077 0012543 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Studio * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\Studio; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Studio\V1\FlowList; use Twilio\Version; /** * @property FlowList $flows * @method \Twilio\Rest\Studio\V1\FlowContext flows(string $sid) */ class V1 extends Version { protected $_flows; /** * Construct the V1 version of Studio * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } protected function getFlows(): FlowList { if (!$this->_flows) { $this->_flows = new FlowList($this); } return $this->_flows; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.Studio.V1]'; } } sdk/src/Twilio/Rest/Video.php 0000644 00000007464 15021223077 0012071 0 ustar 00 <?php namespace Twilio\Rest; use Twilio\Rest\Video\V1; class Video extends VideoBase { /** * @deprecated Use v1->compositions instead. */ protected function getCompositions(): \Twilio\Rest\Video\V1\CompositionList { echo "compositions is deprecated. Use v1->compositions instead."; return $this->v1->compositions; } /** * @deprecated Use v1->compositions(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextCompositions(string $sid): \Twilio\Rest\Video\V1\CompositionContext { echo "compositions(\$sid) is deprecated. Use v1->compositions(\$sid) instead."; return $this->v1->compositions($sid); } /** * @deprecated Use v1->compositionHooks instead. */ protected function getCompositionHooks(): \Twilio\Rest\Video\V1\CompositionHookList { echo "compositionHooks is deprecated. Use v1->compositionHooks instead."; return $this->v1->compositionHooks; } /** * @deprecated Use v1->compositionHooks(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextCompositionHooks(string $sid): \Twilio\Rest\Video\V1\CompositionHookContext { echo "compositionHooks(\$sid) is deprecated. Use v1->compositionHooks(\$sid) instead."; return $this->v1->compositionHooks($sid); } /** * @deprecated Use v1->compositionSettings instead. */ protected function getCompositionSettings(): \Twilio\Rest\Video\V1\CompositionSettingsList { echo "compositionSettings is deprecated. Use v1->compositionSettings instead."; return $this->v1->compositionSettings; } /** * @deprecated Use v1->compositionSettings() instead. */ protected function contextCompositionSettings(): \Twilio\Rest\Video\V1\CompositionSettingsContext { echo "compositionSettings() is deprecated. Use v1->compositionSettings() instead."; return $this->v1->compositionSettings(); } /** * @deprecated Use v1->recordings instead. */ protected function getRecordings(): \Twilio\Rest\Video\V1\RecordingList { echo "recordings is deprecated. Use v1->recordings instead."; return $this->v1->recordings; } /** * @deprecated Use v1->recordings(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextRecordings(string $sid): \Twilio\Rest\Video\V1\RecordingContext { echo "recordings(\$sid) is deprecated. Use v1->recordings(\$sid) instead."; return $this->v1->recordings($sid); } /** * @deprecated Use v1->recordingSettings instead. */ protected function getRecordingSettings(): \Twilio\Rest\Video\V1\RecordingSettingsList { echo "recordingSettings is deprecated. Use v1->recordingSettings instead."; return $this->v1->recordingSettings; } /** * @deprecated Use v1->recordingSettings() instead. */ protected function contextRecordingSettings(): \Twilio\Rest\Video\V1\RecordingSettingsContext { echo "recordingSettings() is deprecated. Use v1->recordingSettings() instead."; return $this->v1->recordingSettings(); } /** * @deprecated Use v1->rooms instead. */ protected function getRooms(): \Twilio\Rest\Video\V1\RoomList { echo "rooms is deprecated. Use v1->rooms instead."; return $this->v1->rooms; } /** * @deprecated Use v1->rooms(\$sid) instead. * @param string $sid The SID that identifies the resource to fetch */ protected function contextRooms(string $sid): \Twilio\Rest\Video\V1\RoomContext { echo "rooms(\$sid) is deprecated. Use v1->rooms(\$sid) instead."; return $this->v1->rooms($sid); } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserOptions.php 0000644 00000014340 15021223077 0017401 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $roleSid * @param string $attributes * @param string $friendlyName * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateUserOptions Options builder */ public static function create( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateUserOptions { return new CreateUserOptions( $roleSid, $attributes, $friendlyName, $xTwilioWebhookEnabled ); } /** * @param string $roleSid * @param string $attributes * @param string $friendlyName * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateUserOptions Options builder */ public static function update( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateUserOptions { return new UpdateUserOptions( $roleSid, $attributes, $friendlyName, $xTwilioWebhookEnabled ); } } class CreateUserOptions extends Options { /** * @param string $roleSid * @param string $attributes * @param string $friendlyName * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.CreateUserOptions ' . $options . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid * @param string $attributes * @param string $friendlyName * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserContext.php 0000644 00000013267 15021223077 0017401 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\IpMessaging\V2\Service\User\UserBindingList; use Twilio\Rest\IpMessaging\V2\Service\User\UserChannelList; /** * @property UserBindingList $userBindings * @property UserChannelList $userChannels * @method \Twilio\Rest\IpMessaging\V2\Service\User\UserChannelContext userChannels(string $channelSid) * @method \Twilio\Rest\IpMessaging\V2\Service\User\UserBindingContext userBindings(string $sid) */ class UserContext extends InstanceContext { protected $_userBindings; protected $_userChannels; /** * Initialize the UserContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($sid) .''; } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the userBindings */ protected function getUserBindings(): UserBindingList { if (!$this->_userBindings) { $this->_userBindings = new UserBindingList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userBindings; } /** * Access the userChannels */ protected function getUserChannels(): UserChannelList { if (!$this->_userChannels) { $this->_userChannels = new UserChannelList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userChannels; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingPage.php 0000644 00000003116 15021223077 0017255 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class BindingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return BindingInstance \Twilio\Rest\IpMessaging\V2\Service\BindingInstance */ public function buildInstance(array $payload): BindingInstance { return new BindingInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.BindingPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingInstance.php 0000644 00000011141 15021223077 0020142 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $endpoint * @property string|null $identity * @property string|null $credentialSid * @property string $bindingType * @property string[]|null $messageTypes * @property string|null $url * @property array|null $links */ class BindingInstance extends InstanceResource { /** * Initialize the BindingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endpoint' => Values::array_get($payload, 'endpoint'), 'identity' => Values::array_get($payload, 'identity'), 'credentialSid' => Values::array_get($payload, 'credential_sid'), 'bindingType' => Values::array_get($payload, 'binding_type'), 'messageTypes' => Values::array_get($payload, 'message_types'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return BindingContext Context for this BindingInstance */ protected function proxy(): BindingContext { if (!$this->context) { $this->context = new BindingContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the BindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.BindingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleInstance.php 0000644 00000011073 15021223077 0017475 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $friendlyName * @property string $type * @property string[]|null $permissions * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoleContext Context for this RoleInstance */ protected function proxy(): RoleContext { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * Update the RoleInstance * * @param string[] $permission * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelPage.php 0000644 00000003116 15021223077 0017253 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ChannelInstance \Twilio\Rest\IpMessaging\V2\Service\ChannelInstance */ public function buildInstance(array $payload): ChannelInstance { return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.ChannelPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleContext.php 0000644 00000006064 15021223077 0017361 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Roles/' . \rawurlencode($sid) .''; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the RoleInstance * * @param string[] $permission * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of([ 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.RoleContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelList.php 0000644 00000015514 15021223077 0017317 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels'; } /** * Create the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Created ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ChannelInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'Type' => $options['type'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'CreatedBy' => $options['createdBy'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads ChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ChannelPage Page of ChannelInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ChannelPage { $options = new Values($options); $params = Values::of([ 'Type' => $options['type'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ChannelPage Page of ChannelInstance */ public function getPage(string $targetUrl): ChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelPage($this->version, $response, $this->solution); } /** * Constructs a ChannelContext * * @param string $sid */ public function getContext( string $sid ): ChannelContext { return new ChannelContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.ChannelList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/RolePage.php 0000644 00000003074 15021223077 0016607 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RolePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RoleInstance \Twilio\Rest\IpMessaging\V2\Service\RoleInstance */ public function buildInstance(array $payload): RoleInstance { return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.RolePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelContext.php 0000644 00000016365 15021223077 0020035 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\IpMessaging\V2\Service\Channel\MemberList; use Twilio\Rest\IpMessaging\V2\Service\Channel\InviteList; use Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookList; use Twilio\Rest\IpMessaging\V2\Service\Channel\MessageList; /** * @property MemberList $members * @property InviteList $invites * @property WebhookList $webhooks * @property MessageList $messages * @method \Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookContext webhooks(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\Channel\MemberContext members(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\Channel\MessageContext messages(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\Channel\InviteContext invites(string $sid) */ class ChannelContext extends InstanceContext { protected $_members; protected $_invites; protected $_webhooks; protected $_messages; /** * Initialize the ChannelContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($sid) .''; } /** * Delete the ChannelInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'CreatedBy' => $options['createdBy'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the members */ protected function getMembers(): MemberList { if (!$this->_members) { $this->_members = new MemberList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_members; } /** * Access the invites */ protected function getInvites(): InviteList { if (!$this->_invites) { $this->_invites = new InviteList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_invites; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_webhooks; } /** * Access the messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.ChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageInstance.php 0000644 00000013006 15021223077 0021526 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $attributes * @property string|null $serviceSid * @property string|null $to * @property string|null $channelSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $lastUpdatedBy * @property bool|null $wasEdited * @property string|null $from * @property string|null $body * @property int|null $index * @property string|null $type * @property array|null $media * @property string|null $url */ class MessageInstance extends InstanceResource { /** * Initialize the MessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $channelSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'to' => Values::array_get($payload, 'to'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'lastUpdatedBy' => Values::array_get($payload, 'last_updated_by'), 'wasEdited' => Values::array_get($payload, 'was_edited'), 'from' => Values::array_get($payload, 'from'), 'body' => Values::array_get($payload, 'body'), 'index' => Values::array_get($payload, 'index'), 'type' => Values::array_get($payload, 'type'), 'media' => Values::array_get($payload, 'media'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessageContext Context for this MessageInstance */ protected function proxy(): MessageContext { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookInstance.php 0000644 00000011436 15021223077 0021545 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $channelSid * @property string|null $type * @property string|null $url * @property array|null $configuration * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $channelSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'type' => Values::array_get($payload, 'type'), 'url' => Values::array_get($payload, 'url'), 'configuration' => Values::array_get($payload, 'configuration'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return WebhookContext Context for this WebhookInstance */ protected function proxy(): WebhookContext { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageContext.php 0000644 00000010141 15021223077 0021403 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class MessageContext extends InstanceContext { /** * Initialize the MessageContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $channelSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $channelSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Messages/' . \rawurlencode($sid) .''; } /** * Delete the MessageInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Body' => $options['body'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'LastUpdatedBy' => $options['lastUpdatedBy'], 'From' => $options['from'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberInstance.php 0000644 00000012421 15021223077 0021351 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $channelSid * @property string|null $serviceSid * @property string|null $identity * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $roleSid * @property int|null $lastConsumedMessageIndex * @property \DateTime|null $lastConsumptionTimestamp * @property string|null $url * @property string|null $attributes */ class MemberInstance extends InstanceResource { /** * Initialize the MemberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $channelSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), 'url' => Values::array_get($payload, 'url'), 'attributes' => Values::array_get($payload, 'attributes'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MemberContext Context for this MemberInstance */ protected function proxy(): MemberContext { if (!$this->context) { $this->context = new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MemberInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { return $this->proxy()->fetch(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.MemberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberContext.php 0000644 00000010262 15021223077 0021232 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class MemberContext extends InstanceContext { /** * Initialize the MemberContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $channelSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $channelSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members/' . \rawurlencode($sid) .''; } /** * Delete the MemberInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { $options = new Values($options); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); return $this->version->delete('DELETE', $this->uri, [], [], $headers); } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->update('POST', $this->uri, [], $data, $headers); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.MemberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookContext.php 0000644 00000007670 15021223077 0021432 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $channelSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $channelSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Webhooks/' . \rawurlencode($sid) .''; } /** * Delete the WebhookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): WebhookInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function ($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.RetryCount' => $options['configurationRetryCount'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.WebhookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberOptions.php 0000644 00000030315 15021223077 0021242 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $roleSid * @param int $lastConsumedMessageIndex * @param \DateTime $lastConsumptionTimestamp * @param \DateTime $dateCreated * @param \DateTime $dateUpdated * @param string $attributes * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateMemberOptions Options builder */ public static function create( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE, \DateTime $lastConsumptionTimestamp = null, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateMemberOptions { return new CreateMemberOptions( $roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated, $attributes, $xTwilioWebhookEnabled ); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return DeleteMemberOptions Options builder */ public static function delete( string $xTwilioWebhookEnabled = Values::NONE ): DeleteMemberOptions { return new DeleteMemberOptions( $xTwilioWebhookEnabled ); } /** * @param string[] $identity * @return ReadMemberOptions Options builder */ public static function read( array $identity = Values::ARRAY_NONE ): ReadMemberOptions { return new ReadMemberOptions( $identity ); } /** * @param string $roleSid * @param int $lastConsumedMessageIndex * @param \DateTime $lastConsumptionTimestamp * @param \DateTime $dateCreated * @param \DateTime $dateUpdated * @param string $attributes * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateMemberOptions Options builder */ public static function update( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE, \DateTime $lastConsumptionTimestamp = null, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateMemberOptions { return new UpdateMemberOptions( $roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated, $attributes, $xTwilioWebhookEnabled ); } } class CreateMemberOptions extends Options { /** * @param string $roleSid * @param int $lastConsumedMessageIndex * @param \DateTime $lastConsumptionTimestamp * @param \DateTime $dateCreated * @param \DateTime $dateUpdated * @param string $attributes * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE, \DateTime $lastConsumptionTimestamp = null, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * * * @param int $lastConsumedMessageIndex * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * * * @param \DateTime $lastConsumptionTimestamp * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * * * @param \DateTime $dateCreated * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * * * @param \DateTime $dateUpdated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.CreateMemberOptions ' . $options . ']'; } } class DeleteMemberOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.DeleteMemberOptions ' . $options . ']'; } } class ReadMemberOptions extends Options { /** * @param string[] $identity */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * * * @param string[] $identity * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.ReadMemberOptions ' . $options . ']'; } } class UpdateMemberOptions extends Options { /** * @param string $roleSid * @param int $lastConsumedMessageIndex * @param \DateTime $lastConsumptionTimestamp * @param \DateTime $dateCreated * @param \DateTime $dateUpdated * @param string $attributes * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE, \DateTime $lastConsumptionTimestamp = null, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $attributes = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * * * @param int $lastConsumedMessageIndex * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * * * @param \DateTime $lastConsumptionTimestamp * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * * * @param \DateTime $dateCreated * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * * * @param \DateTime $dateUpdated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateMemberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookOptions.php 0000644 00000021641 15021223077 0021433 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class WebhookOptions { /** * @param string $configurationUrl * @param string $configurationMethod * @param string[] $configurationFilters * @param string[] $configurationTriggers * @param string $configurationFlowSid * @param int $configurationRetryCount * @return CreateWebhookOptions Options builder */ public static function create( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationRetryCount = Values::INT_NONE ): CreateWebhookOptions { return new CreateWebhookOptions( $configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationRetryCount ); } /** * @param string $configurationUrl * @param string $configurationMethod * @param string[] $configurationFilters * @param string[] $configurationTriggers * @param string $configurationFlowSid * @param int $configurationRetryCount * @return UpdateWebhookOptions Options builder */ public static function update( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationRetryCount = Values::INT_NONE ): UpdateWebhookOptions { return new UpdateWebhookOptions( $configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationRetryCount ); } } class CreateWebhookOptions extends Options { /** * @param string $configurationUrl * @param string $configurationMethod * @param string[] $configurationFilters * @param string[] $configurationTriggers * @param string $configurationFlowSid * @param int $configurationRetryCount */ public function __construct( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationRetryCount = Values::INT_NONE ) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; } /** * * * @param string $configurationUrl * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * * * @param string[] $configurationFilters * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * * * @param string[] $configurationTriggers * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * * * @param string $configurationFlowSid * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * * * @param int $configurationRetryCount * @return $this Fluent Builder */ public function setConfigurationRetryCount(int $configurationRetryCount): self { $this->options['configurationRetryCount'] = $configurationRetryCount; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.CreateWebhookOptions ' . $options . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $configurationUrl * @param string $configurationMethod * @param string[] $configurationFilters * @param string[] $configurationTriggers * @param string $configurationFlowSid * @param int $configurationRetryCount */ public function __construct( string $configurationUrl = Values::NONE, string $configurationMethod = Values::NONE, array $configurationFilters = Values::ARRAY_NONE, array $configurationTriggers = Values::ARRAY_NONE, string $configurationFlowSid = Values::NONE, int $configurationRetryCount = Values::INT_NONE ) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; } /** * * * @param string $configurationUrl * @return $this Fluent Builder */ public function setConfigurationUrl(string $configurationUrl): self { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * @param string $configurationMethod * @return $this Fluent Builder */ public function setConfigurationMethod(string $configurationMethod): self { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * * * @param string[] $configurationFilters * @return $this Fluent Builder */ public function setConfigurationFilters(array $configurationFilters): self { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * * * @param string[] $configurationTriggers * @return $this Fluent Builder */ public function setConfigurationTriggers(array $configurationTriggers): self { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * * * @param string $configurationFlowSid * @return $this Fluent Builder */ public function setConfigurationFlowSid(string $configurationFlowSid): self { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * * * @param int $configurationRetryCount * @return $this Fluent Builder */ public function setConfigurationRetryCount(int $configurationRetryCount): self { $this->options['configurationRetryCount'] = $configurationRetryCount; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateWebhookOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteList.php 0000644 00000015234 15021223077 0020554 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class InviteList extends ListResource { /** * Construct the InviteList * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $channelSid */ public function __construct( Version $version, string $serviceSid, string $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites'; } /** * Create the InviteInstance * * @param string $identity * @param array|Options $options Optional Arguments * @return InviteInstance Created InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): InviteInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads InviteInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InviteInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InvitePage Page of InviteInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InvitePage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InvitePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InviteInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InvitePage Page of InviteInstance */ public function getPage(string $targetUrl): InvitePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InvitePage($this->version, $response, $this->solution); } /** * Constructs a InviteContext * * @param string $sid */ public function getContext( string $sid ): InviteContext { return new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.InviteList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookPage.php 0000644 00000003175 15021223077 0020656 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class WebhookPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return WebhookInstance \Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookInstance */ public function buildInstance(array $payload): WebhookInstance { return new WebhookInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.WebhookPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteContext.php 0000644 00000005126 15021223077 0021264 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class InviteContext extends InstanceContext { /** * Initialize the InviteContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $channelSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $channelSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites/' . \rawurlencode($sid) .''; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.InviteContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteInstance.php 0000644 00000011002 15021223077 0021372 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $channelSid * @property string|null $serviceSid * @property string|null $identity * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $roleSid * @property string|null $createdBy * @property string|null $url */ class InviteInstance extends InstanceResource { /** * Initialize the InviteInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $channelSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'createdBy' => Values::array_get($payload, 'created_by'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InviteContext Context for this InviteInstance */ protected function proxy(): InviteContext { if (!$this->context) { $this->context = new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.InviteInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookList.php 0000644 00000015564 15021223077 0020722 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $channelSid */ public function __construct( Version $version, string $serviceSid, string $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Webhooks'; } /** * Create the WebhookInstance * * @param string $type * @param array|Options $options Optional Arguments * @return WebhookInstance Created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): WebhookInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function ($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.RetryCount' => $options['configurationRetryCount'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return WebhookPage Page of WebhookInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): WebhookPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return WebhookPage Page of WebhookInstance */ public function getPage(string $targetUrl): WebhookPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Constructs a WebhookContext * * @param string $sid */ public function getContext( string $sid ): WebhookContext { return new WebhookContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.WebhookList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteOptions.php 0000644 00000005431 15021223077 0021272 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class InviteOptions { /** * @param string $roleSid * @return CreateInviteOptions Options builder */ public static function create( string $roleSid = Values::NONE ): CreateInviteOptions { return new CreateInviteOptions( $roleSid ); } /** * @param string[] $identity * @return ReadInviteOptions Options builder */ public static function read( array $identity = Values::ARRAY_NONE ): ReadInviteOptions { return new ReadInviteOptions( $identity ); } } class CreateInviteOptions extends Options { /** * @param string $roleSid */ public function __construct( string $roleSid = Values::NONE ) { $this->options['roleSid'] = $roleSid; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.CreateInviteOptions ' . $options . ']'; } } class ReadInviteOptions extends Options { /** * @param string[] $identity */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * * * @param string[] $identity * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.ReadInviteOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessagePage.php 0000644 00000003175 15021223077 0020644 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MessageInstance \Twilio\Rest\IpMessaging\V2\Service\Channel\MessageInstance */ public function buildInstance(array $payload): MessageInstance { return new MessageInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.MessagePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberPage.php 0000644 00000003167 15021223077 0020470 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MemberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MemberInstance \Twilio\Rest\IpMessaging\V2\Service\Channel\MemberInstance */ public function buildInstance(array $payload): MemberInstance { return new MemberInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.MemberPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberList.php 0000644 00000016355 15021223077 0020532 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class MemberList extends ListResource { /** * Construct the MemberList * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $channelSid */ public function __construct( Version $version, string $serviceSid, string $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members'; } /** * Create the MemberInstance * * @param string $identity * @param array|Options $options Optional Arguments * @return MemberInstance Created MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads MemberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MemberInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MemberPage Page of MemberInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MemberPage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MemberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MemberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MemberPage Page of MemberInstance */ public function getPage(string $targetUrl): MemberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MemberPage($this->version, $response, $this->solution); } /** * Constructs a MemberContext * * @param string $sid */ public function getContext( string $sid ): MemberContext { return new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.MemberList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InvitePage.php 0000644 00000003167 15021223077 0020517 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class InvitePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return InviteInstance \Twilio\Rest\IpMessaging\V2\Service\Channel\InviteInstance */ public function buildInstance(array $payload): InviteInstance { return new InviteInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.InvitePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageOptions.php 0000644 00000027526 15021223077 0021431 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $from * @param string $attributes * @param \DateTime $dateCreated * @param \DateTime $dateUpdated * @param string $lastUpdatedBy * @param string $body * @param string $mediaSid * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateMessageOptions Options builder */ public static function create( string $from = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $lastUpdatedBy = Values::NONE, string $body = Values::NONE, string $mediaSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateMessageOptions { return new CreateMessageOptions( $from, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy, $body, $mediaSid, $xTwilioWebhookEnabled ); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return DeleteMessageOptions Options builder */ public static function delete( string $xTwilioWebhookEnabled = Values::NONE ): DeleteMessageOptions { return new DeleteMessageOptions( $xTwilioWebhookEnabled ); } /** * @param string $order * @return ReadMessageOptions Options builder */ public static function read( string $order = Values::NONE ): ReadMessageOptions { return new ReadMessageOptions( $order ); } /** * @param string $body * @param string $attributes * @param \DateTime $dateCreated * @param \DateTime $dateUpdated * @param string $lastUpdatedBy * @param string $from * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateMessageOptions Options builder */ public static function update( string $body = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $lastUpdatedBy = Values::NONE, string $from = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateMessageOptions { return new UpdateMessageOptions( $body, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy, $from, $xTwilioWebhookEnabled ); } } class CreateMessageOptions extends Options { /** * @param string $from * @param string $attributes * @param \DateTime $dateCreated * @param \DateTime $dateUpdated * @param string $lastUpdatedBy * @param string $body * @param string $mediaSid * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $from = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $lastUpdatedBy = Values::NONE, string $body = Values::NONE, string $mediaSid = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['from'] = $from; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; $this->options['body'] = $body; $this->options['mediaSid'] = $mediaSid; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $from * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * * * @param \DateTime $dateCreated * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * * * @param \DateTime $dateUpdated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * * * @param string $lastUpdatedBy * @return $this Fluent Builder */ public function setLastUpdatedBy(string $lastUpdatedBy): self { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * * * @param string $body * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * * * @param string $mediaSid * @return $this Fluent Builder */ public function setMediaSid(string $mediaSid): self { $this->options['mediaSid'] = $mediaSid; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.CreateMessageOptions ' . $options . ']'; } } class DeleteMessageOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.DeleteMessageOptions ' . $options . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order */ public function __construct( string $order = Values::NONE ) { $this->options['order'] = $order; } /** * * * @param string $order * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.ReadMessageOptions ' . $options . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $body * @param string $attributes * @param \DateTime $dateCreated * @param \DateTime $dateUpdated * @param string $lastUpdatedBy * @param string $from * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $body = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $lastUpdatedBy = Values::NONE, string $from = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; $this->options['from'] = $from; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $body * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * * * @param \DateTime $dateCreated * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * * * @param \DateTime $dateUpdated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * * * @param string $lastUpdatedBy * @return $this Fluent Builder */ public function setLastUpdatedBy(string $lastUpdatedBy): self { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * * * @param string $from * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateMessageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageList.php 0000644 00000016113 15021223077 0020677 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $channelSid */ public function __construct( Version $version, string $serviceSid, string $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Messages'; } /** * Create the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'From' => $options['from'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'LastUpdatedBy' => $options['lastUpdatedBy'], 'Body' => $options['body'], 'MediaSid' => $options['mediaSid'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagePage Page of MessageInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagePage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagePage Page of MessageInstance */ public function getPage(string $targetUrl): MessagePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid */ public function getContext( string $sid ): MessageContext { return new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.MessageList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingList.php 0000644 00000013312 15021223077 0017313 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class BindingList extends ListResource { /** * Construct the BindingList * * @param Version $version Version that contains the resource * @param string $serviceSid */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Bindings'; } /** * Reads BindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BindingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams BindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of BindingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return BindingPage Page of BindingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): BindingPage { $options = new Values($options); $params = Values::of([ 'BindingType' => $options['bindingType'], 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new BindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return BindingPage Page of BindingInstance */ public function getPage(string $targetUrl): BindingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BindingPage($this->version, $response, $this->solution); } /** * Constructs a BindingContext * * @param string $sid */ public function getContext( string $sid ): BindingContext { return new BindingContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.BindingList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelOptions.php 0000644 00000027771 15021223077 0020047 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $friendlyName * @param string $uniqueName * @param string $attributes * @param string $type * @param \DateTime $dateCreated * @param \DateTime $dateUpdated * @param string $createdBy * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return CreateChannelOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $type = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): CreateChannelOptions { return new CreateChannelOptions( $friendlyName, $uniqueName, $attributes, $type, $dateCreated, $dateUpdated, $createdBy, $xTwilioWebhookEnabled ); } /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return DeleteChannelOptions Options builder */ public static function delete( string $xTwilioWebhookEnabled = Values::NONE ): DeleteChannelOptions { return new DeleteChannelOptions( $xTwilioWebhookEnabled ); } /** * @param string $type * @return ReadChannelOptions Options builder */ public static function read( array $type = Values::ARRAY_NONE ): ReadChannelOptions { return new ReadChannelOptions( $type ); } /** * @param string $friendlyName * @param string $uniqueName * @param string $attributes * @param \DateTime $dateCreated * @param \DateTime $dateUpdated * @param string $createdBy * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return UpdateChannelOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ): UpdateChannelOptions { return new UpdateChannelOptions( $friendlyName, $uniqueName, $attributes, $dateCreated, $dateUpdated, $createdBy, $xTwilioWebhookEnabled ); } } class CreateChannelOptions extends Options { /** * @param string $friendlyName * @param string $uniqueName * @param string $attributes * @param string $type * @param \DateTime $dateCreated * @param \DateTime $dateUpdated * @param string $createdBy * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $type = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * @param string $type * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * * * @param \DateTime $dateCreated * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * * * @param \DateTime $dateUpdated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * * * @param string $createdBy * @return $this Fluent Builder */ public function setCreatedBy(string $createdBy): self { $this->options['createdBy'] = $createdBy; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.CreateChannelOptions ' . $options . ']'; } } class DeleteChannelOptions extends Options { /** * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.DeleteChannelOptions ' . $options . ']'; } } class ReadChannelOptions extends Options { /** * @param string $type */ public function __construct( array $type = Values::ARRAY_NONE ) { $this->options['type'] = $type; } /** * * * @param string $type * @return $this Fluent Builder */ public function setType(array $type): self { $this->options['type'] = $type; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.ReadChannelOptions ' . $options . ']'; } } class UpdateChannelOptions extends Options { /** * @param string $friendlyName * @param string $uniqueName * @param string $attributes * @param \DateTime $dateCreated * @param \DateTime $dateUpdated * @param string $createdBy * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header */ public function __construct( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, \DateTime $dateCreated = null, \DateTime $dateUpdated = null, string $createdBy = Values::NONE, string $xTwilioWebhookEnabled = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * * * @param \DateTime $dateCreated * @return $this Fluent Builder */ public function setDateCreated(\DateTime $dateCreated): self { $this->options['dateCreated'] = $dateCreated; return $this; } /** * * * @param \DateTime $dateUpdated * @return $this Fluent Builder */ public function setDateUpdated(\DateTime $dateUpdated): self { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * * * @param string $createdBy * @return $this Fluent Builder */ public function setCreatedBy(string $createdBy): self { $this->options['createdBy'] = $createdBy; return $this; } /** * The X-Twilio-Webhook-Enabled HTTP request header * * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header * @return $this Fluent Builder */ public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self { $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelInstance.php 0000644 00000014217 15021223077 0020147 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\IpMessaging\V2\Service\Channel\MemberList; use Twilio\Rest\IpMessaging\V2\Service\Channel\InviteList; use Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookList; use Twilio\Rest\IpMessaging\V2\Service\Channel\MessageList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $friendlyName * @property string|null $uniqueName * @property string|null $attributes * @property string $type * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $createdBy * @property int|null $membersCount * @property int|null $messagesCount * @property string|null $url * @property array|null $links */ class ChannelInstance extends InstanceResource { protected $_members; protected $_invites; protected $_webhooks; protected $_messages; /** * Initialize the ChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'type' => Values::array_get($payload, 'type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'membersCount' => Values::array_get($payload, 'members_count'), 'messagesCount' => Values::array_get($payload, 'messages_count'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ChannelContext Context for this ChannelInstance */ protected function proxy(): ChannelContext { if (!$this->context) { $this->context = new ChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the ChannelInstance * * @param array|Options $options Optional Arguments * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(array $options = []): bool { return $this->proxy()->delete($options); } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { return $this->proxy()->fetch(); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { return $this->proxy()->update($options); } /** * Access the members */ protected function getMembers(): MemberList { return $this->proxy()->members; } /** * Access the invites */ protected function getInvites(): InviteList { return $this->proxy()->invites; } /** * Access the webhooks */ protected function getWebhooks(): WebhookList { return $this->proxy()->webhooks; } /** * Access the messages */ protected function getMessages(): MessageList { return $this->proxy()->messages; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.ChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserPage.php 0000644 00000003074 15021223077 0016624 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserInstance \Twilio\Rest\IpMessaging\V2\Service\UserInstance */ public function buildInstance(array $payload): UserInstance { return new UserInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.UserPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingContext.php 0000644 00000004622 15021223077 0020030 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class BindingContext extends InstanceContext { /** * Initialize the BindingContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Bindings/' . \rawurlencode($sid) .''; } /** * Delete the BindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): BindingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new BindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.BindingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingList.php 0000644 00000013530 15021223077 0021072 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserBindingList extends ListResource { /** * Construct the UserBindingList * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $userSid */ public function __construct( Version $version, string $serviceSid, string $userSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Bindings'; } /** * Reads UserBindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserBindingInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams UserBindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserBindingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserBindingPage Page of UserBindingInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserBindingPage { $options = new Values($options); $params = Values::of([ 'BindingType' => $options['bindingType'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserBindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserBindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserBindingPage Page of UserBindingInstance */ public function getPage(string $targetUrl): UserBindingPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserBindingPage($this->version, $response, $this->solution); } /** * Constructs a UserBindingContext * * @param string $sid */ public function getContext( string $sid ): UserBindingContext { return new UserBindingContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.UserBindingList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelOptions.php 0000644 00000006116 15021223077 0021612 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Options; use Twilio\Values; abstract class UserChannelOptions { /** * @param string $notificationLevel * @param int $lastConsumedMessageIndex * @param \DateTime $lastConsumptionTimestamp * @return UpdateUserChannelOptions Options builder */ public static function update( string $notificationLevel = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE, \DateTime $lastConsumptionTimestamp = null ): UpdateUserChannelOptions { return new UpdateUserChannelOptions( $notificationLevel, $lastConsumedMessageIndex, $lastConsumptionTimestamp ); } } class UpdateUserChannelOptions extends Options { /** * @param string $notificationLevel * @param int $lastConsumedMessageIndex * @param \DateTime $lastConsumptionTimestamp */ public function __construct( string $notificationLevel = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE, \DateTime $lastConsumptionTimestamp = null ) { $this->options['notificationLevel'] = $notificationLevel; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; } /** * @param string $notificationLevel * @return $this Fluent Builder */ public function setNotificationLevel(string $notificationLevel): self { $this->options['notificationLevel'] = $notificationLevel; return $this; } /** * * * @param int $lastConsumedMessageIndex * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * * * @param \DateTime $lastConsumptionTimestamp * @return $this Fluent Builder */ public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateUserChannelOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingInstance.php 0000644 00000011421 15021223077 0021720 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $endpoint * @property string|null $identity * @property string|null $userSid * @property string|null $credentialSid * @property string $bindingType * @property string[]|null $messageTypes * @property string|null $url */ class UserBindingInstance extends InstanceResource { /** * Initialize the UserBindingInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $userSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $userSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endpoint' => Values::array_get($payload, 'endpoint'), 'identity' => Values::array_get($payload, 'identity'), 'userSid' => Values::array_get($payload, 'user_sid'), 'credentialSid' => Values::array_get($payload, 'credential_sid'), 'bindingType' => Values::array_get($payload, 'binding_type'), 'messageTypes' => Values::array_get($payload, 'message_types'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserBindingContext Context for this UserBindingInstance */ protected function proxy(): UserBindingContext { if (!$this->context) { $this->context = new UserBindingContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UserBindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserBindingInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserBindingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelPage.php 0000644 00000003214 15021223077 0021027 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserChannelInstance \Twilio\Rest\IpMessaging\V2\Service\User\UserChannelInstance */ public function buildInstance(array $payload): UserChannelInstance { return new UserChannelInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.UserChannelPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelContext.php 0000644 00000007304 15021223077 0021603 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class UserChannelContext extends InstanceContext { /** * Initialize the UserChannelContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $userSid * @param string $channelSid */ public function __construct( Version $version, $serviceSid, $userSid, $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Channels/' . \rawurlencode($channelSid) .''; } /** * Delete the UserChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the UserChannelInstance * * @return UserChannelInstance Fetched UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserChannelInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } /** * Update the UserChannelInstance * * @param array|Options $options Optional Arguments * @return UserChannelInstance Updated UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserChannelInstance { $options = new Values($options); $data = Values::of([ 'NotificationLevel' => $options['notificationLevel'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelInstance.php 0000644 00000012103 15021223077 0021714 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $channelSid * @property string|null $userSid * @property string|null $memberSid * @property string $status * @property int|null $lastConsumedMessageIndex * @property int|null $unreadMessagesCount * @property array|null $links * @property string|null $url * @property string $notificationLevel */ class UserChannelInstance extends InstanceResource { /** * Initialize the UserChannelInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $userSid * @param string $channelSid */ public function __construct(Version $version, array $payload, string $serviceSid, string $userSid, string $channelSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'userSid' => Values::array_get($payload, 'user_sid'), 'memberSid' => Values::array_get($payload, 'member_sid'), 'status' => Values::array_get($payload, 'status'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), 'notificationLevel' => Values::array_get($payload, 'notification_level'), ]; $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid ?: $this->properties['channelSid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserChannelContext Context for this UserChannelInstance */ protected function proxy(): UserChannelContext { if (!$this->context) { $this->context = new UserChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } return $this->context; } /** * Delete the UserChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserChannelInstance * * @return UserChannelInstance Fetched UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserChannelInstance { return $this->proxy()->fetch(); } /** * Update the UserChannelInstance * * @param array|Options $options Optional Arguments * @return UserChannelInstance Updated UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserChannelInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingContext.php 0000644 00000005154 15021223077 0021606 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class UserBindingContext extends InstanceContext { /** * Initialize the UserBindingContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $userSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $userSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Bindings/' . \rawurlencode($sid) .''; } /** * Delete the UserBindingInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserBindingInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserBindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserBindingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingOptions.php 0000644 00000003415 15021223077 0021613 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Options; use Twilio\Values; abstract class UserBindingOptions { /** * @param string $bindingType * @return ReadUserBindingOptions Options builder */ public static function read( array $bindingType = Values::ARRAY_NONE ): ReadUserBindingOptions { return new ReadUserBindingOptions( $bindingType ); } } class ReadUserBindingOptions extends Options { /** * @param string $bindingType */ public function __construct( array $bindingType = Values::ARRAY_NONE ) { $this->options['bindingType'] = $bindingType; } /** * * * @param string $bindingType * @return $this Fluent Builder */ public function setBindingType(array $bindingType): self { $this->options['bindingType'] = $bindingType; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.ReadUserBindingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelList.php 0000644 00000013037 15021223077 0021072 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserChannelList extends ListResource { /** * Construct the UserChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $userSid */ public function __construct( Version $version, string $serviceSid, string $userSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'userSid' => $userSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($userSid) .'/Channels'; } /** * Reads UserChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserChannelInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserChannelPage Page of UserChannelInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserChannelPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserChannelPage Page of UserChannelInstance */ public function getPage(string $targetUrl): UserChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserChannelPage($this->version, $response, $this->solution); } /** * Constructs a UserChannelContext * * @param string $channelSid */ public function getContext( string $channelSid ): UserChannelContext { return new UserChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $channelSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.UserChannelList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingPage.php 0000644 00000003214 15021223077 0021031 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class UserBindingPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return UserBindingInstance \Twilio\Rest\IpMessaging\V2\Service\User\UserBindingInstance */ public function buildInstance(array $payload): UserBindingInstance { return new UserBindingInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.UserBindingPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserList.php 0000644 00000014342 15021223077 0016663 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $serviceSid */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users'; } /** * Create the UserInstance * * @param string $identity * @param array|Options $options Optional Arguments * @return UserInstance Created UserInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], ]); $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); $payload = $this->version->create('POST', $this->uri, [], $data, $headers); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads UserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of UserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return UserPage Page of UserInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): UserPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new UserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return UserPage Page of UserInstance */ public function getPage(string $targetUrl): UserPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserPage($this->version, $response, $this->solution); } /** * Constructs a UserContext * * @param string $sid */ public function getContext( string $sid ): UserContext { return new UserContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.UserList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleList.php 0000644 00000014071 15021223077 0016645 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class RoleList extends ListResource { /** * Construct the RoleList * * @param Version $version Version that contains the resource * @param string $serviceSid */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Roles'; } /** * Create the RoleInstance * * @param string $friendlyName * @param string $type * @param string[] $permission * @return RoleInstance Created RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName, string $type, array $permission): RoleInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, 'Type' => $type, 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads RoleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoleInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of RoleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return RolePage Page of RoleInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): RolePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new RolePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return RolePage Page of RoleInstance */ public function getPage(string $targetUrl): RolePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RolePage($this->version, $response, $this->solution); } /** * Constructs a RoleContext * * @param string $sid */ public function getContext( string $sid ): RoleContext { return new RoleContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.RoleList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserInstance.php 0000644 00000013207 15021223077 0017513 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\IpMessaging\V2\Service\User\UserBindingList; use Twilio\Rest\IpMessaging\V2\Service\User\UserChannelList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $attributes * @property string|null $friendlyName * @property string|null $roleSid * @property string|null $identity * @property bool|null $isOnline * @property bool|null $isNotifiable * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property int|null $joinedChannelsCount * @property array|null $links * @property string|null $url */ class UserInstance extends InstanceResource { protected $_userBindings; protected $_userChannels; /** * Initialize the UserInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'identity' => Values::array_get($payload, 'identity'), 'isOnline' => Values::array_get($payload, 'is_online'), 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'joinedChannelsCount' => Values::array_get($payload, 'joined_channels_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return UserContext Context for this UserInstance */ protected function proxy(): UserContext { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { return $this->proxy()->fetch(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { return $this->proxy()->update($options); } /** * Access the userBindings */ protected function getUserBindings(): UserBindingList { return $this->proxy()->userBindings; } /** * Access the userChannels */ protected function getUserChannels(): UserChannelList { return $this->proxy()->userChannels; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingOptions.php 0000644 00000004306 15021223077 0020036 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Options; use Twilio\Values; abstract class BindingOptions { /** * @param string $bindingType * @param string[] $identity * @return ReadBindingOptions Options builder */ public static function read( array $bindingType = Values::ARRAY_NONE, array $identity = Values::ARRAY_NONE ): ReadBindingOptions { return new ReadBindingOptions( $bindingType, $identity ); } } class ReadBindingOptions extends Options { /** * @param string $bindingType * @param string[] $identity */ public function __construct( array $bindingType = Values::ARRAY_NONE, array $identity = Values::ARRAY_NONE ) { $this->options['bindingType'] = $bindingType; $this->options['identity'] = $identity; } /** * * * @param string $bindingType * @return $this Fluent Builder */ public function setBindingType(array $bindingType): self { $this->options['bindingType'] = $bindingType; return $this; } /** * * * @param string[] $identity * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.ReadBindingOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/ServiceInstance.php 0000644 00000016256 15021223077 0016604 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; use Twilio\Rest\IpMessaging\V2\Service\ChannelList; use Twilio\Rest\IpMessaging\V2\Service\BindingList; use Twilio\Rest\IpMessaging\V2\Service\RoleList; use Twilio\Rest\IpMessaging\V2\Service\UserList; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $defaultServiceRoleSid * @property string|null $defaultChannelRoleSid * @property string|null $defaultChannelCreatorRoleSid * @property bool|null $readStatusEnabled * @property bool|null $reachabilityEnabled * @property int|null $typingIndicatorTimeout * @property int|null $consumptionReportInterval * @property array|null $limits * @property string|null $preWebhookUrl * @property string|null $postWebhookUrl * @property string|null $webhookMethod * @property string[]|null $webhookFilters * @property int|null $preWebhookRetryCount * @property int|null $postWebhookRetryCount * @property array|null $notifications * @property array|null $media * @property string|null $url * @property array|null $links */ class ServiceInstance extends InstanceResource { protected $_channels; protected $_bindings; protected $_roles; protected $_users; /** * Initialize the ServiceInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'defaultServiceRoleSid' => Values::array_get($payload, 'default_service_role_sid'), 'defaultChannelRoleSid' => Values::array_get($payload, 'default_channel_role_sid'), 'defaultChannelCreatorRoleSid' => Values::array_get($payload, 'default_channel_creator_role_sid'), 'readStatusEnabled' => Values::array_get($payload, 'read_status_enabled'), 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), 'typingIndicatorTimeout' => Values::array_get($payload, 'typing_indicator_timeout'), 'consumptionReportInterval' => Values::array_get($payload, 'consumption_report_interval'), 'limits' => Values::array_get($payload, 'limits'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), 'preWebhookRetryCount' => Values::array_get($payload, 'pre_webhook_retry_count'), 'postWebhookRetryCount' => Values::array_get($payload, 'post_webhook_retry_count'), 'notifications' => Values::array_get($payload, 'notifications'), 'media' => Values::array_get($payload, 'media'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return ServiceContext Context for this ServiceInstance */ protected function proxy(): ServiceContext { if (!$this->context) { $this->context = new ServiceContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { return $this->proxy()->update($options); } /** * Access the channels */ protected function getChannels(): ChannelList { return $this->proxy()->channels; } /** * Access the bindings */ protected function getBindings(): BindingList { return $this->proxy()->bindings; } /** * Access the roles */ protected function getRoles(): RoleList { return $this->proxy()->roles; } /** * Access the users */ protected function getUsers(): UserList { return $this->proxy()->users; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/ServiceList.php 0000644 00000013162 15021223077 0015744 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Services'; } /** * Create the ServiceInstance * * @param string $friendlyName * @return ServiceInstance Created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $friendlyName): ServiceInstance { $data = Values::of([ 'FriendlyName' => $friendlyName, ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload ); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ServicePage Page of ServiceInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ServicePage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ServicePage Page of ServiceInstance */ public function getPage(string $targetUrl): ServicePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid */ public function getContext( string $sid ): ServiceContext { return new ServiceContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.ServiceList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/ServiceOptions.php 0000644 00000052620 15021223077 0016466 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param string $friendlyName * @param string $defaultServiceRoleSid * @param string $defaultChannelRoleSid * @param string $defaultChannelCreatorRoleSid * @param bool $readStatusEnabled * @param bool $reachabilityEnabled * @param int $typingIndicatorTimeout * @param int $consumptionReportInterval * @param bool $notificationsNewMessageEnabled * @param string $notificationsNewMessageTemplate * @param string $notificationsNewMessageSound * @param bool $notificationsNewMessageBadgeCountEnabled * @param bool $notificationsAddedToChannelEnabled * @param string $notificationsAddedToChannelTemplate * @param string $notificationsAddedToChannelSound * @param bool $notificationsRemovedFromChannelEnabled * @param string $notificationsRemovedFromChannelTemplate * @param string $notificationsRemovedFromChannelSound * @param bool $notificationsInvitedToChannelEnabled * @param string $notificationsInvitedToChannelTemplate * @param string $notificationsInvitedToChannelSound * @param string $preWebhookUrl * @param string $postWebhookUrl * @param string $webhookMethod * @param string[] $webhookFilters * @param int $limitsChannelMembers * @param int $limitsUserChannels * @param string $mediaCompatibilityMessage * @param int $preWebhookRetryCount * @param int $postWebhookRetryCount * @param bool $notificationsLogEnabled * @return UpdateServiceOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $defaultServiceRoleSid = Values::NONE, string $defaultChannelRoleSid = Values::NONE, string $defaultChannelCreatorRoleSid = Values::NONE, bool $readStatusEnabled = Values::BOOL_NONE, bool $reachabilityEnabled = Values::BOOL_NONE, int $typingIndicatorTimeout = Values::INT_NONE, int $consumptionReportInterval = Values::INT_NONE, bool $notificationsNewMessageEnabled = Values::BOOL_NONE, string $notificationsNewMessageTemplate = Values::NONE, string $notificationsNewMessageSound = Values::NONE, bool $notificationsNewMessageBadgeCountEnabled = Values::BOOL_NONE, bool $notificationsAddedToChannelEnabled = Values::BOOL_NONE, string $notificationsAddedToChannelTemplate = Values::NONE, string $notificationsAddedToChannelSound = Values::NONE, bool $notificationsRemovedFromChannelEnabled = Values::BOOL_NONE, string $notificationsRemovedFromChannelTemplate = Values::NONE, string $notificationsRemovedFromChannelSound = Values::NONE, bool $notificationsInvitedToChannelEnabled = Values::BOOL_NONE, string $notificationsInvitedToChannelTemplate = Values::NONE, string $notificationsInvitedToChannelSound = Values::NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $webhookMethod = Values::NONE, array $webhookFilters = Values::ARRAY_NONE, int $limitsChannelMembers = Values::INT_NONE, int $limitsUserChannels = Values::INT_NONE, string $mediaCompatibilityMessage = Values::NONE, int $preWebhookRetryCount = Values::INT_NONE, int $postWebhookRetryCount = Values::INT_NONE, bool $notificationsLogEnabled = Values::BOOL_NONE ): UpdateServiceOptions { return new UpdateServiceOptions( $friendlyName, $defaultServiceRoleSid, $defaultChannelRoleSid, $defaultChannelCreatorRoleSid, $readStatusEnabled, $reachabilityEnabled, $typingIndicatorTimeout, $consumptionReportInterval, $notificationsNewMessageEnabled, $notificationsNewMessageTemplate, $notificationsNewMessageSound, $notificationsNewMessageBadgeCountEnabled, $notificationsAddedToChannelEnabled, $notificationsAddedToChannelTemplate, $notificationsAddedToChannelSound, $notificationsRemovedFromChannelEnabled, $notificationsRemovedFromChannelTemplate, $notificationsRemovedFromChannelSound, $notificationsInvitedToChannelEnabled, $notificationsInvitedToChannelTemplate, $notificationsInvitedToChannelSound, $preWebhookUrl, $postWebhookUrl, $webhookMethod, $webhookFilters, $limitsChannelMembers, $limitsUserChannels, $mediaCompatibilityMessage, $preWebhookRetryCount, $postWebhookRetryCount, $notificationsLogEnabled ); } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName * @param string $defaultServiceRoleSid * @param string $defaultChannelRoleSid * @param string $defaultChannelCreatorRoleSid * @param bool $readStatusEnabled * @param bool $reachabilityEnabled * @param int $typingIndicatorTimeout * @param int $consumptionReportInterval * @param bool $notificationsNewMessageEnabled * @param string $notificationsNewMessageTemplate * @param string $notificationsNewMessageSound * @param bool $notificationsNewMessageBadgeCountEnabled * @param bool $notificationsAddedToChannelEnabled * @param string $notificationsAddedToChannelTemplate * @param string $notificationsAddedToChannelSound * @param bool $notificationsRemovedFromChannelEnabled * @param string $notificationsRemovedFromChannelTemplate * @param string $notificationsRemovedFromChannelSound * @param bool $notificationsInvitedToChannelEnabled * @param string $notificationsInvitedToChannelTemplate * @param string $notificationsInvitedToChannelSound * @param string $preWebhookUrl * @param string $postWebhookUrl * @param string $webhookMethod * @param string[] $webhookFilters * @param int $limitsChannelMembers * @param int $limitsUserChannels * @param string $mediaCompatibilityMessage * @param int $preWebhookRetryCount * @param int $postWebhookRetryCount * @param bool $notificationsLogEnabled */ public function __construct( string $friendlyName = Values::NONE, string $defaultServiceRoleSid = Values::NONE, string $defaultChannelRoleSid = Values::NONE, string $defaultChannelCreatorRoleSid = Values::NONE, bool $readStatusEnabled = Values::BOOL_NONE, bool $reachabilityEnabled = Values::BOOL_NONE, int $typingIndicatorTimeout = Values::INT_NONE, int $consumptionReportInterval = Values::INT_NONE, bool $notificationsNewMessageEnabled = Values::BOOL_NONE, string $notificationsNewMessageTemplate = Values::NONE, string $notificationsNewMessageSound = Values::NONE, bool $notificationsNewMessageBadgeCountEnabled = Values::BOOL_NONE, bool $notificationsAddedToChannelEnabled = Values::BOOL_NONE, string $notificationsAddedToChannelTemplate = Values::NONE, string $notificationsAddedToChannelSound = Values::NONE, bool $notificationsRemovedFromChannelEnabled = Values::BOOL_NONE, string $notificationsRemovedFromChannelTemplate = Values::NONE, string $notificationsRemovedFromChannelSound = Values::NONE, bool $notificationsInvitedToChannelEnabled = Values::BOOL_NONE, string $notificationsInvitedToChannelTemplate = Values::NONE, string $notificationsInvitedToChannelSound = Values::NONE, string $preWebhookUrl = Values::NONE, string $postWebhookUrl = Values::NONE, string $webhookMethod = Values::NONE, array $webhookFilters = Values::ARRAY_NONE, int $limitsChannelMembers = Values::INT_NONE, int $limitsUserChannels = Values::INT_NONE, string $mediaCompatibilityMessage = Values::NONE, int $preWebhookRetryCount = Values::INT_NONE, int $postWebhookRetryCount = Values::INT_NONE, bool $notificationsLogEnabled = Values::BOOL_NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; $this->options['readStatusEnabled'] = $readStatusEnabled; $this->options['reachabilityEnabled'] = $reachabilityEnabled; $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; $this->options['consumptionReportInterval'] = $consumptionReportInterval; $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $defaultServiceRoleSid * @return $this Fluent Builder */ public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * * * @param string $defaultChannelRoleSid * @return $this Fluent Builder */ public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * * * @param string $defaultChannelCreatorRoleSid * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * * * @param bool $readStatusEnabled * @return $this Fluent Builder */ public function setReadStatusEnabled(bool $readStatusEnabled): self { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * * * @param bool $reachabilityEnabled * @return $this Fluent Builder */ public function setReachabilityEnabled(bool $reachabilityEnabled): self { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * * * @param int $typingIndicatorTimeout * @return $this Fluent Builder */ public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * * * @param int $consumptionReportInterval * @return $this Fluent Builder */ public function setConsumptionReportInterval(int $consumptionReportInterval): self { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * * * @param bool $notificationsNewMessageEnabled * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * * * @param string $notificationsNewMessageTemplate * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * * * @param string $notificationsNewMessageSound * @return $this Fluent Builder */ public function setNotificationsNewMessageSound(string $notificationsNewMessageSound): self { $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; return $this; } /** * * * @param bool $notificationsNewMessageBadgeCountEnabled * @return $this Fluent Builder */ public function setNotificationsNewMessageBadgeCountEnabled(bool $notificationsNewMessageBadgeCountEnabled): self { $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; return $this; } /** * * * @param bool $notificationsAddedToChannelEnabled * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * * * @param string $notificationsAddedToChannelTemplate * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * * * @param string $notificationsAddedToChannelSound * @return $this Fluent Builder */ public function setNotificationsAddedToChannelSound(string $notificationsAddedToChannelSound): self { $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; return $this; } /** * * * @param bool $notificationsRemovedFromChannelEnabled * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * * * @param string $notificationsRemovedFromChannelTemplate * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * * * @param string $notificationsRemovedFromChannelSound * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelSound(string $notificationsRemovedFromChannelSound): self { $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; return $this; } /** * * * @param bool $notificationsInvitedToChannelEnabled * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * * * @param string $notificationsInvitedToChannelTemplate * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * * * @param string $notificationsInvitedToChannelSound * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelSound(string $notificationsInvitedToChannelSound): self { $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; return $this; } /** * * * @param string $preWebhookUrl * @return $this Fluent Builder */ public function setPreWebhookUrl(string $preWebhookUrl): self { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * * * @param string $postWebhookUrl * @return $this Fluent Builder */ public function setPostWebhookUrl(string $postWebhookUrl): self { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * * * @param string $webhookMethod * @return $this Fluent Builder */ public function setWebhookMethod(string $webhookMethod): self { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * * * @param string[] $webhookFilters * @return $this Fluent Builder */ public function setWebhookFilters(array $webhookFilters): self { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * * * @param int $limitsChannelMembers * @return $this Fluent Builder */ public function setLimitsChannelMembers(int $limitsChannelMembers): self { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * * * @param int $limitsUserChannels * @return $this Fluent Builder */ public function setLimitsUserChannels(int $limitsUserChannels): self { $this->options['limitsUserChannels'] = $limitsUserChannels; return $this; } /** * * * @param string $mediaCompatibilityMessage * @return $this Fluent Builder */ public function setMediaCompatibilityMessage(string $mediaCompatibilityMessage): self { $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; return $this; } /** * * * @param int $preWebhookRetryCount * @return $this Fluent Builder */ public function setPreWebhookRetryCount(int $preWebhookRetryCount): self { $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; return $this; } /** * * * @param int $postWebhookRetryCount * @return $this Fluent Builder */ public function setPostWebhookRetryCount(int $postWebhookRetryCount): self { $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; return $this; } /** * * * @param bool $notificationsLogEnabled * @return $this Fluent Builder */ public function setNotificationsLogEnabled(bool $notificationsLogEnabled): self { $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateServiceOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/CredentialContext.php 0000644 00000006447 15021223077 0017137 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param Version $version Version that contains the resource * @param string $sid */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Credentials/' . \rawurlencode($sid) .''; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new CredentialInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.CredentialContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/CredentialOptions.php 0000644 00000016542 15021223077 0017143 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $friendlyName * @param string $certificate * @param string $privateKey * @param bool $sandbox * @param string $apiKey * @param string $secret * @return CreateCredentialOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ): CreateCredentialOptions { return new CreateCredentialOptions( $friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret ); } /** * @param string $friendlyName * @param string $certificate * @param string $privateKey * @param bool $sandbox * @param string $apiKey * @param string $secret * @return UpdateCredentialOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ): UpdateCredentialOptions { return new UpdateCredentialOptions( $friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret ); } } class CreateCredentialOptions extends Options { /** * @param string $friendlyName * @param string $certificate * @param string $privateKey * @param bool $sandbox * @param string $apiKey * @param string $secret */ public function __construct( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $certificate * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * * * @param string $privateKey * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * * * @param bool $sandbox * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * * * @param string $apiKey * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * * * @param string $secret * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.CreateCredentialOptions ' . $options . ']'; } } class UpdateCredentialOptions extends Options { /** * @param string $friendlyName * @param string $certificate * @param string $privateKey * @param bool $sandbox * @param string $apiKey * @param string $secret */ public function __construct( string $friendlyName = Values::NONE, string $certificate = Values::NONE, string $privateKey = Values::NONE, bool $sandbox = Values::BOOL_NONE, string $apiKey = Values::NONE, string $secret = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $certificate * @return $this Fluent Builder */ public function setCertificate(string $certificate): self { $this->options['certificate'] = $certificate; return $this; } /** * * * @param string $privateKey * @return $this Fluent Builder */ public function setPrivateKey(string $privateKey): self { $this->options['privateKey'] = $privateKey; return $this; } /** * * * @param bool $sandbox * @return $this Fluent Builder */ public function setSandbox(bool $sandbox): self { $this->options['sandbox'] = $sandbox; return $this; } /** * * * @param string $apiKey * @return $this Fluent Builder */ public function setApiKey(string $apiKey): self { $this->options['apiKey'] = $apiKey; return $this; } /** * * * @param string $secret * @return $this Fluent Builder */ public function setSecret(string $secret): self { $this->options['secret'] = $secret; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V2.UpdateCredentialOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/CredentialInstance.php 0000644 00000010675 15021223077 0017255 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $friendlyName * @property string $type * @property string|null $sandbox * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid */ public function __construct(Version $version, array $payload, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'sandbox' => Values::array_get($payload, 'sandbox'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CredentialContext Context for this CredentialInstance */ protected function proxy(): CredentialContext { if (!$this->context) { $this->context = new CredentialContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CredentialInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CredentialInstance { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): CredentialInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/ServiceContext.php 0000644 00000022323 15021223077 0016454 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Rest\IpMessaging\V2\Service\ChannelList; use Twilio\Rest\IpMessaging\V2\Service\BindingList; use Twilio\Rest\IpMessaging\V2\Service\RoleList; use Twilio\Rest\IpMessaging\V2\Service\UserList; /** * @property ChannelList $channels * @property BindingList $bindings * @property RoleList $roles * @property UserList $users * @method \Twilio\Rest\IpMessaging\V2\Service\BindingContext bindings(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\ChannelContext channels(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\RoleContext roles(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\UserContext users(string $sid) */ class ServiceContext extends InstanceContext { protected $_channels; protected $_bindings; protected $_roles; protected $_users; /** * Initialize the ServiceContext * * @param Version $version Version that contains the resource * @param string $sid */ public function __construct( Version $version, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($sid) .''; } /** * Delete the ServiceInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ServiceInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ServiceInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'DefaultServiceRoleSid' => $options['defaultServiceRoleSid'], 'DefaultChannelRoleSid' => $options['defaultChannelRoleSid'], 'DefaultChannelCreatorRoleSid' => $options['defaultChannelCreatorRoleSid'], 'ReadStatusEnabled' => Serialize::booleanToString($options['readStatusEnabled']), 'ReachabilityEnabled' => Serialize::booleanToString($options['reachabilityEnabled']), 'TypingIndicatorTimeout' => $options['typingIndicatorTimeout'], 'ConsumptionReportInterval' => $options['consumptionReportInterval'], 'Notifications.NewMessage.Enabled' => Serialize::booleanToString($options['notificationsNewMessageEnabled']), 'Notifications.NewMessage.Template' => $options['notificationsNewMessageTemplate'], 'Notifications.NewMessage.Sound' => $options['notificationsNewMessageSound'], 'Notifications.NewMessage.BadgeCountEnabled' => Serialize::booleanToString($options['notificationsNewMessageBadgeCountEnabled']), 'Notifications.AddedToChannel.Enabled' => Serialize::booleanToString($options['notificationsAddedToChannelEnabled']), 'Notifications.AddedToChannel.Template' => $options['notificationsAddedToChannelTemplate'], 'Notifications.AddedToChannel.Sound' => $options['notificationsAddedToChannelSound'], 'Notifications.RemovedFromChannel.Enabled' => Serialize::booleanToString($options['notificationsRemovedFromChannelEnabled']), 'Notifications.RemovedFromChannel.Template' => $options['notificationsRemovedFromChannelTemplate'], 'Notifications.RemovedFromChannel.Sound' => $options['notificationsRemovedFromChannelSound'], 'Notifications.InvitedToChannel.Enabled' => Serialize::booleanToString($options['notificationsInvitedToChannelEnabled']), 'Notifications.InvitedToChannel.Template' => $options['notificationsInvitedToChannelTemplate'], 'Notifications.InvitedToChannel.Sound' => $options['notificationsInvitedToChannelSound'], 'PreWebhookUrl' => $options['preWebhookUrl'], 'PostWebhookUrl' => $options['postWebhookUrl'], 'WebhookMethod' => $options['webhookMethod'], 'WebhookFilters' => Serialize::map($options['webhookFilters'], function ($e) { return $e; }), 'Limits.ChannelMembers' => $options['limitsChannelMembers'], 'Limits.UserChannels' => $options['limitsUserChannels'], 'Media.CompatibilityMessage' => $options['mediaCompatibilityMessage'], 'PreWebhookRetryCount' => $options['preWebhookRetryCount'], 'PostWebhookRetryCount' => $options['postWebhookRetryCount'], 'Notifications.LogEnabled' => Serialize::booleanToString($options['notificationsLogEnabled']), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ServiceInstance( $this->version, $payload, $this->solution['sid'] ); } /** * Access the channels */ protected function getChannels(): ChannelList { if (!$this->_channels) { $this->_channels = new ChannelList( $this->version, $this->solution['sid'] ); } return $this->_channels; } /** * Access the bindings */ protected function getBindings(): BindingList { if (!$this->_bindings) { $this->_bindings = new BindingList( $this->version, $this->solution['sid'] ); } return $this->_bindings; } /** * Access the roles */ protected function getRoles(): RoleList { if (!$this->_roles) { $this->_roles = new RoleList( $this->version, $this->solution['sid'] ); } return $this->_roles; } /** * Access the users */ protected function getUsers(): UserList { if (!$this->_users) { $this->_users = new UserList( $this->version, $this->solution['sid'] ); } return $this->_users; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/ServicePage.php 0000644 00000003037 15021223077 0015705 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ServicePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ServiceInstance \Twilio\Rest\IpMessaging\V2\ServiceInstance */ public function buildInstance(array $payload): ServiceInstance { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.ServicePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/CredentialPage.php 0000644 00000003061 15021223077 0016354 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class CredentialPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return CredentialInstance \Twilio\Rest\IpMessaging\V2\CredentialInstance */ public function buildInstance(array $payload): CredentialInstance { return new CredentialInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.CredentialPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/CredentialList.php 0000644 00000014341 15021223077 0016416 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource */ public function __construct( Version $version ) { parent::__construct($version); // Path Solution $this->solution = [ ]; $this->uri = '/Credentials'; } /** * Create the CredentialInstance * * @param string $type * @param array|Options $options Optional Arguments * @return CredentialInstance Created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $type, array $options = []): CredentialInstance { $options = new Values($options); $data = Values::of([ 'Type' => $type, 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new CredentialInstance( $this->version, $payload ); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read(int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return CredentialPage Page of CredentialInstance */ public function page( $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): CredentialPage { $params = Values::of([ 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return CredentialPage Page of CredentialInstance */ public function getPage(string $targetUrl): CredentialPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Constructs a CredentialContext * * @param string $sid */ public function getContext( string $sid ): CredentialContext { return new CredentialContext( $this->version, $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2.CredentialList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2.php 0000644 00000005757 15021223077 0013523 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\IpMessaging\V2\CredentialList; use Twilio\Rest\IpMessaging\V2\ServiceList; use Twilio\Version; /** * @property CredentialList $credentials * @property ServiceList $services * @method \Twilio\Rest\IpMessaging\V2\CredentialContext credentials(string $sid) * @method \Twilio\Rest\IpMessaging\V2\ServiceContext services(string $sid) */ class V2 extends Version { protected $_credentials; protected $_services; /** * Construct the V2 version of IpMessaging * * @param Domain $domain Domain that contains the version */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v2'; } protected function getCredentials(): CredentialList { if (!$this->_credentials) { $this->_credentials = new CredentialList($this); } return $this->_credentials; } protected function getServices(): ServiceList { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get(string $name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V2]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserOptions.php 0000644 00000011232 15021223077 0017375 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $roleSid * @param string $attributes * @param string $friendlyName * @return CreateUserOptions Options builder */ public static function create( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE ): CreateUserOptions { return new CreateUserOptions( $roleSid, $attributes, $friendlyName ); } /** * @param string $roleSid * @param string $attributes * @param string $friendlyName * @return UpdateUserOptions Options builder */ public static function update( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE ): UpdateUserOptions { return new UpdateUserOptions( $roleSid, $attributes, $friendlyName ); } } class CreateUserOptions extends Options { /** * @param string $roleSid * @param string $attributes * @param string $friendlyName */ public function __construct( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.CreateUserOptions ' . $options . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid * @param string $attributes * @param string $friendlyName */ public function __construct( string $roleSid = Values::NONE, string $attributes = Values::NONE, string $friendlyName = Values::NONE ) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.UpdateUserOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserContext.php 0000644 00000011563 15021223077 0017375 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\IpMessaging\V1\Service\User\UserChannelList; /** * @property UserChannelList $userChannels */ class UserContext extends InstanceContext { protected $_userChannels; /** * Initialize the UserContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Users/' . \rawurlencode($sid) .''; } /** * Delete the UserInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): UserInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): UserInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the userChannels */ protected function getUserChannels(): UserChannelList { if (!$this->_userChannels) { $this->_userChannels = new UserChannelList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userChannels; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.UserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleInstance.php 0000644 00000011073 15021223077 0017474 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $serviceSid * @property string|null $friendlyName * @property string $type * @property string[]|null $permissions * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return RoleContext Context for this RoleInstance */ protected function proxy(): RoleContext { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { return $this->proxy()->fetch(); } /** * Update the RoleInstance * * @param string[] $permission * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelPage.php 0000644 00000003116 15021223077 0017252 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class ChannelPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return ChannelInstance \Twilio\Rest\IpMessaging\V1\Service\ChannelInstance */ public function buildInstance(array $payload): ChannelInstance { return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.ChannelPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleContext.php 0000644 00000006064 15021223077 0017360 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Serialize; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Roles/' . \rawurlencode($sid) .''; } /** * Delete the RoleInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): RoleInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the RoleInstance * * @param string[] $permission * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $permission): RoleInstance { $data = Values::of([ 'Permission' => Serialize::map($permission,function ($e) { return $e; }), ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.RoleContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelList.php 0000644 00000014703 15021223077 0017315 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid */ public function __construct( Version $version, string $serviceSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels'; } /** * Create the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Created ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function create(array $options = []): ChannelInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'Type' => $options['type'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'] ); } /** * Reads ChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return ChannelPage Page of ChannelInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): ChannelPage { $options = new Values($options); $params = Values::of([ 'Type' => $options['type'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return ChannelPage Page of ChannelInstance */ public function getPage(string $targetUrl): ChannelPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelPage($this->version, $response, $this->solution); } /** * Constructs a ChannelContext * * @param string $sid */ public function getContext( string $sid ): ChannelContext { return new ChannelContext( $this->version, $this->solution['serviceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.ChannelList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/RolePage.php 0000644 00000003074 15021223077 0016606 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class RolePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return RoleInstance \Twilio\Rest\IpMessaging\V1\Service\RoleInstance */ public function buildInstance(array $payload): RoleInstance { return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.RolePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelContext.php 0000644 00000014101 15021223077 0020016 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; use Twilio\Rest\IpMessaging\V1\Service\Channel\MemberList; use Twilio\Rest\IpMessaging\V1\Service\Channel\InviteList; use Twilio\Rest\IpMessaging\V1\Service\Channel\MessageList; /** * @property MemberList $members * @property InviteList $invites * @property MessageList $messages * @method \Twilio\Rest\IpMessaging\V1\Service\Channel\MemberContext members(string $sid) * @method \Twilio\Rest\IpMessaging\V1\Service\Channel\MessageContext messages(string $sid) * @method \Twilio\Rest\IpMessaging\V1\Service\Channel\InviteContext invites(string $sid) */ class ChannelContext extends InstanceContext { protected $_members; protected $_invites; protected $_messages; /** * Initialize the ChannelContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($sid) .''; } /** * Delete the ChannelInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): ChannelInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): ChannelInstance { $options = new Values($options); $data = Values::of([ 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the members */ protected function getMembers(): MemberList { if (!$this->_members) { $this->_members = new MemberList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_members; } /** * Access the invites */ protected function getInvites(): InviteList { if (!$this->_invites) { $this->_invites = new InviteList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_invites; } /** * Access the messages */ protected function getMessages(): MessageList { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get(string $name): ListResource { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call(string $name, array $arguments): InstanceContext { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.ChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageInstance.php 0000644 00000012206 15021223077 0021526 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $attributes * @property string|null $serviceSid * @property string|null $to * @property string|null $channelSid * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property bool|null $wasEdited * @property string|null $from * @property string|null $body * @property int|null $index * @property string|null $url */ class MessageInstance extends InstanceResource { /** * Initialize the MessageInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $channelSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'to' => Values::array_get($payload, 'to'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'wasEdited' => Values::array_get($payload, 'was_edited'), 'from' => Values::array_get($payload, 'from'), 'body' => Values::array_get($payload, 'body'), 'index' => Values::array_get($payload, 'index'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MessageContext Context for this MessageInstance */ protected function proxy(): MessageContext { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MessageInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageContext.php 0000644 00000006656 15021223077 0021422 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class MessageContext extends InstanceContext { /** * Initialize the MessageContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $channelSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $channelSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Messages/' . \rawurlencode($sid) .''; } /** * Delete the MessageInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MessageInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Body' => $options['body'], 'Attributes' => $options['attributes'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberInstance.php 0000644 00000012122 15021223077 0021346 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $channelSid * @property string|null $serviceSid * @property string|null $identity * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $roleSid * @property int|null $lastConsumedMessageIndex * @property \DateTime|null $lastConsumptionTimestamp * @property string|null $url */ class MemberInstance extends InstanceResource { /** * Initialize the MemberInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $channelSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return MemberContext Context for this MemberInstance */ protected function proxy(): MemberContext { if (!$this->context) { $this->context = new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the MemberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { return $this->proxy()->fetch(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.MemberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberContext.php 0000644 00000006701 15021223077 0021234 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\Options; use Twilio\Values; use Twilio\Version; use Twilio\InstanceContext; class MemberContext extends InstanceContext { /** * Initialize the MemberContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $channelSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $channelSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members/' . \rawurlencode($sid) .''; } /** * Delete the MemberInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): MemberInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update(array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], ]); $payload = $this->version->update('POST', $this->uri, [], $data); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.MemberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberOptions.php 0000644 00000010733 15021223077 0021243 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $roleSid * @return CreateMemberOptions Options builder */ public static function create( string $roleSid = Values::NONE ): CreateMemberOptions { return new CreateMemberOptions( $roleSid ); } /** * @param string[] $identity * @return ReadMemberOptions Options builder */ public static function read( array $identity = Values::ARRAY_NONE ): ReadMemberOptions { return new ReadMemberOptions( $identity ); } /** * @param string $roleSid * @param int $lastConsumedMessageIndex * @return UpdateMemberOptions Options builder */ public static function update( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE ): UpdateMemberOptions { return new UpdateMemberOptions( $roleSid, $lastConsumedMessageIndex ); } } class CreateMemberOptions extends Options { /** * @param string $roleSid */ public function __construct( string $roleSid = Values::NONE ) { $this->options['roleSid'] = $roleSid; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.CreateMemberOptions ' . $options . ']'; } } class ReadMemberOptions extends Options { /** * @param string[] $identity */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * * * @param string[] $identity * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.ReadMemberOptions ' . $options . ']'; } } class UpdateMemberOptions extends Options { /** * @param string $roleSid * @param int $lastConsumedMessageIndex */ public function __construct( string $roleSid = Values::NONE, int $lastConsumedMessageIndex = Values::INT_NONE ) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * * * @param int $lastConsumedMessageIndex * @return $this Fluent Builder */ public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.UpdateMemberOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteList.php 0000644 00000015234 15021223077 0020553 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class InviteList extends ListResource { /** * Construct the InviteList * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $channelSid */ public function __construct( Version $version, string $serviceSid, string $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites'; } /** * Create the InviteInstance * * @param string $identity * @param array|Options $options Optional Arguments * @return InviteInstance Created InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): InviteInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads InviteInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InviteInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return InvitePage Page of InviteInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): InvitePage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new InvitePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InviteInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return InvitePage Page of InviteInstance */ public function getPage(string $targetUrl): InvitePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InvitePage($this->version, $response, $this->solution); } /** * Constructs a InviteContext * * @param string $sid */ public function getContext( string $sid ): InviteContext { return new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.InviteList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteContext.php 0000644 00000005126 15021223077 0021263 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\Version; use Twilio\InstanceContext; class InviteContext extends InstanceContext { /** * Initialize the InviteContext * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $channelSid * @param string $sid */ public function __construct( Version $version, $serviceSid, $channelSid, $sid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Invites/' . \rawurlencode($sid) .''; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->version->delete('DELETE', $this->uri); } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { $payload = $this->version->fetch('GET', $this->uri, [], []); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.InviteContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteInstance.php 0000644 00000011002 15021223077 0021371 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; use Twilio\Deserialize; /** * @property string|null $sid * @property string|null $accountSid * @property string|null $channelSid * @property string|null $serviceSid * @property string|null $identity * @property \DateTime|null $dateCreated * @property \DateTime|null $dateUpdated * @property string|null $roleSid * @property string|null $createdBy * @property string|null $url */ class InviteInstance extends InstanceResource { /** * Initialize the InviteInstance * * @param Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid * @param string $channelSid * @param string $sid */ public function __construct(Version $version, array $payload, string $serviceSid, string $channelSid, string $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = [ 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'createdBy' => Values::array_get($payload, 'created_by'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return InviteContext Context for this InviteInstance */ protected function proxy(): InviteContext { if (!$this->context) { $this->context = new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Delete the InviteInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): InviteInstance { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.InviteInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteOptions.php 0000644 00000005431 15021223077 0021271 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class InviteOptions { /** * @param string $roleSid * @return CreateInviteOptions Options builder */ public static function create( string $roleSid = Values::NONE ): CreateInviteOptions { return new CreateInviteOptions( $roleSid ); } /** * @param string[] $identity * @return ReadInviteOptions Options builder */ public static function read( array $identity = Values::ARRAY_NONE ): ReadInviteOptions { return new ReadInviteOptions( $identity ); } } class CreateInviteOptions extends Options { /** * @param string $roleSid */ public function __construct( string $roleSid = Values::NONE ) { $this->options['roleSid'] = $roleSid; } /** * * * @param string $roleSid * @return $this Fluent Builder */ public function setRoleSid(string $roleSid): self { $this->options['roleSid'] = $roleSid; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.CreateInviteOptions ' . $options . ']'; } } class ReadInviteOptions extends Options { /** * @param string[] $identity */ public function __construct( array $identity = Values::ARRAY_NONE ) { $this->options['identity'] = $identity; } /** * * * @param string[] $identity * @return $this Fluent Builder */ public function setIdentity(array $identity): self { $this->options['identity'] = $identity; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.ReadInviteOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessagePage.php 0000644 00000003175 15021223077 0020643 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MessagePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MessageInstance \Twilio\Rest\IpMessaging\V1\Service\Channel\MessageInstance */ public function buildInstance(array $payload): MessageInstance { return new MessageInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.MessagePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberPage.php 0000644 00000003167 15021223077 0020467 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class MemberPage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return MemberInstance \Twilio\Rest\IpMessaging\V1\Service\Channel\MemberInstance */ public function buildInstance(array $payload): MemberInstance { return new MemberInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.MemberPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberList.php 0000644 00000015234 15021223077 0020524 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; use Twilio\Serialize; class MemberList extends ListResource { /** * Construct the MemberList * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $channelSid */ public function __construct( Version $version, string $serviceSid, string $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Members'; } /** * Create the MemberInstance * * @param string $identity * @param array|Options $options Optional Arguments * @return MemberInstance Created MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $identity, array $options = []): MemberInstance { $options = new Values($options); $data = Values::of([ 'Identity' => $identity, 'RoleSid' => $options['roleSid'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads MemberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MemberInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MemberPage Page of MemberInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MemberPage { $options = new Values($options); $params = Values::of([ 'Identity' => Serialize::map($options['identity'], function ($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MemberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MemberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MemberPage Page of MemberInstance */ public function getPage(string $targetUrl): MemberPage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MemberPage($this->version, $response, $this->solution); } /** * Constructs a MemberContext * * @param string $sid */ public function getContext( string $sid ): MemberContext { return new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.MemberList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InvitePage.php 0000644 00000003167 15021223077 0020516 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Http\Response; use Twilio\Page; use Twilio\Version; class InvitePage extends Page { /** * @param Version $version Version that contains the resource * @param Response $response Response from the API * @param array $solution The context solution */ public function __construct(Version $version, Response $response, array $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } /** * @param array $payload Payload response from the API * @return InviteInstance \Twilio\Rest\IpMessaging\V1\Service\Channel\InviteInstance */ public function buildInstance(array $payload): InviteInstance { return new InviteInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.InvitePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageOptions.php 0000644 00000011261 15021223077 0021415 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $from * @param string $attributes * @return CreateMessageOptions Options builder */ public static function create( string $from = Values::NONE, string $attributes = Values::NONE ): CreateMessageOptions { return new CreateMessageOptions( $from, $attributes ); } /** * @param string $order * @return ReadMessageOptions Options builder */ public static function read( string $order = Values::NONE ): ReadMessageOptions { return new ReadMessageOptions( $order ); } /** * @param string $body * @param string $attributes * @return UpdateMessageOptions Options builder */ public static function update( string $body = Values::NONE, string $attributes = Values::NONE ): UpdateMessageOptions { return new UpdateMessageOptions( $body, $attributes ); } } class CreateMessageOptions extends Options { /** * @param string $from * @param string $attributes */ public function __construct( string $from = Values::NONE, string $attributes = Values::NONE ) { $this->options['from'] = $from; $this->options['attributes'] = $attributes; } /** * * * @param string $from * @return $this Fluent Builder */ public function setFrom(string $from): self { $this->options['from'] = $from; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.CreateMessageOptions ' . $options . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order */ public function __construct( string $order = Values::NONE ) { $this->options['order'] = $order; } /** * * * @param string $order * @return $this Fluent Builder */ public function setOrder(string $order): self { $this->options['order'] = $order; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.ReadMessageOptions ' . $options . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $body * @param string $attributes */ public function __construct( string $body = Values::NONE, string $attributes = Values::NONE ) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; } /** * * * @param string $body * @return $this Fluent Builder */ public function setBody(string $body): self { $this->options['body'] = $body; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.UpdateMessageOptions ' . $options . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageList.php 0000644 00000015231 15021223077 0020676 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Stream; use Twilio\Values; use Twilio\Version; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $serviceSid * @param string $channelSid */ public function __construct( Version $version, string $serviceSid, string $channelSid ) { parent::__construct($version); // Path Solution $this->solution = [ 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, ]; $this->uri = '/Services/' . \rawurlencode($serviceSid) .'/Channels/' . \rawurlencode($channelSid) .'/Messages'; } /** * Create the MessageInstance * * @param string $body * @param array|Options $options Optional Arguments * @return MessageInstance Created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create(string $body, array $options = []): MessageInstance { $options = new Values($options); $data = Values::of([ 'Body' => $body, 'From' => $options['from'], 'Attributes' => $options['attributes'], ]); $payload = $this->version->create('POST', $this->uri, [], $data); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read(array $options = [], int $limit = null, $pageSize = null): array { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return Stream stream of results */ public function stream(array $options = [], int $limit = null, $pageSize = null): Stream { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return MessagePage Page of MessageInstance */ public function page( array $options = [], $pageSize = Values::NONE, string $pageToken = Values::NONE, $pageNumber = Values::NONE ): MessagePage { $options = new Values($options); $params = Values::of([ 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, ]); $response = $this->version->page('GET', $this->uri, $params); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return MessagePage Page of MessageInstance */ public function getPage(string $targetUrl): MessagePage { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid */ public function getContext( string $sid ): MessageContext { return new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { return '[Twilio.IpMessaging.V1.MessageList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelOptions.php 0000644 00000014251 15021223077 0020033 0 ustar 00 <?php /** * This code was generated by * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ * * Twilio - Ip_messaging * This is the public Twilio REST API. * * NOTE: This class is auto generated by OpenAPI Generator. * https://openapi-generator.tech * Do not edit the class manually. */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $friendlyName * @param string $uniqueName * @param string $attributes * @param string $type * @return CreateChannelOptions Options builder */ public static function create( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $type = Values::NONE ): CreateChannelOptions { return new CreateChannelOptions( $friendlyName, $uniqueName, $attributes, $type ); } /** * @param string $type * @return ReadChannelOptions Options builder */ public static function read( array $type = Values::ARRAY_NONE ): ReadChannelOptions { return new ReadChannelOptions( $type ); } /** * @param string $friendlyName * @param string $uniqueName * @param string $attributes * @return UpdateChannelOptions Options builder */ public static function update( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE ): UpdateChannelOptions { return new UpdateChannelOptions( $friendlyName, $uniqueName, $attributes ); } } class CreateChannelOptions extends Options { /** * @param string $friendlyName * @param string $uniqueName * @param string $attributes * @param string $type */ public function __construct( string $friendlyName = Values::NONE, string $uniqueName = Values::NONE, string $attributes = Values::NONE, string $type = Values::NONE ) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; } /** * * * @param string $friendlyName * @return $this Fluent Builder */ public function setFriendlyName(string $friendlyName): self { $this->options['friendlyName'] = $friendlyName; return $this; } /** * * * @param string $uniqueName * @return $this Fluent Builder */ public function setUniqueName(string $uniqueName): self { $this->options['uniqueName'] = $uniqueName; return $this; } /** * * * @param string $attributes * @return $this Fluent Builder */ public function setAttributes(string $attributes): self { $this->options['attributes'] = $attributes; return $this; } /** * @param string $type * @return $this Fluent Builder */ public function setType(string $type): self { $this->options['type'] = $type; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.CreateChannelOptions ' . $options . ']'; } } class ReadChannelOptions extends Options { /** * @param string $type */ public function __construct( array $type = Values::ARRAY_NONE ) { $this->options['type'] = $type; } /** * * * @param string $type * @return $this Fluent Builder */ public function setType(array $type): self { $this->options['type'] = $type; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.IpMessaging.V1.ReadChannelOptions ' . $options . ']'