src/Jaspersoft/Service/UserService.php
public function addOrUpdateAttribute(User $user, $attribute)
    {
        $url = self::makeAttributeUrl($user->username, $user->tenantId, null, $attribute->name);
        $data = json_encode($attribute);
        $response = $this->service->prepAndSend($url, array(201, 200), 'PUT', $data, true);

        return Attribute::createFromJSON(json_decode($response));
    }
public function addOrUpdateAttribute(User $user, $attribute)
    {
        $url = self::makeAttributeUrl($user->username, $user->tenantId, null, $attribute->name);
        $data = json_encode($attribute);
        $response = $this->service->prepAndSend($url, array(201, 200), 'PUT', $data, true);

        return Attribute::createFromJSON(json_decode($response));
    }
public function addOrUpdateAttribute ( User $ user , $ attribute ) { $ url = self :: makeAttributeUrl ( $ user -> username , $ user -> tenantId , null , $ attribute -> name ) ; $ data = json_encode ( $ attribute ) ; $ response = $ this -> service -> prepAndSend ( $ url , array ( 201 , 200 ) , 'PUT' , $ data , true ) ; return Attribute :: createFromJSON ( json_decode ( $ response ) ) ; }
Create a new attributes, or update an existing one.

If a new attribute is created, a truthy value will be returned, if the attribute is updated,
an Attribute object representing the updated attribute will be returned.

@param \Jaspersoft\Dto\User\User $user
@param \Jaspersoft\Dto\Attribute\Attribute $attribute
@return bool|\Jaspersoft\Dto\Attribute\Attribute
Create a new attributes or update an existing one .