Commit cd0da6a4 authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Stan Hu

Add token, template entities into own class files

parent 5e532c2c
---
title: Separate token and template entities into own class files
merge_request: 24955
author: Rajendra Kadam
type: added
...@@ -657,32 +657,6 @@ module API ...@@ -657,32 +657,6 @@ module API
expose :content expose :content
end 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 class ImpersonationToken < PersonalAccessToken
expose :impersonation expose :impersonation
end 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