Sha256: 490be63b604e4b9455422ceeae8a6628a95fc5c7d0f778585355730398e7cf5c

Contents?: true

Size: 1.49 KB

Versions: 22

Compression:

Stored size: 1.49 KB

Contents

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

    DEFAULT_VERSION = {{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-small.mustache
adyen-ruby-api-library-9.9.0 templates/api-small.mustache
adyen-ruby-api-library-9.8.0 templates/api-small.mustache
adyen-ruby-api-library-9.7.1 templates/api-small.mustache
adyen-ruby-api-library-9.7.0 templates/api-small.mustache
adyen-ruby-api-library-9.6.0 templates/api-small.mustache
adyen-ruby-api-library-9.5.2 templates/api-small.mustache
adyen-ruby-api-library-9.5.1 templates/api-small.mustache
adyen-ruby-api-library-9.5.0 templates/api-small.mustache
adyen-ruby-api-library-9.3.0 templates/api-small.mustache
adyen-ruby-api-library-9.2.0 templates/api-small.mustache
adyen-ruby-api-library-9.1.0 templates/api-small.mustache
adyen-ruby-api-library-9.0.0 templates/api-small.mustache
adyen-ruby-api-library-8.0.1 templates/api-small.mustache
adyen-ruby-api-library-8.0.0 templates/api-small.mustache
adyen-ruby-api-library-8.0.0.pre.beta.1 templates/api-small.mustache
adyen-ruby-api-library-7.3.1 templates/api-small.mustache
adyen-ruby-api-library-7.3.0 templates/api-small.mustache
adyen-ruby-api-library-7.2.0 templates/api-small.mustache
adyen-ruby-api-library-7.1.0 templates/api-small.mustache