google-adx-buyer-api 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +201 -0
- data/ChangeLog +2 -0
- data/README +208 -0
- data/Rakefile +50 -0
- data/examples/v201003/add_ad_group.rb +98 -0
- data/examples/v201003/add_ad_group_criteria.rb +100 -0
- data/examples/v201003/add_ads.rb +110 -0
- data/examples/v201003/add_campaign.rb +101 -0
- data/examples/v201003/add_negative_campaign_criterion.rb +95 -0
- data/examples/v201003/add_placement_performance_report_definition.rb +108 -0
- data/examples/v201003/check_campaigns.rb +132 -0
- data/examples/v201003/delete_ad.rb +94 -0
- data/examples/v201003/delete_ad_group.rb +86 -0
- data/examples/v201003/delete_ad_group_criterion.rb +95 -0
- data/examples/v201003/delete_campaign.rb +87 -0
- data/examples/v201003/download_report.rb +71 -0
- data/examples/v201003/get_all_active_ad_group_criteria.rb +93 -0
- data/examples/v201003/get_all_ad_group_criteria.rb +91 -0
- data/examples/v201003/get_all_ad_groups.rb +88 -0
- data/examples/v201003/get_all_ads.rb +91 -0
- data/examples/v201003/get_all_campaign_targets.rb +83 -0
- data/examples/v201003/get_all_campaigns.rb +83 -0
- data/examples/v201003/get_all_disapproved_ads.rb +94 -0
- data/examples/v201003/get_all_images.rb +88 -0
- data/examples/v201003/get_all_paused_campaigns.rb +86 -0
- data/examples/v201003/get_all_report_definitions.rb +84 -0
- data/examples/v201003/get_criterion_bid_landscape.rb +105 -0
- data/examples/v201003/get_geo_location_info.rb +108 -0
- data/examples/v201003/get_related_placements.rb +111 -0
- data/examples/v201003/get_report_fields.rb +81 -0
- data/examples/v201003/perform_bulk_mutate_job.rb +222 -0
- data/examples/v201003/set_campaign_targets.rb +124 -0
- data/examples/v201003/update_ad.rb +95 -0
- data/examples/v201003/update_ad_group.rb +90 -0
- data/examples/v201003/update_ad_group_criterion.rb +108 -0
- data/examples/v201003/update_campaign.rb +92 -0
- data/examples/v201003/upload_image.rb +97 -0
- data/examples/v201008/add_ad_group.rb +98 -0
- data/examples/v201008/add_ad_group_criteria.rb +100 -0
- data/examples/v201008/add_ads.rb +110 -0
- data/examples/v201008/add_campaign.rb +101 -0
- data/examples/v201008/add_experiment.rb +162 -0
- data/examples/v201008/add_negative_campaign_criterion.rb +95 -0
- data/examples/v201008/add_placement_performance_report_definition.rb +108 -0
- data/examples/v201008/add_user_list.rb +96 -0
- data/examples/v201008/check_campaigns.rb +132 -0
- data/examples/v201008/delete_ad.rb +94 -0
- data/examples/v201008/delete_ad_group.rb +86 -0
- data/examples/v201008/delete_ad_group_criterion.rb +95 -0
- data/examples/v201008/delete_bulk_mutate_job.rb +96 -0
- data/examples/v201008/delete_campaign.rb +87 -0
- data/examples/v201008/delete_experiment.rb +87 -0
- data/examples/v201008/delete_user_list.rb +87 -0
- data/examples/v201008/download_report.rb +71 -0
- data/examples/v201008/get_all_account_changes.rb +144 -0
- data/examples/v201008/get_all_active_ad_group_criteria.rb +93 -0
- data/examples/v201008/get_all_ad_group_criteria.rb +91 -0
- data/examples/v201008/get_all_ad_groups.rb +88 -0
- data/examples/v201008/get_all_ads.rb +91 -0
- data/examples/v201008/get_all_campaign_targets.rb +83 -0
- data/examples/v201008/get_all_campaigns.rb +83 -0
- data/examples/v201008/get_all_disapproved_ads.rb +94 -0
- data/examples/v201008/get_all_experiments.rb +93 -0
- data/examples/v201008/get_all_images.rb +88 -0
- data/examples/v201008/get_all_paused_campaigns.rb +86 -0
- data/examples/v201008/get_all_report_definitions.rb +84 -0
- data/examples/v201008/get_all_user_lists.rb +84 -0
- data/examples/v201008/get_bulk_mutate_job.rb +106 -0
- data/examples/v201008/get_campaign_alerts.rb +103 -0
- data/examples/v201008/get_criterion_bid_landscape.rb +105 -0
- data/examples/v201008/get_geo_location_info.rb +108 -0
- data/examples/v201008/get_related_placements.rb +114 -0
- data/examples/v201008/get_report_fields.rb +81 -0
- data/examples/v201008/perform_bulk_mutate_job.rb +222 -0
- data/examples/v201008/promote_experiment.rb +88 -0
- data/examples/v201008/set_campaign_targets.rb +124 -0
- data/examples/v201008/update_ad.rb +95 -0
- data/examples/v201008/update_ad_group.rb +90 -0
- data/examples/v201008/update_ad_group_criterion.rb +108 -0
- data/examples/v201008/update_campaign.rb +93 -0
- data/examples/v201008/update_user_list.rb +91 -0
- data/examples/v201008/upload_image.rb +97 -0
- data/examples/v201101/add_ad_group.rb +98 -0
- data/examples/v201101/add_ad_group_criteria.rb +100 -0
- data/examples/v201101/add_ads.rb +110 -0
- data/examples/v201101/add_campaign.rb +108 -0
- data/examples/v201101/add_conversion.rb +97 -0
- data/examples/v201101/add_experiment.rb +162 -0
- data/examples/v201101/add_negative_campaign_criterion.rb +95 -0
- data/examples/v201101/add_placement_performance_report_definition.rb +108 -0
- data/examples/v201101/add_rtb_campaign.rb +113 -0
- data/examples/v201101/add_user_list.rb +122 -0
- data/examples/v201101/check_campaigns.rb +132 -0
- data/examples/v201101/delete_ad.rb +94 -0
- data/examples/v201101/delete_ad_group.rb +86 -0
- data/examples/v201101/delete_ad_group_criterion.rb +95 -0
- data/examples/v201101/delete_bulk_mutate_job.rb +96 -0
- data/examples/v201101/delete_campaign.rb +87 -0
- data/examples/v201101/delete_experiment.rb +87 -0
- data/examples/v201101/delete_user_list.rb +87 -0
- data/examples/v201101/download_report.rb +71 -0
- data/examples/v201101/get_ad_group_bid_landscape.rb +103 -0
- data/examples/v201101/get_all_account_changes.rb +146 -0
- data/examples/v201101/get_all_active_ad_group_criteria.rb +106 -0
- data/examples/v201101/get_all_ad_group_criteria.rb +97 -0
- data/examples/v201101/get_all_ad_groups.rb +94 -0
- data/examples/v201101/get_all_ads.rb +99 -0
- data/examples/v201101/get_all_campaign_targets.rb +83 -0
- data/examples/v201101/get_all_campaigns.rb +86 -0
- data/examples/v201101/get_all_conversions.rb +88 -0
- data/examples/v201101/get_all_disapproved_ads.rb +102 -0
- data/examples/v201101/get_all_experiments.rb +98 -0
- data/examples/v201101/get_all_images.rb +90 -0
- data/examples/v201101/get_all_paused_campaigns.rb +92 -0
- data/examples/v201101/get_all_report_definitions.rb +84 -0
- data/examples/v201101/get_all_user_lists.rb +87 -0
- data/examples/v201101/get_bulk_mutate_job.rb +106 -0
- data/examples/v201101/get_campaign_alerts.rb +103 -0
- data/examples/v201101/get_criterion_bid_landscape.rb +102 -0
- data/examples/v201101/get_geo_location_info.rb +108 -0
- data/examples/v201101/get_related_placements.rb +114 -0
- data/examples/v201101/get_report_fields.rb +81 -0
- data/examples/v201101/perform_bulk_mutate_job.rb +222 -0
- data/examples/v201101/promote_experiment.rb +88 -0
- data/examples/v201101/set_campaign_targets.rb +111 -0
- data/examples/v201101/update_ad.rb +95 -0
- data/examples/v201101/update_ad_group.rb +90 -0
- data/examples/v201101/update_ad_group_criterion.rb +108 -0
- data/examples/v201101/update_campaign.rb +93 -0
- data/examples/v201101/update_conversion.rb +96 -0
- data/examples/v201101/update_user_list.rb +91 -0
- data/examples/v201101/upload_image.rb +97 -0
- metadata +208 -0
data/COPYING
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright 2011 Google Inc.
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
data/ChangeLog
ADDED
data/README
ADDED
@@ -0,0 +1,208 @@
|
|
1
|
+
= Google AdWords and DoubleClick Ad Exchange Buyer Client Library
|
2
|
+
|
3
|
+
Welcome to the next generation Google-developed Ruby client library for the
|
4
|
+
AdWords and DoubleClick Ad Exchange Buyer API!
|
5
|
+
|
6
|
+
Please note that this is an early PREVIEW of the client library, still under
|
7
|
+
development.
|
8
|
+
|
9
|
+
It contains full support for v13, v200909, v201003, v201008 and v201101, with
|
10
|
+
full stubs, and a simplified programming interface that lets you handle
|
11
|
+
everything in native Ruby collections, instead of forcing you to deal with SOAP
|
12
|
+
library-generated objects.
|
13
|
+
|
14
|
+
|
15
|
+
= Docs for Users
|
16
|
+
|
17
|
+
== 1 - Installation:
|
18
|
+
|
19
|
+
google-adwords-api and google-adx-buyer-api are ruby gems.
|
20
|
+
See http://docs.rubygems.org/read/book/1
|
21
|
+
|
22
|
+
Install them using the gem install command:
|
23
|
+
$ gem install --remote google-adwords-api
|
24
|
+
$ gem install --remote google-adx-buyer-api
|
25
|
+
|
26
|
+
Please note the google-adx-buyer-api gem contains only DoubleClick Ad Exchange
|
27
|
+
Buyer client library examples. You need the AdWords library in order to use it
|
28
|
+
which is installed automatically as a dependency.
|
29
|
+
|
30
|
+
The following gem libraries are required:
|
31
|
+
- soap4r v1.5.8
|
32
|
+
- httpclient v2.1.2 or greater
|
33
|
+
- google-ads-common v0.2.1 or later.
|
34
|
+
|
35
|
+
|
36
|
+
== 2 - Using the client library:
|
37
|
+
|
38
|
+
It's pretty easy to use.
|
39
|
+
See http://docs.rubygems.org/read/chapter/3#page70 for how to set the rubygem
|
40
|
+
environment.
|
41
|
+
$ export RUBYOPT=rubygems
|
42
|
+
or
|
43
|
+
$ ruby -rubygems my_program_that_uses_gems
|
44
|
+
|
45
|
+
If you are running Ruby 1.8 and do not use the rubygems option, you need to add
|
46
|
+
require 'rubygems'
|
47
|
+
at the beginning of your programs.
|
48
|
+
|
49
|
+
Then:
|
50
|
+
gem 'google-adwords-api'
|
51
|
+
require 'adwords_api'
|
52
|
+
|
53
|
+
adwords = AdwordsApi::Api.new
|
54
|
+
creates an Api object that will grant you access to all the services for all of
|
55
|
+
the currently supported vesions of the APIs. It uses a config file in:
|
56
|
+
ENV['HOME']/adwords_api.yml to read all of your configurations.
|
57
|
+
There is an example configuration file shipped with these libraries.
|
58
|
+
|
59
|
+
You can also pass API a manually constructed config hash like:
|
60
|
+
adwords = AdwordsApi::Api.new({
|
61
|
+
:authentication => {
|
62
|
+
:method => 'ClientLogin',
|
63
|
+
:developer_token => 'DEVELOPER_TOKEN',
|
64
|
+
:user_agent => 'Ruby Sample',
|
65
|
+
:password => 'PASSWORD',
|
66
|
+
:email => 'user@domain.com'
|
67
|
+
:client_email => 'user2@domain.com'
|
68
|
+
},
|
69
|
+
:service => {
|
70
|
+
:environment => 'Production'
|
71
|
+
}
|
72
|
+
})
|
73
|
+
|
74
|
+
Then, just specify which service you're looking to use, and which version:
|
75
|
+
campaign_srv = adwords.service(:CampaignService, :v201101)
|
76
|
+
|
77
|
+
and you should now be able to just use the API methods in the object you were
|
78
|
+
returned:
|
79
|
+
campaigns = campaign_srv.get({}) # Empty selector to get all
|
80
|
+
|
81
|
+
See the code in the examples directory for working examples you can build from.
|
82
|
+
|
83
|
+
*Note*: if your setup requires you to send connections through a proxy server,
|
84
|
+
please set the appropriate options in the config file or config hash. E.g.:
|
85
|
+
config[:connection] = {
|
86
|
+
:proxy => 'http://user:password@proxy_hostname:8080/path'
|
87
|
+
}
|
88
|
+
|
89
|
+
|
90
|
+
=== 2.1 - Ruby names for a Ruby library:
|
91
|
+
|
92
|
+
In order to make things more Ruby-like for our Ruby developers, we've renamed
|
93
|
+
API objects and methods to more closely match Ruby conventions. This means using
|
94
|
+
snake_case for methods and parameters, and UpperCamelCase for class names.
|
95
|
+
|
96
|
+
For example, the 'getReportFields' method of the ReportDefinitionService is
|
97
|
+
named 'get_report_fields' in the client library. You invoke it by doing:
|
98
|
+
response = report_def_srv.get_report_fields(report_type)
|
99
|
+
|
100
|
+
The 'get' method, on the other hand, returns a ReportDefinitionPage object which
|
101
|
+
has an 'entries' and a 'total_num_entries' field. So, to access the return
|
102
|
+
values, you would do:
|
103
|
+
response = report_def_srv.get(selector)
|
104
|
+
num_entries = response[:total_num_entries]
|
105
|
+
|
106
|
+
Essentially, all you have to do is follow Ruby conventions, and the library will
|
107
|
+
do the rest. All of the examples are written following this standard.
|
108
|
+
|
109
|
+
If, however, you would prefer to use the names as provided in the AdWords
|
110
|
+
documentation, please disable the 'use_ruby_names' option under the 'service'
|
111
|
+
category in the config:
|
112
|
+
config[:service][:use_ruby_names] = false
|
113
|
+
|
114
|
+
Disabling Ruby names is an experimental feature, and it is not recommended.
|
115
|
+
|
116
|
+
|
117
|
+
=== 2.2 - Using the Sandbox:
|
118
|
+
|
119
|
+
In order to use the sandbox, make sure that the 'environment' parameter under
|
120
|
+
'service' in the configuration is set to Sandbox.
|
121
|
+
config[:service] = {
|
122
|
+
:environment => 'Sandbox'
|
123
|
+
}
|
124
|
+
|
125
|
+
|
126
|
+
=== 2.3 - Logging:
|
127
|
+
|
128
|
+
It is often useful to see a trace of the raw SOAP XML being sent and received.
|
129
|
+
The quickest way of achieving this when debugging your application is by setting
|
130
|
+
the ADWORDSAPI_DEBUG environment variable to TRUE; e.g. in the bash shell:
|
131
|
+
$ export ADWORDSAPI_DEBUG=true
|
132
|
+
or from your Ruby code:
|
133
|
+
ENV['ADWORDSAPI_DEBUG'] = 'true'
|
134
|
+
|
135
|
+
This will output the SOAP XML to stderr, which will usually show up in your
|
136
|
+
terminal window.
|
137
|
+
|
138
|
+
There's also the option of logging requests and XML to files. In order to enable
|
139
|
+
this, you should use the log_to_file method of the loggers inside your
|
140
|
+
AdwordsApi::Api object:
|
141
|
+
adwords = AdwordsApi::Api.new
|
142
|
+
adwords.request_logger.log_to_file
|
143
|
+
adwords.xml_logger.log_to_file
|
144
|
+
|
145
|
+
The first logs the units spent and the requests made, whereas the second logs
|
146
|
+
the full SOAP XML being sent and received over the wire. These will be written
|
147
|
+
to the current directory by default, but you can specify another directory as an
|
148
|
+
optional parameter to log_to_file:
|
149
|
+
adwords.request_logger.log_to_file('/var/log/my_app/')
|
150
|
+
adwords.xml_logger.log_to_file('/var/log/my_app/')
|
151
|
+
|
152
|
+
The files will be named request_info and soap_xml, respectively.
|
153
|
+
|
154
|
+
|
155
|
+
= Docs for Developers
|
156
|
+
|
157
|
+
== Rake targets
|
158
|
+
|
159
|
+
$ rake getwsdl
|
160
|
+
to get the wsdl files
|
161
|
+
|
162
|
+
$ rake generate
|
163
|
+
to regenerate the bindings if needed
|
164
|
+
|
165
|
+
$ rake package
|
166
|
+
to package the gem and create a release
|
167
|
+
|
168
|
+
$ rake test
|
169
|
+
to run unit tests on the library
|
170
|
+
|
171
|
+
|
172
|
+
== Where do I submit bug reports and feature requests?
|
173
|
+
|
174
|
+
Bug reports and feature requests can be posted on the library page:
|
175
|
+
|
176
|
+
http://code.google.com/p/google-api-ads-ruby/issues
|
177
|
+
|
178
|
+
Questions can be asked on forum
|
179
|
+
|
180
|
+
http://groups.google.com/group/adwords-api
|
181
|
+
|
182
|
+
|
183
|
+
= Copyright/License Info
|
184
|
+
|
185
|
+
== Licence
|
186
|
+
|
187
|
+
Copyright 2011, Google Inc. All Rights Reserved.
|
188
|
+
|
189
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
190
|
+
you may not use this file except in compliance with the License.
|
191
|
+
You may obtain a copy of the License at
|
192
|
+
|
193
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
194
|
+
|
195
|
+
Unless required by applicable law or agreed to in writing, software
|
196
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
197
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
198
|
+
See the License for the specific language governing permissions and
|
199
|
+
limitations under the License.
|
200
|
+
|
201
|
+
== Authors
|
202
|
+
|
203
|
+
Authors:
|
204
|
+
api.sgomes (Sérgio Gomes)
|
205
|
+
api.dklimkin@gmail.com (Danial Klimkin)
|
206
|
+
|
207
|
+
Maintainer:
|
208
|
+
api.dklimkin@gmail.com (Danial Klimkin)
|
data/Rakefile
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
#
|
3
|
+
# Authors:: api.dklimkin@gmail.com (Danial Klimkin)
|
4
|
+
#
|
5
|
+
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
6
|
+
#
|
7
|
+
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
16
|
+
# implied.
|
17
|
+
# See the License for the specific language governing permissions and
|
18
|
+
# limitations under the License.
|
19
|
+
#
|
20
|
+
# DoubleClick Ad Exchange Buyer API Rakefile
|
21
|
+
#
|
22
|
+
|
23
|
+
require 'rubygems'
|
24
|
+
require 'rake/gempackagetask'
|
25
|
+
|
26
|
+
files = FileList["{examples}/**/*", "Rakefile"].to_a
|
27
|
+
docs = ['README', 'COPYING', 'ChangeLog']
|
28
|
+
|
29
|
+
spec = Gem::Specification.new do |s|
|
30
|
+
s.name = 'google-adx-buyer-api'
|
31
|
+
s.version = '0.2.0'
|
32
|
+
s.author = 'Danial Klimkin'
|
33
|
+
s.email = 'api.dklimkin@gmail.com'
|
34
|
+
s.homepage = 'http://code.google.com/p/google-api-ads-ruby/'
|
35
|
+
s.platform = Gem::Platform::RUBY
|
36
|
+
s.summary = 'Ruby Client libraries for DoubleClick Ad Exchange Buyer API'
|
37
|
+
s.description = ("%s is a DoubleClick Ad Exchange API Buyer API client " +
|
38
|
+
"library for Ruby") % s.name
|
39
|
+
s.files = files
|
40
|
+
s.has_rdoc = true
|
41
|
+
s.extra_rdoc_files = docs
|
42
|
+
s.add_dependency('google-adwords-api', '~> 0.1.2')
|
43
|
+
end
|
44
|
+
|
45
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
46
|
+
pkg.need_tar = true
|
47
|
+
end
|
48
|
+
|
49
|
+
desc 'Default target - package'
|
50
|
+
task :default => :package
|