Sha256: 0dcd7467cd1a790a849a2d97865b624700bb11207dcc72eb56528f2f8ce1f4c2

Contents?: true

Size: 1.1 KB

Versions: 8

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

module BingAdsRubySdk
  class WsdlOperationWrapper

    attr_reader :request_namespace_type

    def initialize(parser, operation_name)
      @parser = parser
      @request_namespace_type = parser.operations.fetch(operation_name).fetch(:input).fetch(:body).first
    end

    def ordered_fields_hash(namespace_type)
      # we check types first as its the main source of data, except for the Request type which lives in elements
      if parser.types.fetch(namespace_type, nil)
        parser.types.fetch(namespace_type).fetch(:elements)
      else
        parser.elements.fetch(namespace_type).fetch(:type).fetch(:elements)
      end
    end

    def namespace_and_type_from_name(all_attributes, type_name)
      all_attributes.fetch(type_name).fetch(:type)
    end

    def base_type_name(elements, type_name)
      return nil if type_name == BingAdsRubySdk.type_key
      elements.fetch(type_name).fetch(:base_type_name, type_name)
    end

    def self.prefix_and_name(wsdl, type_name)
      wsdl.types.fetch(type_name).prefix_and_name
    end

    private

    attr_reader :parser
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bing_ads_ruby_sdk-1.3.4 lib/bing_ads_ruby_sdk/wsdl_operation_wrapper.rb
bing_ads_ruby_sdk-1.3.3 lib/bing_ads_ruby_sdk/wsdl_operation_wrapper.rb
bing_ads_ruby_sdk-1.3.2 lib/bing_ads_ruby_sdk/wsdl_operation_wrapper.rb
bing_ads_ruby_sdk-1.3.1 lib/bing_ads_ruby_sdk/wsdl_operation_wrapper.rb
bing_ads_ruby_sdk-1.3.0 lib/bing_ads_ruby_sdk/wsdl_operation_wrapper.rb
bing_ads_ruby_sdk-1.2.0 lib/bing_ads_ruby_sdk/wsdl_operation_wrapper.rb
bing_ads_ruby_sdk-1.1.1 lib/bing_ads_ruby_sdk/wsdl_operation_wrapper.rb
bing_ads_ruby_sdk-1.0.0 lib/bing_ads_ruby_sdk/wsdl_operation_wrapper.rb