Class: Google::Apis::YoutubeAnalyticsV2::YouTubeAnalyticsService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::YoutubeAnalyticsV2::YouTubeAnalyticsService
- Defined in:
- lib/google/apis/youtube_analytics_v2/service.rb
Overview
YouTube Analytics API
Retrieves your YouTube Analytics data.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://youtubeanalytics.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
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.
Constructor Details
#initialize ⇒ YouTubeAnalyticsService
Returns a new instance of YouTubeAnalyticsService.
47 48 49 50 51 52 |
# File 'lib/google/apis/youtube_analytics_v2/service.rb', line 47 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-youtube_analytics_v2', client_version: Google::Apis::YoutubeAnalyticsV2::GEM_VERSION) @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.
40 41 42 |
# File 'lib/google/apis/youtube_analytics_v2/service.rb', line 40 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.
45 46 47 |
# File 'lib/google/apis/youtube_analytics_v2/service.rb', line 45 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 'lib/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.
85 86 87 88 89 90 91 92 93 94 |
# File 'lib/google/apis/youtube_analytics_v2/service.rb', line 85 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.
250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/google/apis/youtube_analytics_v2/service.rb', line 250 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.
125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/google/apis/youtube_analytics_v2/service.rb', line 125 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.
168 169 170 171 172 173 174 175 176 177 |
# File 'lib/google/apis/youtube_analytics_v2/service.rb', line 168 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.
306 307 308 309 310 311 312 313 314 315 316 317 |
# File 'lib/google/apis/youtube_analytics_v2/service.rb', line 306 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.
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
# File 'lib/google/apis/youtube_analytics_v2/service.rb', line 433 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.
348 349 350 351 352 353 354 355 356 357 358 |
# File 'lib/google/apis/youtube_analytics_v2/service.rb', line 348 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 |