Commit 417747c9 authored by Stan Hu's avatar Stan Hu

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

Separate page domain entities into own class files

See merge request gitlab-org/gitlab!24987
parents d657d06c d40eaa58
---
title: Separate page domain entities into own class files
merge_request: 24987
author: Rajendra Kadam
type: added
......@@ -249,45 +249,6 @@ module API
expose :expiration
end
class PagesDomainCertificate < Grape::Entity
expose :subject
expose :expired?, as: :expired
expose :certificate
expose :certificate_text
end
class PagesDomainBasic < Grape::Entity
expose :domain
expose :url
expose :project_id
expose :verified?, as: :verified
expose :verification_code, as: :verification_code
expose :enabled_until
expose :auto_ssl_enabled
expose :certificate,
as: :certificate_expiration,
if: ->(pages_domain, _) { pages_domain.certificate? },
using: PagesDomainCertificateExpiration do |pages_domain|
pages_domain
end
end
class PagesDomain < Grape::Entity
expose :domain
expose :url
expose :verified?, as: :verified
expose :verification_code, as: :verification_code
expose :enabled_until
expose :auto_ssl_enabled
expose :certificate,
if: ->(pages_domain, _) { pages_domain.certificate? },
using: PagesDomainCertificate do |pages_domain|
pages_domain
end
end
class Application < Grape::Entity
expose :id
expose :uid, as: :application_id
......
# frozen_string_literal: true
module API
module Entities
class PagesDomain < Grape::Entity
expose :domain
expose :url
expose :verified?, as: :verified
expose :verification_code, as: :verification_code
expose :enabled_until
expose :auto_ssl_enabled
expose :certificate,
if: ->(pages_domain, _) { pages_domain.certificate? },
using: Entities::PagesDomainCertificate do |pages_domain|
pages_domain
end
end
end
end
# frozen_string_literal: true
module API
module Entities
class PagesDomainBasic < Grape::Entity
expose :domain
expose :url
expose :project_id
expose :verified?, as: :verified
expose :verification_code, as: :verification_code
expose :enabled_until
expose :auto_ssl_enabled
expose :certificate,
as: :certificate_expiration,
if: ->(pages_domain, _) { pages_domain.certificate? },
using: Entities::PagesDomainCertificateExpiration do |pages_domain|
pages_domain
end
end
end
end
# frozen_string_literal: true
module API
module Entities
class PagesDomainCertificate < Grape::Entity
expose :subject
expose :expired?, as: :expired
expose :certificate
expose :certificate_text
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