src/Api/Route.php
public function update(
        string $routeId,
        string $expression = null,
        array $actions = [],
        string $description = null,
        int $priority = null
    ) {
        Assert::stringNotEmpty($routeId);
        $params = [];

        if (!empty($expression)) {
            $params['expression'] = trim($expression);
        }

        foreach ($actions as $action) {
            Assert::stringNotEmpty($action);

            $params['action'] = isset($params['action']) ? $params['action'] : [];
            $params['action'][] = $action;
        }

        if (!empty($description)) {
            $params['description'] = trim($description);
        }

        if (!empty($priority)) {
            $params['priority'] = (string) $priority;
        }

        $response = $this->httpPut(sprintf('/v3/routes/%s', $routeId), $params);

        return $this->hydrateResponse($response, UpdateResponse::class);
    }
public function update(
        string $routeId,
        string $expression = null,
        array $actions = [],
        string $description = null,
        int $priority = null
    ) {
        Assert::stringNotEmpty($routeId);
        $params = [];

        if (!empty($expression)) {
            $params['expression'] = trim($expression);
        }

        foreach ($actions as $action) {
            Assert::stringNotEmpty($action);

            $params['action'] = isset($params['action']) ? $params['action'] : [];
            $params['action'][] = $action;
        }

        if (!empty($description)) {
            $params['description'] = trim($description);
        }

        if (!empty($priority)) {
            $params['priority'] = (string) $priority;
        }

        $response = $this->httpPut(sprintf('/v3/routes/%s', $routeId), $params);

        return $this->hydrateResponse($response, UpdateResponse::class);
    }
public function update ( string $ routeId , string $ expression = null , array $ actions = [ ] , string $ description = null , int $ priority = null ) { Assert :: stringNotEmpty ( $ routeId ) ; $ params = [ ] ; if ( ! empty ( $ expression ) ) { $ params [ 'expression' ] = trim ( $ expression ) ; } foreach ( $ actions as $ action ) { Assert :: stringNotEmpty ( $ action ) ; $ params [ 'action' ] = isset ( $ params [ 'action' ] ) ? $ params [ 'action' ] : [ ] ; $ params [ 'action' ] [ ] = $ action ; } if ( ! empty ( $ description ) ) { $ params [ 'description' ] = trim ( $ description ) ; } if ( ! empty ( $ priority ) ) { $ params [ 'priority' ] = ( string ) $ priority ; } $ response = $ this -> httpPut ( sprintf ( '/v3/routes/%s' , $ routeId ) , $ params ) ; return $ this -> hydrateResponse ( $ response , UpdateResponse :: class ) ; }
Updates a given Route by ID. All parameters are optional.
This API call only updates the specified fields leaving others unchanged.

@param string      $routeId     Route ID returned by the Routes::index() method
@param string|null $expression  A filter expression like "match_recipient('.*@gmail.com')"
@param array       $actions     Route action. This action is executed when the expression evaluates to True. Example: "forward('alice@example.com')"
@param string|null $description An arbitrary string
@param int|null    $priority    Integer: smaller number indicates higher priority. Higher priority routes are handled first. Defaults to 0.

@return UpdateResponse
Updates a given Route by ID . All parameters are optional . This API call only updates the specified fields leaving others unchanged .