module AdWords require 'adwords4r/v3/CampaignService' require 'soap/rpc/driver' class CampaignService < ::SOAP::RPC::Driver DefaultEndpointUrl = "https://adwords.google.com/api/adwords/v3/CampaignService" MappingRegistry = ::SOAP::Mapping::Registry.new Methods = [ [ "", "getCampaign", [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "getCampaign"], true], ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "getCampaignResponse"], true] ], { :request_style => :document, :request_use => :literal, :response_style => :document, :response_use => :literal } ], [ "", "getCampaignList", [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "getCampaignList"], true], ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "getCampaignListResponse"], true] ], { :request_style => :document, :request_use => :literal, :response_style => :document, :response_use => :literal } ], [ "", "getAllAdWordsCampaigns", [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "getAllAdWordsCampaigns"], true], ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "getAllAdWordsCampaignsResponse"], true] ], { :request_style => :document, :request_use => :literal, :response_style => :document, :response_use => :literal } ], [ "", "addCampaign", [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "addCampaign"], true], ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "addCampaignResponse"], true] ], { :request_style => :document, :request_use => :literal, :response_style => :document, :response_use => :literal } ], [ "", "addCampaignList", [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "addCampaignList"], true], ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "addCampaignListResponse"], true] ], { :request_style => :document, :request_use => :literal, :response_style => :document, :response_use => :literal } ], [ "", "updateCampaign", [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "updateCampaign"], true], ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "updateCampaignResponse"], true] ], { :request_style => :document, :request_use => :literal, :response_style => :document, :response_use => :literal } ], [ "", "updateCampaignList", [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "updateCampaignList"], true], ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "updateCampaignListResponse"], true] ], { :request_style => :document, :request_use => :literal, :response_style => :document, :response_use => :literal } ], [ "", "getOptimizeAdServing", [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "getOptimizeAdServing"], true], ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "getOptimizeAdServingResponse"], true] ], { :request_style => :document, :request_use => :literal, :response_style => :document, :response_use => :literal } ], [ "", "setOptimizeAdServing", [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "setOptimizeAdServing"], true], ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "setOptimizeAdServingResponse"], true] ], { :request_style => :document, :request_use => :literal, :response_style => :document, :response_use => :literal } ], [ "", "getCampaignStats", [ ["in", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "getCampaignStats"], true], ["out", "parameters", ["::SOAP::SOAPElement", "https://adwords.google.com/api/adwords/v3", "getCampaignStatsResponse"], true] ], { :request_style => :document, :request_use => :literal, :response_style => :document, :response_use => :literal } ] ] def initialize(endpoint_url = nil) endpoint_url ||= DefaultEndpointUrl super(endpoint_url, nil) self.mapping_registry = MappingRegistry 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