Rules
extends ManagementEndpoint
in package
implements
RulesInterface
Class Rules.
Handles requests to the Rules endpoint of the v2 Management API.
Tags
Interfaces, Classes, Traits and Enums
- RulesInterface
- Interface RulesInterface.
Table of Contents
- $httpClient : HttpClient
- __construct() : mixed
- ManagementEndpoint constructor.
- create() : ResponseInterface
- Create a new Rule.
- delete() : ResponseInterface
- Delete a rule by ID.
- get() : ResponseInterface
- Get a single rule by ID.
- getAll() : ResponseInterface
- Get all Rules, by page if desired.
- getHttpClient() : HttpClient
- Get the injected HttpClient instance.
- getLastRequest() : HttpRequest|null
- Return an instance of HttpRequest representing the last issued request.
- getResponsePaginator() : HttpResponsePaginator
- Return a ResponsePaginator instance configured for the last HttpRequest.
- instance() : static
- update() : ResponseInterface
- Update a Rule by ID.
Properties
$httpClient
private
HttpClient
$httpClient
Methods
__construct()
ManagementEndpoint constructor.
public
final __construct(HttpClient $httpClient) : mixed
Parameters
- $httpClient : HttpClient
-
httpClient instance to use
Return values
mixed —create()
Create a new Rule.
public
create(string $name, string $script[, array<string|int, mixed>|null $body = null ][, RequestOptions|null $options = null ]) : ResponseInterface
Required scope: create:rules
.
Parameters
- $name : string
-
name of this rule
- $script : string
-
code to be executed when this rule runs
- $body : array<string|int, mixed>|null = null
-
Optional. Additional body content to pass with the API request. See @see for supported options.
- $options : RequestOptions|null = null
-
Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)
Return values
ResponseInterface —delete()
Delete a rule by ID.
public
delete(string $id[, RequestOptions|null $options = null ]) : ResponseInterface
Required scope: delete:rules
.
Parameters
- $id : string
-
rule ID to delete
- $options : RequestOptions|null = null
-
Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)
Return values
ResponseInterface —get()
Get a single rule by ID.
public
get(string $id[, RequestOptions|null $options = null ]) : ResponseInterface
Required scope: read:rules
.
Parameters
- $id : string
-
rule ID to get
- $options : RequestOptions|null = null
-
Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)
Return values
ResponseInterface —getAll()
Get all Rules, by page if desired.
public
getAll([array<string|int, mixed>|null $parameters = null ][, RequestOptions|null $options = null ]) : ResponseInterface
Required scope: read:rules
.
Parameters
- $parameters : array<string|int, mixed>|null = null
-
Optional. Query parameters to pass with the API request. See @see for supported options.
- $options : RequestOptions|null = null
-
Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)
Return values
ResponseInterface —getHttpClient()
Get the injected HttpClient instance.
public
final getHttpClient() : HttpClient
Return values
HttpClient —getLastRequest()
Return an instance of HttpRequest representing the last issued request.
public
final getLastRequest() : HttpRequest|null
Return values
HttpRequest|null —getResponsePaginator()
Return a ResponsePaginator instance configured for the last HttpRequest.
public
final getResponsePaginator() : HttpResponsePaginator
Return values
HttpResponsePaginator —instance()
public
static instance(HttpClient $httpClient) : static
Parameters
- $httpClient : HttpClient
Return values
static —update()
Update a Rule by ID.
public
update(string $id, array<string|int, mixed> $body[, RequestOptions|null $options = null ]) : ResponseInterface
Required scope: update:rules
.
Parameters
- $id : string
-
rule ID to delete
- $body : array<string|int, mixed>
-
rule data to update
- $options : RequestOptions|null = null
-
Optional. Additional request options to use, such as a field filtering or pagination. (Not all endpoints support these. See @see for supported options.)