Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module API::V1::Entities
- class Proxy < Grape::Entity
- expose :id, documentation: { type: 'Integer', desc: 'proxy iden' }
- expose :ip, documentation: { type: 'inet', desc: 'IP address' }
- expose :port, documentation: { type: 'Integer', desc: 'port' }
- expose :username, documentation: { type: 'String', desc: 'username' }
- expose :password, documentation: { type: 'String', desc: 'password' }
- expose :country, documentation: { type: 'String', desc: 'country in ISO 3166' }
- expose :source, documentation: { type: 'String', desc: 'source' }
- expose :project, documentation: { type: 'String', desc: 'project where proxy is using'}
- expose :speed_average, documentation: { type: 'String', desc: 'average data rate' }
- expose :status, documentation: { type: 'String', desc: 'status' }
- expose :errors,
- documentation: { type: 'Array', desc: 'errors, e.g. validations error' },
- unless: Proc.new { |proxy| proxy.errors.empty? } { |proxy| proxy.errors.messages }
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement