Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/types/container_expiration_policy_cadence_enum.rb')
-rw-r--r--app/graphql/types/container_expiration_policy_cadence_enum.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/graphql/types/container_expiration_policy_cadence_enum.rb b/app/graphql/types/container_expiration_policy_cadence_enum.rb
new file mode 100644
index 00000000000..bb8bdf2197b
--- /dev/null
+++ b/app/graphql/types/container_expiration_policy_cadence_enum.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module Types
+ class ContainerExpirationPolicyCadenceEnum < BaseEnum
+ OPTIONS_MAPPING = {
+ '1d': 'EVERY_DAY',
+ '7d': 'EVERY_WEEK',
+ '14d': 'EVERY_TWO_WEEKS',
+ '1month': 'EVERY_MONTH',
+ '3month': 'EVERY_THREE_MONTHS'
+ }.freeze
+
+ ::ContainerExpirationPolicy.cadence_options.each do |option, description|
+ value OPTIONS_MAPPING[option], description, value: option.to_s
+ end
+ end
+end