voucherifyio/voucherify-ruby-sdk

View on GitHub
lib/VoucherifySdk/models/export_publication_fields.rb

Summary

Maintainability
A
1 hr
Test Coverage
=begin
#Voucherify API

#Voucherify promotion engine REST API. Please see https://docs.voucherify.io/docs for more details.

The version of the OpenAPI document: v2018-08-01
Contact: support@voucherify.io
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 7.0.1

=end

require 'date'
require 'time'

module VoucherifySdk
  class ExportPublicationFields
    VOUCHER_CODE = "voucher_code".freeze
    CUSTOMER_ID = "customer_id".freeze
    CUSTOMER_SOURCE_ID = "customer_source_id".freeze
    DATE = "date".freeze
    CHANNEL = "channel".freeze
    CAMPAIGN = "campaign".freeze
    IS_WINNER = "is_winner".freeze
    METADATA = "metadata".freeze

    def self.all_vars
      @all_vars ||= [VOUCHER_CODE, CUSTOMER_ID, CUSTOMER_SOURCE_ID, DATE, CHANNEL, CAMPAIGN, IS_WINNER, METADATA].freeze
    end

    # Builds the enum from string
    # @param [String] The enum value in the form of the string
    # @return [String] The enum value
    def self.build_from_hash(value)
      new.build_from_hash(value)
    end

    # Builds the enum from string
    # @param [String] The enum value in the form of the string
    # @return [String] The enum value
    def build_from_hash(value)
      return value if ExportPublicationFields.all_vars.include?(value)
      raise "Invalid ENUM value #{value} for class #ExportPublicationFields"
    end
  end
end