oass 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/oass.rb
CHANGED
data/lib/oass/client/campaign.rb
CHANGED
@@ -10,17 +10,28 @@ module Oass
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def create_campaign(attributes)
|
13
|
+
create_or_update_campaign("add", attributes)
|
14
|
+
end
|
15
|
+
|
16
|
+
def update_campaign(attributes)
|
17
|
+
create_or_update_campaign("update", attributes)
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def create_or_update_campaign(action, attributes)
|
13
23
|
request "Campaign" do |xml|
|
14
|
-
xml.Campaign(:action =>
|
24
|
+
xml.Campaign(:action => action) do
|
15
25
|
xml.Overview do
|
16
26
|
# Yeah... the attributes must be in the right order =/
|
17
27
|
xml.Id attributes[:id]
|
18
|
-
xml.AdvertiserId attributes[:advertiser_id]
|
19
|
-
xml.Name attributes[:name]
|
20
|
-
xml.AgencyId attributes[:agency_id]
|
28
|
+
xml.AdvertiserId attributes[:advertiser_id] if attributes[:advertiser_id]
|
29
|
+
xml.Name attributes[:name] if attributes[:name]
|
30
|
+
xml.AgencyId attributes[:agency_id] if attributes[:agency_id]
|
21
31
|
xml.Description attributes[:description] if attributes[:description]
|
22
32
|
xml.CampaignManager attributes[:campaign_manager] if attributes[:campaign_manager]
|
23
33
|
xml.ProductId attributes[:product_id]
|
34
|
+
xml.Status attributes[:status] if attributes[:status]
|
24
35
|
xml.ExternalUsers do
|
25
36
|
attributes[:external_users].each do |user_id|
|
26
37
|
xml.UserId user_id
|
@@ -102,5 +113,6 @@ module Oass
|
|
102
113
|
end
|
103
114
|
end
|
104
115
|
end
|
116
|
+
|
105
117
|
end
|
106
118
|
end
|
data/lib/oass/version.rb
CHANGED
@@ -23,6 +23,61 @@
|
|
23
23
|
</Request>
|
24
24
|
</AdXML>
|
25
25
|
</String_4></n1:OasXmlRequest></env:Body></env:Envelope>
|
26
|
+
headers:
|
27
|
+
content-type:
|
28
|
+
- text/xml;charset=UTF-8
|
29
|
+
soapaction:
|
30
|
+
- "\"OasXmlRequest\""
|
31
|
+
response: !ruby/struct:VCR::Response
|
32
|
+
status: !ruby/struct:VCR::ResponseStatus
|
33
|
+
code: 200
|
34
|
+
message: OK
|
35
|
+
headers:
|
36
|
+
x-powered-by:
|
37
|
+
- Servlet 2.5; JBoss-5.0/JBossWeb-2.1
|
38
|
+
p3p:
|
39
|
+
- CP="NON NID PSAa PSDa OUR IND UNI COM NAV STA",policyref="/w3c/p3p.xml"
|
40
|
+
content-type:
|
41
|
+
- text/xml;charset=UTF-8
|
42
|
+
via:
|
43
|
+
- 1.1 training7.247realmedia.com
|
44
|
+
server:
|
45
|
+
- Apache-Coyote/1.1
|
46
|
+
date:
|
47
|
+
- Thu, 26 May 2011 01:29:55 GMT
|
48
|
+
transfer-encoding:
|
49
|
+
- chunked
|
50
|
+
body: |-
|
51
|
+
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:OasXmlRequestResponse xmlns:ns1="http://api.oas.tfsm.com/"><result><?xml version='1.0'?>
|
52
|
+
<AdXML>
|
53
|
+
|
54
|
+
<Response>
|
55
|
+
<Campaign>
|
56
|
+
<Exception errorCode='505'> is an invalid value for Id</Exception>
|
57
|
+
</Campaign>
|
58
|
+
</Response>
|
59
|
+
</AdXML></result></ns1:OasXmlRequestResponse></soapenv:Body></soapenv:Envelope>
|
60
|
+
http_version: "1.1"
|
61
|
+
- !ruby/struct:VCR::HTTPInteraction
|
62
|
+
request: !ruby/struct:VCR::Request
|
63
|
+
method: :post
|
64
|
+
uri: https://training7.247realmedia.com:443/oasapi/OaxApi
|
65
|
+
body: |-
|
66
|
+
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:n1="http://api.oas.tfsm.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><n1:OasXmlRequest xmlns:n1="http://api.oas.tfsm.com/"><String_1>Abril</String_1><String_2>dev_abril</String_2><String_3>d3v@p1SgpD</String_3><String_4><?xml version="1.0" encoding="UTF-8"?>
|
67
|
+
<AdXML>
|
68
|
+
<Request type="Campaign">
|
69
|
+
<Campaign action="add">
|
70
|
+
<Overview>
|
71
|
+
<Id></Id>
|
72
|
+
<AdvertiserId></AdvertiserId>
|
73
|
+
<Name></Name>
|
74
|
+
<AgencyId></AgencyId>
|
75
|
+
<ProductId></ProductId>
|
76
|
+
</Overview>
|
77
|
+
</Campaign>
|
78
|
+
</Request>
|
79
|
+
</AdXML>
|
80
|
+
</String_4></n1:OasXmlRequest></env:Body></env:Envelope>
|
26
81
|
headers:
|
27
82
|
soapaction:
|
28
83
|
- "\"OasXmlRequest\""
|
@@ -42,7 +97,7 @@
|
|
42
97
|
content-type:
|
43
98
|
- text/xml;charset=UTF-8
|
44
99
|
date:
|
45
|
-
-
|
100
|
+
- Fri, 27 May 2011 13:02:16 GMT
|
46
101
|
server:
|
47
102
|
- Apache-Coyote/1.1
|
48
103
|
transfer-encoding:
|
@@ -69,9 +124,6 @@
|
|
69
124
|
<Campaign action="add">
|
70
125
|
<Overview>
|
71
126
|
<Id></Id>
|
72
|
-
<AdvertiserId></AdvertiserId>
|
73
|
-
<Name></Name>
|
74
|
-
<AgencyId></AgencyId>
|
75
127
|
<ProductId></ProductId>
|
76
128
|
</Overview>
|
77
129
|
</Campaign>
|
@@ -99,7 +151,7 @@
|
|
99
151
|
server:
|
100
152
|
- Apache-Coyote/1.1
|
101
153
|
date:
|
102
|
-
-
|
154
|
+
- Wed, 01 Jun 2011 19:20:51 GMT
|
103
155
|
transfer-encoding:
|
104
156
|
- chunked
|
105
157
|
body: |-
|
@@ -2431,6 +2431,161 @@
|
|
2431
2431
|
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:OasXmlRequestResponse xmlns:ns1="http://api.oas.tfsm.com/"><result><?xml version='1.0'?>
|
2432
2432
|
<AdXML>
|
2433
2433
|
|
2434
|
+
<Response>
|
2435
|
+
<Campaign>Successfully added.</Campaign>
|
2436
|
+
</Response>
|
2437
|
+
</AdXML></result></ns1:OasXmlRequestResponse></soapenv:Body></soapenv:Envelope>
|
2438
|
+
http_version: "1.1"
|
2439
|
+
- !ruby/struct:VCR::HTTPInteraction
|
2440
|
+
request: !ruby/struct:VCR::Request
|
2441
|
+
method: :post
|
2442
|
+
uri: https://training7.247realmedia.com:443/oasapi/OaxApi
|
2443
|
+
body: |-
|
2444
|
+
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:n1="http://api.oas.tfsm.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><n1:OasXmlRequest xmlns:n1="http://api.oas.tfsm.com/"><String_1>Abril</String_1><String_2>dev_abril</String_2><String_3>d3v@p1SgpD</String_3><String_4><?xml version="1.0" encoding="UTF-8"?>
|
2445
|
+
<AdXML>
|
2446
|
+
<Request type="Campaign">
|
2447
|
+
<Campaign action="add">
|
2448
|
+
<Overview>
|
2449
|
+
<Id>jdocapvxtklqfnbrzhgsyieumw</Id>
|
2450
|
+
<AdvertiserId>bobo</AdvertiserId>
|
2451
|
+
<Name>LOLWUT</Name>
|
2452
|
+
<AgencyId>unknown_agency</AgencyId>
|
2453
|
+
<ProductId>default-product</ProductId>
|
2454
|
+
</Overview>
|
2455
|
+
<Schedule>
|
2456
|
+
<Impressions>999</Impressions>
|
2457
|
+
<Clicks>0</Clicks>
|
2458
|
+
<PriorityLevel>1</PriorityLevel>
|
2459
|
+
<Completion>S</Completion>
|
2460
|
+
<Reach>O</Reach>
|
2461
|
+
<SmoothOrAsap>S</SmoothOrAsap>
|
2462
|
+
</Schedule>
|
2463
|
+
</Campaign>
|
2464
|
+
</Request>
|
2465
|
+
</AdXML>
|
2466
|
+
</String_4></n1:OasXmlRequest></env:Body></env:Envelope>
|
2467
|
+
headers:
|
2468
|
+
soapaction:
|
2469
|
+
- "\"OasXmlRequest\""
|
2470
|
+
content-type:
|
2471
|
+
- text/xml;charset=UTF-8
|
2472
|
+
response: !ruby/struct:VCR::Response
|
2473
|
+
status: !ruby/struct:VCR::ResponseStatus
|
2474
|
+
code: 200
|
2475
|
+
message: OK
|
2476
|
+
headers:
|
2477
|
+
x-powered-by:
|
2478
|
+
- Servlet 2.5; JBoss-5.0/JBossWeb-2.1
|
2479
|
+
p3p:
|
2480
|
+
- CP="NON NID PSAa PSDa OUR IND UNI COM NAV STA",policyref="/w3c/p3p.xml"
|
2481
|
+
via:
|
2482
|
+
- 1.1 training7.247realmedia.com
|
2483
|
+
content-type:
|
2484
|
+
- text/xml;charset=UTF-8
|
2485
|
+
date:
|
2486
|
+
- Wed, 01 Jun 2011 19:20:47 GMT
|
2487
|
+
server:
|
2488
|
+
- Apache-Coyote/1.1
|
2489
|
+
transfer-encoding:
|
2490
|
+
- chunked
|
2491
|
+
body: |-
|
2492
|
+
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:OasXmlRequestResponse xmlns:ns1="http://api.oas.tfsm.com/"><result><?xml version='1.0'?>
|
2493
|
+
<AdXML>
|
2494
|
+
|
2495
|
+
<Response>
|
2496
|
+
<Campaign>Successfully added.</Campaign>
|
2497
|
+
</Response>
|
2498
|
+
</AdXML></result></ns1:OasXmlRequestResponse></soapenv:Body></soapenv:Envelope>
|
2499
|
+
http_version: "1.1"
|
2500
|
+
- !ruby/struct:VCR::HTTPInteraction
|
2501
|
+
request: !ruby/struct:VCR::Request
|
2502
|
+
method: :post
|
2503
|
+
uri: https://training7.247realmedia.com:443/oasapi/OaxApi
|
2504
|
+
body: |-
|
2505
|
+
<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:n1="http://api.oas.tfsm.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><n1:OasXmlRequest xmlns:n1="http://api.oas.tfsm.com/"><String_1>Abril</String_1><String_2>dev_abril</String_2><String_3>d3v@p1SgpD</String_3><String_4><?xml version="1.0" encoding="UTF-8"?>
|
2506
|
+
<AdXML>
|
2507
|
+
<Request type="Campaign">
|
2508
|
+
<Campaign action="add">
|
2509
|
+
<Overview>
|
2510
|
+
<Id>gdyfonbvijlxcpsweahtuqkmrz</Id>
|
2511
|
+
<AdvertiserId>bobo</AdvertiserId>
|
2512
|
+
<Name>LOLWUT</Name>
|
2513
|
+
<AgencyId>unknown_agency</AgencyId>
|
2514
|
+
<Description>lolwut</Description>
|
2515
|
+
<CampaignManager>lol</CampaignManager>
|
2516
|
+
<ProductId>default-product</ProductId>
|
2517
|
+
<InternalQuickReport>short</InternalQuickReport>
|
2518
|
+
<ExternalQuickReport>short</ExternalQuickReport>
|
2519
|
+
</Overview>
|
2520
|
+
<Schedule>
|
2521
|
+
<Impressions>999</Impressions>
|
2522
|
+
<Clicks>0</Clicks>
|
2523
|
+
<Uniques>0</Uniques>
|
2524
|
+
<Weight>10</Weight>
|
2525
|
+
<PriorityLevel>1</PriorityLevel>
|
2526
|
+
<Completion>E</Completion>
|
2527
|
+
<StartDate>2005-12-01</StartDate>
|
2528
|
+
<EndDate>2040-12-01</EndDate>
|
2529
|
+
<Reach>O</Reach>
|
2530
|
+
<DailyImp>99</DailyImp>
|
2531
|
+
<DailyClicks>9</DailyClicks>
|
2532
|
+
<DailyUniq>1</DailyUniq>
|
2533
|
+
<SmoothOrAsap>S</SmoothOrAsap>
|
2534
|
+
<ImpOverrun>2</ImpOverrun>
|
2535
|
+
<CompanionPositions>
|
2536
|
+
<CompanionPosition>B/T</CompanionPosition>
|
2537
|
+
<CompanionPosition>BL/TL</CompanionPosition>
|
2538
|
+
</CompanionPositions>
|
2539
|
+
<StrictCompanions>Y</StrictCompanions>
|
2540
|
+
<HourOfDay>
|
2541
|
+
<Hour>00</Hour>
|
2542
|
+
<Hour>01</Hour>
|
2543
|
+
<Hour>23</Hour>
|
2544
|
+
</HourOfDay>
|
2545
|
+
<DayOfWeek>
|
2546
|
+
<Day>2</Day>
|
2547
|
+
<Day>3</Day>
|
2548
|
+
<Day>4</Day>
|
2549
|
+
<Day>5</Day>
|
2550
|
+
</DayOfWeek>
|
2551
|
+
<UserTimeZone>Y</UserTimeZone>
|
2552
|
+
<Sections>
|
2553
|
+
<SectionId>SectionABC</SectionId>
|
2554
|
+
<SectionId>SectionDEF</SectionId>
|
2555
|
+
</Sections>
|
2556
|
+
</Schedule>
|
2557
|
+
</Campaign>
|
2558
|
+
</Request>
|
2559
|
+
</AdXML>
|
2560
|
+
</String_4></n1:OasXmlRequest></env:Body></env:Envelope>
|
2561
|
+
headers:
|
2562
|
+
content-type:
|
2563
|
+
- text/xml;charset=UTF-8
|
2564
|
+
soapaction:
|
2565
|
+
- "\"OasXmlRequest\""
|
2566
|
+
response: !ruby/struct:VCR::Response
|
2567
|
+
status: !ruby/struct:VCR::ResponseStatus
|
2568
|
+
code: 200
|
2569
|
+
message: OK
|
2570
|
+
headers:
|
2571
|
+
x-powered-by:
|
2572
|
+
- Servlet 2.5; JBoss-5.0/JBossWeb-2.1
|
2573
|
+
p3p:
|
2574
|
+
- CP="NON NID PSAa PSDa OUR IND UNI COM NAV STA",policyref="/w3c/p3p.xml"
|
2575
|
+
content-type:
|
2576
|
+
- text/xml;charset=UTF-8
|
2577
|
+
via:
|
2578
|
+
- 1.1 training7.247realmedia.com
|
2579
|
+
server:
|
2580
|
+
- Apache-Coyote/1.1
|
2581
|
+
date:
|
2582
|
+
- Wed, 01 Jun 2011 19:20:49 GMT
|
2583
|
+
transfer-encoding:
|
2584
|
+
- chunked
|
2585
|
+
body: |-
|
2586
|
+
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:OasXmlRequestResponse xmlns:ns1="http://api.oas.tfsm.com/"><result><?xml version='1.0'?>
|
2587
|
+
<AdXML>
|
2588
|
+
|
2434
2589
|
<Response>
|
2435
2590
|
<Campaign>Successfully added.</Campaign>
|
2436
2591
|
</Response>
|
metadata
CHANGED