Commit 0ecfdd0e authored by Stan Hu's avatar Stan Hu

Merge branch 'refactoring-entities-file-24' into 'master'

Add token, template entities into own class files

See merge request gitlab-org/gitlab!24955
parents 4d118fa0 cd0da6a4
---
title: Separate token and template entities into own class files
merge_request: 24955
author: Rajendra Kadam
type: added
......@@ -391,32 +391,6 @@ module API
expose :content
end
class TemplatesList < Grape::Entity
expose :key
expose :name
end
class Template < Grape::Entity
expose :name, :content
end
class BroadcastMessage < Grape::Entity
expose :id, :message, :starts_at, :ends_at, :color, :font
expose :active?, as: :active
end
class PersonalAccessToken < Grape::Entity
expose :id, :name, :revoked, :created_at, :scopes
expose :active?, as: :active
expose :expires_at do |personal_access_token|
personal_access_token.expires_at ? personal_access_token.expires_at.strftime("%Y-%m-%d") : nil
end
end
class PersonalAccessTokenWithToken < PersonalAccessToken
expose :token
end
class ImpersonationToken < PersonalAccessToken
expose :impersonation
end
......
# frozen_string_literal: true
module API
module Entities
class BroadcastMessage < Grape::Entity
expose :id, :message, :starts_at, :ends_at, :color, :font
expose :active?, as: :active
end
end
end
# frozen_string_literal: true
module API
module Entities
class PersonalAccessToken < Grape::Entity
expose :id, :name, :revoked, :created_at, :scopes
expose :active?, as: :active
expose :expires_at do |personal_access_token|
personal_access_token.expires_at ? personal_access_token.expires_at.strftime("%Y-%m-%d") : nil
end
end
end
end
# frozen_string_literal: true
module API
module Entities
class PersonalAccessTokenWithToken < Entities::PersonalAccessToken
expose :token
end
end
end
# frozen_string_literal: true
module API
module Entities
class Template < Grape::Entity
expose :name, :content
end
end
end
# frozen_string_literal: true
module API
module Entities
class TemplatesList < Grape::Entity
expose :key
expose :name
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment