2020-08-13 14:10:36 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
|
|
|
module Entities
|
|
|
|
module Ci
|
|
|
|
class Variable < Grape::Entity
|
2022-11-07 10:11:00 -05:00
|
|
|
expose :variable_type, documentation: { type: 'string', example: 'env_var' }
|
|
|
|
expose :key, documentation: { type: 'string', example: 'TEST_VARIABLE_1' }
|
|
|
|
expose :value, documentation: { type: 'string', example: 'TEST_1' }
|
|
|
|
expose :protected?, as: :protected, if: -> (entity, _) { entity.respond_to?(:protected?) },
|
|
|
|
documentation: { type: 'boolean' }
|
|
|
|
expose :masked?, as: :masked, if: -> (entity, _) { entity.respond_to?(:masked?) },
|
|
|
|
documentation: { type: 'boolean' }
|
2022-11-08 13:11:09 -05:00
|
|
|
expose :raw?, as: :raw, if: -> (entity, _) { entity.respond_to?(:raw?) }, documentation: { type: 'boolean' }
|
2022-11-07 10:11:00 -05:00
|
|
|
expose :environment_scope, if: -> (entity, _) { entity.respond_to?(:environment_scope) },
|
|
|
|
documentation: { type: 'string', example: '*' }
|
2020-08-13 14:10:36 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|