Skip to content

Commit

Permalink
chore: rename InvocableScripts to InvokableScripts (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar authored Apr 28, 2022
1 parent 5cd85d2 commit ddf0298
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 42 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
## 2.8.0 [unreleased]

### Breaking Changes
1. [#121](https://github.com/influxdata/influxdb-client-php/pull/121): Rename `InvocableScripts` to `InvokableScripts`

## 2.7.0 [2022-04-19]

### Features
1. [#119](https://github.com/influxdata/influxdb-client-php/pull/119): Add `InvocableScriptsApi` to create, update, list, delete and invoke scripts by seamless way
1. [#119](https://github.com/influxdata/influxdb-client-php/pull/119): Add `InvokableScriptsApi` to create, update, list, delete and invoke scripts by seamless way

### CI
1. [#118](https://github.com/influxdata/influxdb-client-php/pull/118): Use new Codecov uploader for reporting code coverage
Expand Down
12 changes: 6 additions & 6 deletions examples/InvocableScripts.php → examples/InvokableScripts.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* Show to use Invocable scripts Cloud API to create custom endpoints that query data
* Show to use Invokable scripts Cloud API to create custom endpoints that query data
*
* Invocable Scripts are supported only in InfluxDB Cloud, currently there is no support in InfluxDB OSS.
* Invokable Scripts are supported only in InfluxDB Cloud, currently there is no support in InfluxDB OSS.
*/

require __DIR__ . '/../vendor/autoload.php';
Expand Down Expand Up @@ -39,12 +39,12 @@
$client->createWriteApi()->write([$point1, $point2]);

//
// Creating InvocableScripts Api
// Creating InvokableScripts Api
//
$scriptsApi = $client->createInvocableScriptsApi();
$scriptsApi = $client->createInvokableScriptsApi();

//
// Create Invocable Script
// Create Invokable Script
//
print "\n------- Create -------\n";
$scriptQuery = 'from(bucket: params.bucket_name) |> range(start: -30d) |> limit(n:2)';
Expand All @@ -58,7 +58,7 @@
print $createdScript;

//
// Update Invocable Script
// Update Invokable Script
//
print "\n------- Update -------\n";
$updateRequest = new ScriptUpdateRequest([
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
## Others
- [InfluxDB_18_Example.php](InfluxDB_18_Example.php) - How to use forward compatibility APIs from InfluxDB 1.8
- [DeleteDataExample.php](DeleteDataExample.php) - How to delete data from InfluxDB by client
- [InvocableScripts.php](InvocableScripts.php) - How to use Invocable scripts Cloud API to create custom endpoints that query data
- [InvokableScripts.php](InvokableScripts.php) - How to use Invokable scripts Cloud API to create custom endpoints that query data
14 changes: 7 additions & 7 deletions src/InfluxDB2/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace InfluxDB2;

use InfluxDB2\Model\HealthCheck;
use InfluxDB2\Service\InvocableScriptsService;
use InfluxDB2\Service\InvokableScriptsService;
use InfluxDB2\Service\PingService;
use ReflectionClass;
use RuntimeException;
Expand Down Expand Up @@ -101,15 +101,15 @@ public function createQueryApi(): QueryApi
}

/**
* Create an InvocableScripts API instance.
* Create an InvokableScripts API instance.
*
* @return InvocableScriptsApi
* @return InvokableScriptsApi
*/
public function createInvocableScriptsApi(): InvocableScriptsApi
public function createInvokableScriptsApi(): InvokableScriptsApi
{
/** @var InvocableScriptsService $service */
$service = $this->createService(InvocableScriptsService::class);
return new InvocableScriptsApi($this->options, $service);
/** @var InvokableScriptsService $service */
$service = $this->createService(InvokableScriptsService::class);
return new InvokableScriptsApi($this->options, $service);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use InfluxDB2\Model\ScriptCreateRequest;
use InfluxDB2\Model\ScriptInvocationParams;
use InfluxDB2\Model\ScriptUpdateRequest;
use InfluxDB2\Service\InvocableScriptsService;
use InfluxDB2\Service\InvokableScriptsService;
use Psr\Http\Message\StreamInterface;

/**
Expand All @@ -17,17 +17,17 @@
*
* @package InfluxDB2
*/
class InvocableScriptsApi extends DefaultApi
class InvokableScriptsApi extends DefaultApi
{
private $service;

/**
* InvocableScriptsApi constructor.
* InvokableScriptsApi constructor.
*
* @param array $options default array options
* @param InvocableScriptsService $service HTTP API for Invocable Scripts
* @param InvokableScriptsService $service HTTP API for Invokable Scripts
*/
public function __construct(array $options, InvocableScriptsService $service)
public function __construct(array $options, InvokableScriptsService $service)
{
parent::__construct($options);
$this->service = $service;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* InvocableScriptsService
* InvokableScriptsService
* PHP version 5
*
* @category Class
Expand Down Expand Up @@ -40,14 +40,14 @@
use InfluxDB2\ObjectSerializer;

/**
* InvocableScriptsService Class Doc Comment
* InvokableScriptsService Class Doc Comment
*
* @category Class
* @package InfluxDB2
* @author OpenAPI Generator team
* @link https://openapi-generator.tech
*/
class InvocableScriptsService
class InvokableScriptsService
{
/**
* @var ClientInterface
Expand Down
19 changes: 0 additions & 19 deletions tests/InvocableScriptsApiTest.php

This file was deleted.

19 changes: 19 additions & 0 deletions tests/InvokableScriptsApiTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace InfluxDB2Test;

require_once('BasicTest.php');

/**
* Class InvokableScriptsApiTest
* @package InfluxDB2Test
*/
class InvokableScriptsApiTest extends BasicTest
{
public function testCreateInstance()
{
$invokableScriptsApi = $this->client->createInvokableScriptsApi();

$this->assertNotNull($invokableScriptsApi);
}
}

0 comments on commit ddf0298

Please sign in to comment.