google-apis-admob_v1beta 0.1.0

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.
@@ -0,0 +1,283 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module AdmobV1beta
23
+ # AdMob API
24
+ #
25
+ # The AdMob API allows publishers to programmatically get information about
26
+ # their AdMob account.
27
+ #
28
+ # @example
29
+ # require 'google/apis/admob_v1beta'
30
+ #
31
+ # Admob = Google::Apis::AdmobV1beta # Alias the module
32
+ # service = Admob::AdMobService.new
33
+ #
34
+ # @see https://developers.google.com/admob/api/
35
+ class AdMobService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://admob.googleapis.com/', '',
48
+ client_name: 'google-apis-admob_v1beta',
49
+ client_version: Google::Apis::AdmobV1beta::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Gets information about the specified AdMob publisher account.
54
+ # @param [String] name
55
+ # Resource name of the publisher account to retrieve. Example: accounts/pub-
56
+ # 9876543210987654
57
+ # @param [String] fields
58
+ # Selector specifying which fields to include in a partial response.
59
+ # @param [String] quota_user
60
+ # Available to use for quota purposes for server-side applications. Can be any
61
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
62
+ # @param [Google::Apis::RequestOptions] options
63
+ # Request-specific options
64
+ #
65
+ # @yield [result, err] Result & error if block supplied
66
+ # @yieldparam result [Google::Apis::AdmobV1beta::PublisherAccount] parsed result object
67
+ # @yieldparam err [StandardError] error object if request failed
68
+ #
69
+ # @return [Google::Apis::AdmobV1beta::PublisherAccount]
70
+ #
71
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
72
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
73
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
74
+ def get_account(name, fields: nil, quota_user: nil, options: nil, &block)
75
+ command = make_simple_command(:get, 'v1beta/{+name}', options)
76
+ command.response_representation = Google::Apis::AdmobV1beta::PublisherAccount::Representation
77
+ command.response_class = Google::Apis::AdmobV1beta::PublisherAccount
78
+ command.params['name'] = name unless name.nil?
79
+ command.query['fields'] = fields unless fields.nil?
80
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
81
+ execute_or_queue_command(command, &block)
82
+ end
83
+
84
+ # List the AdMob publisher account accessible with the client credential.
85
+ # Currently, all credentials have access to at most one AdMob account.
86
+ # @param [Fixnum] page_size
87
+ # Maximum number of accounts to return.
88
+ # @param [String] page_token
89
+ # The value returned by the last `ListPublisherAccountsResponse`; indicates that
90
+ # this is a continuation of a prior `ListPublisherAccounts` call, and that the
91
+ # system should return the next page of data.
92
+ # @param [String] fields
93
+ # Selector specifying which fields to include in a partial response.
94
+ # @param [String] quota_user
95
+ # Available to use for quota purposes for server-side applications. Can be any
96
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
97
+ # @param [Google::Apis::RequestOptions] options
98
+ # Request-specific options
99
+ #
100
+ # @yield [result, err] Result & error if block supplied
101
+ # @yieldparam result [Google::Apis::AdmobV1beta::ListPublisherAccountsResponse] parsed result object
102
+ # @yieldparam err [StandardError] error object if request failed
103
+ #
104
+ # @return [Google::Apis::AdmobV1beta::ListPublisherAccountsResponse]
105
+ #
106
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
107
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
108
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
109
+ def list_accounts(page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
110
+ command = make_simple_command(:get, 'v1beta/accounts', options)
111
+ command.response_representation = Google::Apis::AdmobV1beta::ListPublisherAccountsResponse::Representation
112
+ command.response_class = Google::Apis::AdmobV1beta::ListPublisherAccountsResponse
113
+ command.query['pageSize'] = page_size unless page_size.nil?
114
+ command.query['pageToken'] = page_token unless page_token.nil?
115
+ command.query['fields'] = fields unless fields.nil?
116
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
117
+ execute_or_queue_command(command, &block)
118
+ end
119
+
120
+ # List the ad units under the specified AdMob account.
121
+ # @param [String] parent
122
+ # Required. Resource name of the account to list ad units for. Example: accounts/
123
+ # pub-9876543210987654
124
+ # @param [Fixnum] page_size
125
+ # The maximum number of ad units to return. If unspecified or 0, at most 1000 ad
126
+ # units will be returned. The maximum value is 10,000; values above 10,000 will
127
+ # be coerced to 10,000.
128
+ # @param [String] page_token
129
+ # The value returned by the last `ListAdUnitsResponse`; indicates that this is a
130
+ # continuation of a prior `ListAdUnits` call, and that the system should return
131
+ # the next page of data.
132
+ # @param [String] fields
133
+ # Selector specifying which fields to include in a partial response.
134
+ # @param [String] quota_user
135
+ # Available to use for quota purposes for server-side applications. Can be any
136
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
137
+ # @param [Google::Apis::RequestOptions] options
138
+ # Request-specific options
139
+ #
140
+ # @yield [result, err] Result & error if block supplied
141
+ # @yieldparam result [Google::Apis::AdmobV1beta::ListAdUnitsResponse] parsed result object
142
+ # @yieldparam err [StandardError] error object if request failed
143
+ #
144
+ # @return [Google::Apis::AdmobV1beta::ListAdUnitsResponse]
145
+ #
146
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
147
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
148
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
149
+ def list_account_ad_units(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
150
+ command = make_simple_command(:get, 'v1beta/{+parent}/adUnits', options)
151
+ command.response_representation = Google::Apis::AdmobV1beta::ListAdUnitsResponse::Representation
152
+ command.response_class = Google::Apis::AdmobV1beta::ListAdUnitsResponse
153
+ command.params['parent'] = parent unless parent.nil?
154
+ command.query['pageSize'] = page_size unless page_size.nil?
155
+ command.query['pageToken'] = page_token unless page_token.nil?
156
+ command.query['fields'] = fields unless fields.nil?
157
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
158
+ execute_or_queue_command(command, &block)
159
+ end
160
+
161
+ # List the apps under the specified AdMob account.
162
+ # @param [String] parent
163
+ # Required. Resource name of the account to list apps for. Example: accounts/pub-
164
+ # 9876543210987654
165
+ # @param [Fixnum] page_size
166
+ # The maximum number of apps to return. If unspecified or 0, at most 1000 apps
167
+ # will be returned. The maximum value is 10,000; values above 10,000 will be
168
+ # coerced to 10,000.
169
+ # @param [String] page_token
170
+ # The value returned by the last `ListAppsResponse`; indicates that this is a
171
+ # continuation of a prior `ListApps` call, and that the system should return the
172
+ # next page of data.
173
+ # @param [String] fields
174
+ # Selector specifying which fields to include in a partial response.
175
+ # @param [String] quota_user
176
+ # Available to use for quota purposes for server-side applications. Can be any
177
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
178
+ # @param [Google::Apis::RequestOptions] options
179
+ # Request-specific options
180
+ #
181
+ # @yield [result, err] Result & error if block supplied
182
+ # @yieldparam result [Google::Apis::AdmobV1beta::ListAppsResponse] parsed result object
183
+ # @yieldparam err [StandardError] error object if request failed
184
+ #
185
+ # @return [Google::Apis::AdmobV1beta::ListAppsResponse]
186
+ #
187
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
188
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
189
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
190
+ def list_account_apps(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
191
+ command = make_simple_command(:get, 'v1beta/{+parent}/apps', options)
192
+ command.response_representation = Google::Apis::AdmobV1beta::ListAppsResponse::Representation
193
+ command.response_class = Google::Apis::AdmobV1beta::ListAppsResponse
194
+ command.params['parent'] = parent unless parent.nil?
195
+ command.query['pageSize'] = page_size unless page_size.nil?
196
+ command.query['pageToken'] = page_token unless page_token.nil?
197
+ command.query['fields'] = fields unless fields.nil?
198
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
199
+ execute_or_queue_command(command, &block)
200
+ end
201
+
202
+ # Generates an AdMob Mediation report based on the provided report specification.
203
+ # Returns result of a server-side streaming RPC. The result is returned in a
204
+ # sequence of responses.
205
+ # @param [String] parent
206
+ # Resource name of the account to generate the report for. Example: accounts/pub-
207
+ # 9876543210987654
208
+ # @param [Google::Apis::AdmobV1beta::GenerateMediationReportRequest] generate_mediation_report_request_object
209
+ # @param [String] fields
210
+ # Selector specifying which fields to include in a partial response.
211
+ # @param [String] quota_user
212
+ # Available to use for quota purposes for server-side applications. Can be any
213
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
214
+ # @param [Google::Apis::RequestOptions] options
215
+ # Request-specific options
216
+ #
217
+ # @yield [result, err] Result & error if block supplied
218
+ # @yieldparam result [Google::Apis::AdmobV1beta::GenerateMediationReportResponse] parsed result object
219
+ # @yieldparam err [StandardError] error object if request failed
220
+ #
221
+ # @return [Google::Apis::AdmobV1beta::GenerateMediationReportResponse]
222
+ #
223
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
224
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
225
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
226
+ def generate_mediation_report(parent, generate_mediation_report_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
227
+ command = make_simple_command(:post, 'v1beta/{+parent}/mediationReport:generate', options)
228
+ command.request_representation = Google::Apis::AdmobV1beta::GenerateMediationReportRequest::Representation
229
+ command.request_object = generate_mediation_report_request_object
230
+ command.response_representation = Google::Apis::AdmobV1beta::GenerateMediationReportResponse::Representation
231
+ command.response_class = Google::Apis::AdmobV1beta::GenerateMediationReportResponse
232
+ command.params['parent'] = parent unless parent.nil?
233
+ command.query['fields'] = fields unless fields.nil?
234
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
235
+ execute_or_queue_command(command, &block)
236
+ end
237
+
238
+ # Generates an AdMob Network report based on the provided report specification.
239
+ # Returns result of a server-side streaming RPC. The result is returned in a
240
+ # sequence of responses.
241
+ # @param [String] parent
242
+ # Resource name of the account to generate the report for. Example: accounts/pub-
243
+ # 9876543210987654
244
+ # @param [Google::Apis::AdmobV1beta::GenerateNetworkReportRequest] generate_network_report_request_object
245
+ # @param [String] fields
246
+ # Selector specifying which fields to include in a partial response.
247
+ # @param [String] quota_user
248
+ # Available to use for quota purposes for server-side applications. Can be any
249
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
250
+ # @param [Google::Apis::RequestOptions] options
251
+ # Request-specific options
252
+ #
253
+ # @yield [result, err] Result & error if block supplied
254
+ # @yieldparam result [Google::Apis::AdmobV1beta::GenerateNetworkReportResponse] parsed result object
255
+ # @yieldparam err [StandardError] error object if request failed
256
+ #
257
+ # @return [Google::Apis::AdmobV1beta::GenerateNetworkReportResponse]
258
+ #
259
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
260
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
261
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
262
+ def generate_network_report(parent, generate_network_report_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
263
+ command = make_simple_command(:post, 'v1beta/{+parent}/networkReport:generate', options)
264
+ command.request_representation = Google::Apis::AdmobV1beta::GenerateNetworkReportRequest::Representation
265
+ command.request_object = generate_network_report_request_object
266
+ command.response_representation = Google::Apis::AdmobV1beta::GenerateNetworkReportResponse::Representation
267
+ command.response_class = Google::Apis::AdmobV1beta::GenerateNetworkReportResponse
268
+ command.params['parent'] = parent unless parent.nil?
269
+ command.query['fields'] = fields unless fields.nil?
270
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
271
+ execute_or_queue_command(command, &block)
272
+ end
273
+
274
+ protected
275
+
276
+ def apply_command_defaults(command)
277
+ command.query['key'] = key unless key.nil?
278
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
279
+ end
280
+ end
281
+ end
282
+ end
283
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google-apis-admob_v1beta
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Google LLC
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: google-apis-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.1'
27
+ description: This is the simple REST client for AdMob API V1beta. Simple REST clients
28
+ are Ruby client libraries that provide access to Google services via their HTTP
29
+ REST API endpoints. These libraries are generated and updated automatically based
30
+ on the discovery documents published by the service, and they handle most concerns
31
+ such as authentication, pagination, retry, timeouts, and logging. You can use this
32
+ client to access the AdMob API, but note that some services may provide a separate
33
+ modern client that is easier to use.
34
+ email: googleapis-packages@google.com
35
+ executables: []
36
+ extensions: []
37
+ extra_rdoc_files: []
38
+ files:
39
+ - ".yardopts"
40
+ - CHANGELOG.md
41
+ - LICENSE.md
42
+ - OVERVIEW.md
43
+ - lib/google-apis-admob_v1beta.rb
44
+ - lib/google/apis/admob_v1beta.rb
45
+ - lib/google/apis/admob_v1beta/classes.rb
46
+ - lib/google/apis/admob_v1beta/gem_version.rb
47
+ - lib/google/apis/admob_v1beta/representations.rb
48
+ - lib/google/apis/admob_v1beta/service.rb
49
+ homepage: https://github.com/google/google-api-ruby-client
50
+ licenses:
51
+ - Apache-2.0
52
+ metadata:
53
+ bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
54
+ changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-admob_v1beta/CHANGELOG.md
55
+ documentation_uri: https://googleapis.dev/ruby/google-apis-admob_v1beta/v0.1.0
56
+ source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/master/generated/google-apis-admob_v1beta
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '2.4'
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubygems_version: 3.1.4
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: Simple REST client for AdMob API V1beta
76
+ test_files: []