Class: AdRoll::Api::Adgroup

Inherits:
Service
  • Object
show all
Defined in:
lib/adroll/adgroup.rb

Class Method Summary collapse

Class Method Details

.add_demographic_target(adgroup:, target_min:, min_age:, target_max:, max_age:) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/adroll/adgroup.rb', line 7

def add_demographic_target(adgroup:, target_min:, min_age:, target_max:, max_age:)
  params = {
    adgroup: adgroup,
    target_min: target_min,
    min_age: min_age,
    target_max: target_max,
    max_age: max_age
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.add_placement_target(adgroup:, placement:) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/adroll/adgroup.rb', line 19

def add_placement_target(adgroup:, placement:)
  params = {
    adgroup: adgroup,
    placement: placement
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.add_platform_target(adgroup:, type:, os:, os_version:, device:) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/adroll/adgroup.rb', line 28

def add_platform_target(adgroup:, type:, os:, os_version:, device:)
  params = {
    adgroup: adgroup,
    type: type,
    os: os,
    os_version: os_version,
    device: device
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.add_segments(adgroup:, segments:, is_negative: nil) ⇒ Object



40
41
42
43
44
45
46
47
48
# File 'lib/adroll/adgroup.rb', line 40

def add_segments(adgroup:, segments:, is_negative: nil)
  params = {
    adgroup: adgroup,
    segments: segments,
    is_negative: is_negative
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.allow_site(ad_format:, site:) ⇒ Object



50
51
52
53
54
55
56
57
# File 'lib/adroll/adgroup.rb', line 50

def allow_site(ad_format:, site:)
  params = {
    ad_format: ad_format,
    site: site
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.approve_ad(adgroup:, ad:) ⇒ Object



59
60
61
62
63
64
65
66
# File 'lib/adroll/adgroup.rb', line 59

def approve_ad(adgroup:, ad:)
  params = {
    adgroup: adgroup,
    ad: ad
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.clone(adgroup:) ⇒ Object



68
69
70
71
72
73
74
# File 'lib/adroll/adgroup.rb', line 68

def clone(adgroup:)
  params = {
    adgroup: adgroup
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.create(campaign:, name: nil, ads: nil, positive_segments: nil, negative_segments: nil, geo_targets:, geo_targets_countries: nil, geo_targets_regions:) ⇒ Object



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/adroll/adgroup.rb', line 76

def create(campaign:, name: nil, ads: nil, positive_segments: nil, negative_segments: nil,
           geo_targets:, geo_targets_countries: nil, geo_targets_regions:)
  params = {
    campaign: campaign,
    name: name,
    ads: ads,
    positive_segments: positive_segments,
    negative_segments: negative_segments,
    geo_targets: geo_targets,
    geo_targets_countries: geo_targets_countries,
    geo_targets_regions: geo_targets_regions
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.deselect_ads(adgroup:, ads:) ⇒ Object



92
93
94
95
96
97
98
99
# File 'lib/adroll/adgroup.rb', line 92

def deselect_ads(adgroup:, ads:)
  params = {
    adgroup: adgroup,
    ads: ads
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.edit(campaign:, name: nil, status: nil, ads: nil, positive_segments: nil, negative_segments: nil, geo_targets:, geo_targets_countries: nil, geo_targets_regions:) ⇒ Object



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/adroll/adgroup.rb', line 101

def edit(campaign:, name: nil, status: nil, ads: nil, positive_segments: nil, negative_segments: nil,
         geo_targets:, geo_targets_countries: nil, geo_targets_regions:)
  params = {
    campaign: campaign,
    name: name,
    status: status,
    ads: ads,
    positive_segments: positive_segments,
    negative_segments: negative_segments,
    geo_targets: geo_targets,
    geo_targets_countries: geo_targets_countries,
    geo_targets_regions: geo_targets_regions
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.exclude_site(ad_format:, site:) ⇒ Object



118
119
120
121
122
123
124
125
# File 'lib/adroll/adgroup.rb', line 118

def exclude_site(ad_format:, site:)
  params = {
    ad_format: ad_format,
    site: site
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.get(adgroup:) ⇒ Object



127
128
129
130
131
132
133
# File 'lib/adroll/adgroup.rb', line 127

def get(adgroup:)
  params = {
    adgroup: adgroup
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.get_ads(adgroup:, is_active: nil, statuses: nil, types: nil, width: nil, height: nil) ⇒ Object



135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/adroll/adgroup.rb', line 135

def get_ads(adgroup:, is_active: nil, statuses: nil, types: nil, width: nil, height: nil)
  params = {
    adgroup: adgroup,
    is_active: is_active,
    statuses: statuses,
    types: types,
    width: width,
    height: height
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.get_geo_targets(adgroup:) ⇒ Object



148
149
150
151
152
153
154
# File 'lib/adroll/adgroup.rb', line 148

def get_geo_targets(adgroup:)
  params = {
    agroup: adgroup
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.pause(adgroup:) ⇒ Object



156
157
158
159
160
161
162
# File 'lib/adroll/adgroup.rb', line 156

def pause(adgroup:)
  params = {
    adgroup: adgroup
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.pause_ad(adgroup:, ad:) ⇒ Object



164
165
166
167
168
169
170
171
# File 'lib/adroll/adgroup.rb', line 164

def pause_ad(adgroup:, ad:)
  params = {
    adgroup: adgroup,
    ad: ad
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.pause_ads(adgroup:, ads:) ⇒ Object



173
174
175
176
177
178
179
180
# File 'lib/adroll/adgroup.rb', line 173

def pause_ads(adgroup:, ads:)
  params = {
    adgroup: adgroup,
    ads: ads
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.remove_placement_target(adgroup:, placement:) ⇒ Object



182
183
184
185
186
187
188
189
# File 'lib/adroll/adgroup.rb', line 182

def remove_placement_target(adgroup:, placement:)
  params = {
    adgroup: adgroup,
    placement: placement
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.remove_platform_target(adgroup:, type:, os:, os_version:, device:) ⇒ Object



191
192
193
194
195
196
197
198
199
200
201
# File 'lib/adroll/adgroup.rb', line 191

def remove_platform_target(adgroup:, type:, os:, os_version:, device:)
  params = {
    adgroup: adgroup,
    type: type,
    os: os,
    os_version: os_version,
    device: device
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.remove_segments(adgroup:, segments:) ⇒ Object



203
204
205
206
207
208
209
210
# File 'lib/adroll/adgroup.rb', line 203

def remove_segments(adgroup:, segments:)
  params = {
    adgroup: adgroup,
    segments: segments
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.select_ads(adgroup:, ads:) ⇒ Object



212
213
214
215
216
217
218
219
# File 'lib/adroll/adgroup.rb', line 212

def select_ads(adgroup:, ads:)
  params = {
    adgroup: adgroup,
    ads: ads
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.unpause(adgroup:) ⇒ Object



221
222
223
224
225
226
227
# File 'lib/adroll/adgroup.rb', line 221

def unpause(adgroup:)
  params = {
    adgroup: adgroup
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.unpause_ad(adgroup:, ad:) ⇒ Object



229
230
231
232
233
234
235
236
# File 'lib/adroll/adgroup.rb', line 229

def unpause_ad(adgroup:, ad:)
  params = {
    adgroup: adgroup,
    ad: ad
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end

.unpause_ads(adgroup:, ads:) ⇒ Object



238
239
240
241
242
243
244
245
# File 'lib/adroll/adgroup.rb', line 238

def unpause_ads(adgroup:, ads:)
  params = {
    adgroup: adgroup,
    ads: ads
  }.reject { |_, value| value.nil? }

  call_api(:get, __method__, params)
end