Class: Google::Apis::YoutubeAnalyticsV2::YouTubeAnalyticsService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::YoutubeAnalyticsV2::YouTubeAnalyticsService
- Defined in:
- generated/google/apis/youtube_analytics_v2/service.rb
Overview
YouTube Analytics API
Retrieves your YouTube Analytics data.
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Attributes inherited from Core::BaseService
#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path
Instance Method Summary collapse
-
#delete_group(id: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::EmptyResponse
Deletes a group.
-
#delete_group_item(id: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::EmptyResponse
Removes an item from a group.
-
#initialize ⇒ YouTubeAnalyticsService
constructor
A new instance of YouTubeAnalyticsService.
-
#insert_group(group_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::Group
Creates a group.
-
#insert_group_item(group_item_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::GroupItem
Creates a group item.
-
#list_group_items(group_id: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::ListGroupItemsResponse
Returns a collection of group items that match the API request parameters.
-
#list_groups(id: nil, mine: nil, on_behalf_of_content_owner: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::ListGroupsResponse
Returns a collection of groups that match the API request parameters.
-
#query_report(currency: nil, dimensions: nil, end_date: nil, filters: nil, ids: nil, include_historical_channel_data: nil, max_results: nil, metrics: nil, sort: nil, start_date: nil, start_index: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::QueryResponse
Retrieve your YouTube Analytics reports.
-
#update_group(group_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::Group
Modifies a group.
Methods inherited from Core::BaseService
#batch, #batch_upload, #fetch_all, #http
Methods included from Core::Logging
Constructor Details
#initialize ⇒ YouTubeAnalyticsService
Returns a new instance of YouTubeAnalyticsService
45 46 47 48 |
# File 'generated/google/apis/youtube_analytics_v2/service.rb', line 45 def initialize super('https://youtubeanalytics.googleapis.com/', '') @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
38 39 40 |
# File 'generated/google/apis/youtube_analytics_v2/service.rb', line 38 def key @key end |
#quota_user ⇒ String
Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
43 44 45 |
# File 'generated/google/apis/youtube_analytics_v2/service.rb', line 43 def quota_user @quota_user end |
Instance Method Details
#delete_group(id: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::EmptyResponse
Deletes a group.
210 211 212 213 214 215 216 217 218 219 |
# File 'generated/google/apis/youtube_analytics_v2/service.rb', line 210 def delete_group(id: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v2/groups', ) command.response_representation = Google::Apis::YoutubeAnalyticsV2::EmptyResponse::Representation command.response_class = Google::Apis::YoutubeAnalyticsV2::EmptyResponse command.query['id'] = id unless id.nil? command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_group_item(id: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::EmptyResponse
Removes an item from a group.
82 83 84 85 86 87 88 89 90 91 |
# File 'generated/google/apis/youtube_analytics_v2/service.rb', line 82 def delete_group_item(id: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v2/groupItems', ) command.response_representation = Google::Apis::YoutubeAnalyticsV2::EmptyResponse::Representation command.response_class = Google::Apis::YoutubeAnalyticsV2::EmptyResponse command.query['id'] = id unless id.nil? command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#insert_group(group_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::Group
Creates a group.
251 252 253 254 255 256 257 258 259 260 261 |
# File 'generated/google/apis/youtube_analytics_v2/service.rb', line 251 def insert_group(group_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v2/groups', ) command.request_representation = Google::Apis::YoutubeAnalyticsV2::Group::Representation command.request_object = group_object command.response_representation = Google::Apis::YoutubeAnalyticsV2::Group::Representation command.response_class = Google::Apis::YoutubeAnalyticsV2::Group command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#insert_group_item(group_item_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::GroupItem
Creates a group item.
123 124 125 126 127 128 129 130 131 132 133 |
# File 'generated/google/apis/youtube_analytics_v2/service.rb', line 123 def insert_group_item(group_item_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v2/groupItems', ) command.request_representation = Google::Apis::YoutubeAnalyticsV2::GroupItem::Representation command.request_object = group_item_object command.response_representation = Google::Apis::YoutubeAnalyticsV2::GroupItem::Representation command.response_class = Google::Apis::YoutubeAnalyticsV2::GroupItem command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_group_items(group_id: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::ListGroupItemsResponse
Returns a collection of group items that match the API request parameters.
167 168 169 170 171 172 173 174 175 176 |
# File 'generated/google/apis/youtube_analytics_v2/service.rb', line 167 def list_group_items(group_id: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2/groupItems', ) command.response_representation = Google::Apis::YoutubeAnalyticsV2::ListGroupItemsResponse::Representation command.response_class = Google::Apis::YoutubeAnalyticsV2::ListGroupItemsResponse command.query['groupId'] = group_id unless group_id.nil? command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_groups(id: nil, mine: nil, on_behalf_of_content_owner: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::ListGroupsResponse
Returns a collection of groups that match the API request parameters. For example, you can retrieve all groups that the authenticated user owns, or you can retrieve one or more groups by their unique IDs.
309 310 311 312 313 314 315 316 317 318 319 320 |
# File 'generated/google/apis/youtube_analytics_v2/service.rb', line 309 def list_groups(id: nil, mine: nil, on_behalf_of_content_owner: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2/groups', ) command.response_representation = Google::Apis::YoutubeAnalyticsV2::ListGroupsResponse::Representation command.response_class = Google::Apis::YoutubeAnalyticsV2::ListGroupsResponse command.query['id'] = id unless id.nil? command.query['mine'] = mine unless mine.nil? command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#query_report(currency: nil, dimensions: nil, end_date: nil, filters: nil, ids: nil, include_historical_channel_data: nil, max_results: nil, metrics: nil, sort: nil, start_date: nil, start_index: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::QueryResponse
Retrieve your YouTube Analytics reports.
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 |
# File 'generated/google/apis/youtube_analytics_v2/service.rb', line 449 def query_report(currency: nil, dimensions: nil, end_date: nil, filters: nil, ids: nil, include_historical_channel_data: nil, max_results: nil, metrics: nil, sort: nil, start_date: nil, start_index: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v2/reports', ) command.response_representation = Google::Apis::YoutubeAnalyticsV2::QueryResponse::Representation command.response_class = Google::Apis::YoutubeAnalyticsV2::QueryResponse command.query['currency'] = currency unless currency.nil? command.query['dimensions'] = dimensions unless dimensions.nil? command.query['endDate'] = end_date unless end_date.nil? command.query['filters'] = filters unless filters.nil? command.query['ids'] = ids unless ids.nil? command.query['includeHistoricalChannelData'] = include_historical_channel_data unless include_historical_channel_data.nil? command.query['maxResults'] = max_results unless max_results.nil? command.query['metrics'] = metrics unless metrics.nil? command.query['sort'] = sort unless sort.nil? command.query['startDate'] = start_date unless start_date.nil? command.query['startIndex'] = start_index unless start_index.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#update_group(group_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::YoutubeAnalyticsV2::Group
Modifies a group. For example, you could change a group's title.
352 353 354 355 356 357 358 359 360 361 362 |
# File 'generated/google/apis/youtube_analytics_v2/service.rb', line 352 def update_group(group_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:put, 'v2/groups', ) command.request_representation = Google::Apis::YoutubeAnalyticsV2::Group::Representation command.request_object = group_object command.response_representation = Google::Apis::YoutubeAnalyticsV2::Group::Representation command.response_class = Google::Apis::YoutubeAnalyticsV2::Group command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |