public function update($subAuthId, $name = null, $enabled = null)
    {
        $data = [
            'name' => $name,
            'enabled' => $enabled
        ];

        $response = $this->client->update(
            $this->uri . $subAuthId . '/',
            $data
        );

        $responseContents = $response->getContent();

        if(!array_key_exists("error",$responseContents)){
            return new ResponseUpdate(
                $responseContents['api_id'],
                $responseContents['message'],
                $response->getStatusCode()
            );
        } else {
            throw new PlivoResponseException(
                $responseContents['error'],
                0,
                null,
                $response->getContent(),
                $response->getStatusCode()

            );
        }
    }
public function update($subAuthId, $name = null, $enabled = null)
    {
        $data = [
            'name' => $name,
            'enabled' => $enabled
        ];

        $response = $this->client->update(
            $this->uri . $subAuthId . '/',
            $data
        );

        $responseContents = $response->getContent();

        if(!array_key_exists("error",$responseContents)){
            return new ResponseUpdate(
                $responseContents['api_id'],
                $responseContents['message'],
                $response->getStatusCode()
            );
        } else {
            throw new PlivoResponseException(
                $responseContents['error'],
                0,
                null,
                $response->getContent(),
                $response->getStatusCode()

            );
        }
    }
public function update ( $ subAuthId , $ name = null , $ enabled = null ) { $ data = [ 'name' => $ name , 'enabled' => $ enabled ] ; $ response = $ this -> client -> update ( $ this -> uri . $ subAuthId . '/' , $ data ) ; $ responseContents = $ response -> getContent ( ) ; if ( ! array_key_exists ( "error" , $ responseContents ) ) { return new ResponseUpdate ( $ responseContents [ 'api_id' ] , $ responseContents [ 'message' ] , $ response -> getStatusCode ( ) ) ; } else { throw new PlivoResponseException ( $ responseContents [ 'error' ] , 0 , null , $ response -> getContent ( ) , $ response -> getStatusCode ( ) ) ; } }
Modify a subaccount

@param string $subAuthId The auth ID of the subaccount to modify
@param string $name Name of the subaccount
@param bool|null $enabled Specify if the subaccount should be enabled or
not. Takes a value of True or False.
@return ResponseUpdate
Modify a subaccount