Sha256: d85c33a02b85ed5e582ad99d63a2c3dd535da948f684c8a3610c008604c4d090

Contents?: true

Size: 1.41 KB

Versions: 22

Compression:

Stored size: 1.41 KB

Contents

require_relative '../service'
module Adyen
{{#operations}}
  class {{classname}} < Service
    attr_accessor :service, :version

    def initialize(client, version = DEFAULT_VERSION)
      super(client, version, '{{#lambda.titlecase}}{{serviceName}}{{/lambda.titlecase}}')
    end

{{#operation}}
    def {{#lambda.snakecase}}{{#vendorExtensions.x-methodName}}{{.}}{{/vendorExtensions.x-methodName}}{{^vendorExtensions.x-methodName}}{{nickname}}{{/vendorExtensions.x-methodName}}{{/lambda.snakecase}}({{#bodyParams}}request, {{/bodyParams}}{{#requiredParams}}{{^isQueryParam}}{{#lambda.snakecase}}{{paramName}}{{/lambda.snakecase}}, {{/isQueryParam}}{{/requiredParams}}headers: {}{{#queryParams}}{{#-first}}, query_params: {}{{/-first}}{{/queryParams}})
      endpoint = '{{path}}'.gsub(/{.+?}/, '%s')
      endpoint = endpoint.gsub(%r{^/}, '')
      endpoint = format(endpoint{{#pathParams}}, {{#lambda.snakecase}}{{paramName}}{{/lambda.snakecase}}{{/pathParams}})
      {{#queryParams}}{{#-first}}endpoint += create_query_string(query_params){{/-first}}{{/queryParams}}
      action = { method: '{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}', url: endpoint }
  {{#bodyParams}}        
      @client.call_adyen_api(@service, action, request, headers, @version)
  {{/bodyParams}}
  {{^bodyParams}}
      @client.call_adyen_api(@service, action, {}, headers, @version)
  {{/bodyParams}}
    end

{{/operation}}
{{/operations}}
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
adyen-ruby-api-library-10.0.0 templates/api.mustache
adyen-ruby-api-library-9.9.0 templates/api.mustache
adyen-ruby-api-library-9.8.0 templates/api.mustache
adyen-ruby-api-library-9.7.1 templates/api.mustache
adyen-ruby-api-library-9.7.0 templates/api.mustache
adyen-ruby-api-library-9.6.0 templates/api.mustache
adyen-ruby-api-library-9.5.2 templates/api.mustache
adyen-ruby-api-library-9.5.1 templates/api.mustache
adyen-ruby-api-library-9.5.0 templates/api.mustache
adyen-ruby-api-library-9.3.0 templates/api.mustache
adyen-ruby-api-library-9.2.0 templates/api.mustache
adyen-ruby-api-library-9.1.0 templates/api.mustache
adyen-ruby-api-library-9.0.0 templates/api.mustache
adyen-ruby-api-library-8.0.1 templates/api.mustache
adyen-ruby-api-library-8.0.0 templates/api.mustache
adyen-ruby-api-library-8.0.0.pre.beta.1 templates/api.mustache
adyen-ruby-api-library-7.3.1 templates/api.mustache
adyen-ruby-api-library-7.3.0 templates/api.mustache
adyen-ruby-api-library-7.2.0 templates/api.mustache
adyen-ruby-api-library-7.1.0 templates/api.mustache