protected function resourceAttributes($record = null)
    {
        return $this->validatorFactory()->attributes(
            $this->attributeRules($record),
            $this->attributeMessages($record),
            $this->attributeCustomAttributes($record),
            function (Validator $validator) use ($record) {
                return $this->conditionalAttributes($validator, $record);
            },
            function (ResourceObjectInterface $resource, $record) {
                return $this->extractAttributes($resource, $record);
            }
        );
    }