google-ads-googleads 2.0.0 → 2.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62470f63d1da981ede9c67986dbd4b2fc78efcf236bc0540a1f673a12b52c224
4
- data.tar.gz: 4a46da47d63f825e98030c88b51b3513393311ff3a1050eac62f0d86680b1cb6
3
+ metadata.gz: 164db641c982021a9c51f5b3bf9e18a65f8e7b973338bd392b003d00f5235cc7
4
+ data.tar.gz: f84eeceb7819e6751d8b897eb92423bf9145df1118971033a7794d687690f199
5
5
  SHA512:
6
- metadata.gz: 75580c687c4c05c0a8e4de4feb771ab8b365e07f3cf355ffa3fdf7c4a9d6bdea14763a041c3a85aacb5d467f0b5ce249aa114af1e7768aa5764bf11a00466e95
7
- data.tar.gz: ba392c6f51965d2a2ee97addde1be08348461be66ddede838abb1909a11d0a8e118463d7a8f0475ccbadc69669b02a7f0200036ca9acf6e3faa597e314c2f528
6
+ metadata.gz: 9896edaac0beb4a622c4d1c7df3df42ad58767770772b8365afa275f045667d5ae0f5c808f3248077560386e966bad0ee9bd58281b1e5af41079d2cc2ccae5e0
7
+ data.tar.gz: e26923a7bc61d68228b1de9ab79d679c50c8e4ed97d9b80bda4eb3eeebe41eb0620f2ca833a63eb96a77961e0fac6e14ac6569512a37b5192921511a2b2ce839
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ 2.1.1:
2
+ - Fix "factories" implementation for Google's build system.
3
+
4
+ 2.1.0:
5
+ - Add "factories" impelmentation
6
+
1
7
  2.0.0:
2
8
  - Adding support for Google Ads API v1_2.
3
9
  - Removing support for Google Ads API v0.
data/README.md CHANGED
@@ -113,7 +113,12 @@ To fetch a specific service, for example CampaignService:
113
113
  See the provided [examples][] for more detailed demonstrations of how to use the
114
114
  library.
115
115
 
116
+ Once you're familiar with the [examples][], we also recommend familiarizing
117
+ yourself with [factories][], which provides a set of high level convenience
118
+ methods for working with the Google Ads API
119
+
116
120
  [examples]: https://github.com/googleads/google-ads-ruby/blob/master/examples
121
+ [factories]: https://developers.google.com/google-ads/api/docs/client-libs/ruby/factories
117
122
 
118
123
  ## Logging
119
124
 
data/Rakefile CHANGED
@@ -37,4 +37,9 @@ task :apply_patches do |t|
37
37
  apply_patches
38
38
  end
39
39
 
40
- task :build => [:apply_patches, :validate_protos]
40
+ task :codegen do |t|
41
+ `./scripts/codegen.sh`
42
+ end
43
+
44
+ task :build => [:apply_patches, :codegen, :validate_protos]
45
+ task :test => [:codegen]
data/google_ads_config.rb CHANGED
@@ -1,15 +1,39 @@
1
1
  # This is an example configuration file for the Google Ads API Ruby client
2
2
  # library.
3
- # Please fill in the required fields and copy it to your home directory.
3
+ # Copy it to your home directory and fill in all the required values.
4
4
 
5
5
  Google::Ads::GoogleAds::Config.new do |c|
6
- # These fields are required to make any API call
6
+ # The developer token is required to authenticate that you are allowed to
7
+ # make API calls.
8
+ c.developer_token = 'INSERT_DEVELOPER_TOKEN_HERE'
9
+
10
+ # Authentication tells the API that you are allowed to make changes to the
11
+ # specific account you're trying to access.
12
+ # The default method of authentication is to use a refresh token, client id,
13
+ # and client secret to generate an access token.
7
14
  c.client_id = 'INSERT_CLIENT_ID_HERE'
8
15
  c.client_secret = 'INSERT_CLIENT_SECRET_HERE'
9
16
  c.refresh_token = 'INSERT_REFRESH_TOKEN_HERE'
10
- c.developer_token = 'INSERT_DEVELOPER_TOKEN_HERE'
11
17
 
12
- # These fields are required only in some circumstances
18
+ # Alternatively, you may specify your own custom authentication, which can be:
19
+ # A `Google::Auth::Credentials` uses a the properties of its represented
20
+ # keyfile for authenticating requests made by this client.
21
+ # A `String` will be treated as the path to the keyfile to be used for the
22
+ # construction of credentials for this client.
23
+ # A `Hash` will be treated as the contents of a keyfile to be used for the
24
+ # construction of credentials for this client.
25
+ # A `GRPC::Core::Channel` will be used to make calls through.
26
+ # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The
27
+ # channel credentials should already be composed with a
28
+ # `GRPC::Core::CallCredentials` object.
29
+ # A `Proc` will be used as an updater_proc for the Grpc channel. The proc
30
+ # transforms the metadata for requests, generally, to give OAuth credentials.
31
+ # To use one of these methods, uncomment the following line and add some code
32
+ # to look up one of the authentication methods listed above. If set, the
33
+ # authentication field will override the client_id, client_secret, and
34
+ # refresh_token fields above.
35
+ # c.authentication = INSERT_AUTHENTICATION_METHOD_HERE
36
+
13
37
  # Required for manager accounts only: Specify the login customer ID used to
14
38
  # authenticate API calls. This will be the customer ID of the authenticated
15
39
  # manager account. If you need to use different values for this field, then
@@ -17,9 +41,8 @@ Google::Ads::GoogleAds::Config.new do |c|
17
41
  # value.
18
42
  # c.login_customer_id = 'INSERT_LOGIN_CUSTOMER_ID_HERE'
19
43
 
20
- # Logging-related fields. If you want to specify your own custom logger, then
21
- # call client.logger = your_logger, which will override all these options and
22
- # use your custom logger instead, exactly as you configured it.
44
+ # Logging-related fields. You may also specify a logger after instantiation
45
+ # by using client.logger=.
23
46
 
24
47
  # By default, only log warnings or errors. You can change this to 'INFO' to
25
48
  # log all requests and responses from the server.
@@ -32,9 +55,8 @@ Google::Ads::GoogleAds::Config.new do |c|
32
55
  # or an open file.
33
56
  c.log_target = STDOUT
34
57
 
35
- # Instead of specifying logging through level and target, you can also
36
- # pass a logger directly (for e.g. passing Rails.logger in a
37
- # config/initializer). The passed logger will override log_level and
38
- # log_target
58
+ # Instead of specifying logging through level and target, you can also pass a
59
+ # logger directly (e.g. passing Rails.logger in a config/initializer). The
60
+ # passed logger will override log_level and log_target.
39
61
  # c.logger = Logger.new(STDOUT)
40
62
  end
@@ -23,6 +23,8 @@ module Google
23
23
  attr_accessor :refresh_token
24
24
  attr_accessor :client_id
25
25
  attr_accessor :client_secret
26
+ attr_accessor :authentication
27
+
26
28
  attr_accessor :developer_token
27
29
  attr_accessor :login_customer_id
28
30
 
@@ -34,12 +36,15 @@ module Google
34
36
  @refresh_token = nil
35
37
  @client_id = nil
36
38
  @client_secret = nil
39
+ @authentication = nil
40
+
37
41
  @developer_token = nil
38
42
  @login_customer_id = nil
39
43
 
40
44
  @log_level = nil
41
45
  @log_target = nil
42
46
  @logger = nil
47
+
43
48
  yield self if block_given?
44
49
  end
45
50