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-7.0.3 templates/api.mustache
adyen-ruby-api-library-7.0.2 templates/api.mustache