Sha256: 569083e85c9a27f460f2727c27615847e3f60deacb4c1088da2c0d4344432292

Contents?: true

Size: 1.35 KB

Versions: 7

Compression:

Stored size: 1.35 KB

Contents

=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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
datadog_api_client-2.4.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.3.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.2.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.1.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.0.2 .generator/src/generator/templates/package.j2
datadog_api_client-2.0.1 .generator/src/generator/templates/package.j2
datadog_api_client-2.0.0 .generator/src/generator/templates/package.j2