require 'ysm4r/v1/ForecastServiceMappingRegistry' module YSM::ForecastService require 'soap/rpc/driver' class ForecastService < ::SOAP::RPC::Driver DefaultEndpointUrl = "https://USE_ADDRESS_RETURNED_BY_LOCATION_SERVICE/services/V1/ForecastService" Methods = [ [ "", "getForecastByAdGroup", [ ["in", "parameters", ["::SOAP::SOAPElement", "http://marketing.ews.yahooapis.com/V1", "getForecastByAdGroup"]], ["out", "parameters", ["::SOAP::SOAPElement", "http://marketing.ews.yahooapis.com/V1", "getForecastByAdGroupResponse"]] ], { :request_style => :document, :request_use => :literal, :response_style => :document, :response_use => :literal, :faults => {"YSM::ForecastService::ApiFault"=>{:name=>"ApiFault", :encodingstyle=>"document", :namespace=>nil, :ns=>"http://marketing.ews.yahooapis.com/V1", :use=>"literal"}} } ], [ "", "getForecastForKeyword", [ ["in", "parameters", ["::SOAP::SOAPElement", "http://marketing.ews.yahooapis.com/V1", "getForecastForKeyword"]], ["out", "parameters", ["::SOAP::SOAPElement", "http://marketing.ews.yahooapis.com/V1", "getForecastForKeywordResponse"]] ], { :request_style => :document, :request_use => :literal, :response_style => :document, :response_use => :literal, :faults => {"YSM::ForecastService::ApiFault"=>{:name=>"ApiFault", :encodingstyle=>"document", :namespace=>nil, :ns=>"http://marketing.ews.yahooapis.com/V1", :use=>"literal"}} } ], [ "", "getForecastForKeywords", [ ["in", "parameters", ["::SOAP::SOAPElement", "http://marketing.ews.yahooapis.com/V1", "getForecastForKeywords"]], ["out", "parameters", ["::SOAP::SOAPElement", "http://marketing.ews.yahooapis.com/V1", "getForecastForKeywordsResponse"]] ], { :request_style => :document, :request_use => :literal, :response_style => :document, :response_use => :literal, :faults => {"YSM::ForecastService::ApiFault"=>{:name=>"ApiFault", :encodingstyle=>"document", :namespace=>nil, :ns=>"http://marketing.ews.yahooapis.com/V1", :use=>"literal"}} } ] ] def initialize(endpoint_url = nil) endpoint_url ||= DefaultEndpointUrl super(endpoint_url, nil) self.mapping_registry = DefaultMappingRegistry::EncodedRegistry self.literal_mapping_registry = DefaultMappingRegistry::LiteralRegistry init_methods end private def init_methods Methods.each do |definitions| opt = definitions.last if opt[:request_style] == :document add_document_operation(*definitions) else add_rpc_operation(*definitions) qname = definitions[0] name = definitions[2] if qname.name != name and qname.name.capitalize == name.capitalize ::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg| __send__(name, *arg) end end end end end end end