=begin {% include "api_info.j2" %} =end # Common files require 'datadog_api_client/version' require 'datadog_api_client/user_agent' require '{{ gem_name }}/api_client' require '{{ gem_name }}/configuration' require '{{ gem_name }}/api_key_configuration' # Model base ## Load in the model_base modules which also initializes the V1 and V2 namespaces {%- for version, models in all_models.items() %} require '{{ gem_name }}/{{ version }}/model_base' {%- endfor %} module {{ module_name }} class << self # Customize default settings for the SDK using block. # {{ module_name }}::{{ version|upper }}.configure do |config| # config.username = "xxx" # config.password = "xxx" # end # If no block given, return the default Configuration object. def configure if block_given? yield(Configuration.default) else Configuration.default end end end class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values def initialize(datatype, allowable_values) @allowable_values = allowable_values.map do |value| case datatype.to_s when /Integer/i value.to_i when /Float/i value.to_f else value end end end def valid?(value) !value || allowable_values.include?(value) end end end