Sha256: 4088daf3d50dd698bcd4bcfa2ac90c4ae9fd90ae7f5bdc361f0ae287032d4f8d

Contents?: true

Size: 1.48 KB

Versions: 3

Compression:

Stored size: 1.48 KB

Contents

=begin
{% include "api_info.j2" %}
=end

# Common files
require 'datadog_api_client/version'
require 'datadog_api_client/user_agent'
require '{{ gem_name }}/{{ version }}/api_client'
require '{{ gem_name }}/{{ version }}/api_error'
require '{{ gem_name }}/{{ version }}/configuration'

# Models
require '{{ gem_name }}/{{ version }}/model_base'
{%- for model in models|sort %}
require '{{ gem_name }}/{{ version }}/models/{{ model|snake_case }}'
{%- endfor %}

# APIs
{%- for api in apis|sort %}
require '{{ gem_name }}/{{ version }}/api/{{ api|snake_case }}_api'
{%- endfor %}

module {{ module_name }}::{{ version|upper }}
  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

3 entries across 3 versions & 1 rubygems

Version Path
datadog_api_client-1.11.0 .generator/src/generator/templates/package.j2
datadog_api_client-1.10.0 .generator/src/generator/templates/package.j2
datadog_api_client-1.9.0 .generator/src/generator/templates/package.j2