Sha256: 9328249bb3da79f4c82143c603376097b536551547d8b785880707351eb79852

Contents?: true

Size: 1.3 KB

Versions: 24

Compression:

Stored size: 1.3 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'

# 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

24 entries across 24 versions & 1 rubygems

Version Path
datadog_api_client-2.28.1 .generator/src/generator/templates/package.j2
datadog_api_client-2.27.1 .generator/src/generator/templates/package.j2
datadog_api_client-2.26.1 .generator/src/generator/templates/package.j2
datadog_api_client-2.26.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.25.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.24.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.22.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.21.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.20.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.19.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.18.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.17.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.16.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.15.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.14.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.13.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.12.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.11.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.10.0 .generator/src/generator/templates/package.j2
datadog_api_client-2.9.0 .generator/src/generator/templates/package.j2