You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1760 lines
66 KiB

  1. // Package youtubeanalytics provides access to the YouTube Analytics API.
  2. //
  3. // See http://developers.google.com/youtube/analytics/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/youtubeanalytics/v1beta1"
  8. // ...
  9. // youtubeanalyticsService, err := youtubeanalytics.New(oauthHttpClient)
  10. package youtubeanalytics // import "google.golang.org/api/youtubeanalytics/v1beta1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "youtubeAnalytics:v1beta1"
  41. const apiName = "youtubeAnalytics"
  42. const apiVersion = "v1beta1"
  43. const basePath = "https://www.googleapis.com/youtube/analytics/v1beta1/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage your YouTube account
  47. YoutubeScope = "https://www.googleapis.com/auth/youtube"
  48. // View your YouTube account
  49. YoutubeReadonlyScope = "https://www.googleapis.com/auth/youtube.readonly"
  50. // View and manage your assets and associated content on YouTube
  51. YoutubepartnerScope = "https://www.googleapis.com/auth/youtubepartner"
  52. // View monetary and non-monetary YouTube Analytics reports for your
  53. // YouTube content
  54. YtAnalyticsMonetaryReadonlyScope = "https://www.googleapis.com/auth/yt-analytics-monetary.readonly"
  55. // View YouTube Analytics reports for your YouTube content
  56. YtAnalyticsReadonlyScope = "https://www.googleapis.com/auth/yt-analytics.readonly"
  57. )
  58. func New(client *http.Client) (*Service, error) {
  59. if client == nil {
  60. return nil, errors.New("client is nil")
  61. }
  62. s := &Service{client: client, BasePath: basePath}
  63. s.GroupItems = NewGroupItemsService(s)
  64. s.Groups = NewGroupsService(s)
  65. s.Reports = NewReportsService(s)
  66. return s, nil
  67. }
  68. type Service struct {
  69. client *http.Client
  70. BasePath string // API endpoint base URL
  71. UserAgent string // optional additional User-Agent fragment
  72. GroupItems *GroupItemsService
  73. Groups *GroupsService
  74. Reports *ReportsService
  75. }
  76. func (s *Service) userAgent() string {
  77. if s.UserAgent == "" {
  78. return googleapi.UserAgent
  79. }
  80. return googleapi.UserAgent + " " + s.UserAgent
  81. }
  82. func NewGroupItemsService(s *Service) *GroupItemsService {
  83. rs := &GroupItemsService{s: s}
  84. return rs
  85. }
  86. type GroupItemsService struct {
  87. s *Service
  88. }
  89. func NewGroupsService(s *Service) *GroupsService {
  90. rs := &GroupsService{s: s}
  91. return rs
  92. }
  93. type GroupsService struct {
  94. s *Service
  95. }
  96. func NewReportsService(s *Service) *ReportsService {
  97. rs := &ReportsService{s: s}
  98. return rs
  99. }
  100. type ReportsService struct {
  101. s *Service
  102. }
  103. type Group struct {
  104. ContentDetails *GroupContentDetails `json:"contentDetails,omitempty"`
  105. Etag string `json:"etag,omitempty"`
  106. Id string `json:"id,omitempty"`
  107. Kind string `json:"kind,omitempty"`
  108. Snippet *GroupSnippet `json:"snippet,omitempty"`
  109. // ServerResponse contains the HTTP response code and headers from the
  110. // server.
  111. googleapi.ServerResponse `json:"-"`
  112. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  113. // unconditionally include in API requests. By default, fields with
  114. // empty values are omitted from API requests. However, any non-pointer,
  115. // non-interface field appearing in ForceSendFields will be sent to the
  116. // server regardless of whether the field is empty or not. This may be
  117. // used to include empty fields in Patch requests.
  118. ForceSendFields []string `json:"-"`
  119. // NullFields is a list of field names (e.g. "ContentDetails") to
  120. // include in API requests with the JSON null value. By default, fields
  121. // with empty values are omitted from API requests. However, any field
  122. // with an empty value appearing in NullFields will be sent to the
  123. // server as null. It is an error if a field in this list has a
  124. // non-empty value. This may be used to include null fields in Patch
  125. // requests.
  126. NullFields []string `json:"-"`
  127. }
  128. func (s *Group) MarshalJSON() ([]byte, error) {
  129. type NoMethod Group
  130. raw := NoMethod(*s)
  131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  132. }
  133. type GroupContentDetails struct {
  134. ItemCount uint64 `json:"itemCount,omitempty,string"`
  135. ItemType string `json:"itemType,omitempty"`
  136. // ForceSendFields is a list of field names (e.g. "ItemCount") to
  137. // unconditionally include in API requests. By default, fields with
  138. // empty values are omitted from API requests. However, any non-pointer,
  139. // non-interface field appearing in ForceSendFields will be sent to the
  140. // server regardless of whether the field is empty or not. This may be
  141. // used to include empty fields in Patch requests.
  142. ForceSendFields []string `json:"-"`
  143. // NullFields is a list of field names (e.g. "ItemCount") to include in
  144. // API requests with the JSON null value. By default, fields with empty
  145. // values are omitted from API requests. However, any field with an
  146. // empty value appearing in NullFields will be sent to the server as
  147. // null. It is an error if a field in this list has a non-empty value.
  148. // This may be used to include null fields in Patch requests.
  149. NullFields []string `json:"-"`
  150. }
  151. func (s *GroupContentDetails) MarshalJSON() ([]byte, error) {
  152. type NoMethod GroupContentDetails
  153. raw := NoMethod(*s)
  154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  155. }
  156. type GroupSnippet struct {
  157. PublishedAt string `json:"publishedAt,omitempty"`
  158. Title string `json:"title,omitempty"`
  159. // ForceSendFields is a list of field names (e.g. "PublishedAt") to
  160. // unconditionally include in API requests. By default, fields with
  161. // empty values are omitted from API requests. However, any non-pointer,
  162. // non-interface field appearing in ForceSendFields will be sent to the
  163. // server regardless of whether the field is empty or not. This may be
  164. // used to include empty fields in Patch requests.
  165. ForceSendFields []string `json:"-"`
  166. // NullFields is a list of field names (e.g. "PublishedAt") to include
  167. // in API requests with the JSON null value. By default, fields with
  168. // empty values are omitted from API requests. However, any field with
  169. // an empty value appearing in NullFields will be sent to the server as
  170. // null. It is an error if a field in this list has a non-empty value.
  171. // This may be used to include null fields in Patch requests.
  172. NullFields []string `json:"-"`
  173. }
  174. func (s *GroupSnippet) MarshalJSON() ([]byte, error) {
  175. type NoMethod GroupSnippet
  176. raw := NoMethod(*s)
  177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  178. }
  179. type GroupItem struct {
  180. Etag string `json:"etag,omitempty"`
  181. GroupId string `json:"groupId,omitempty"`
  182. Id string `json:"id,omitempty"`
  183. Kind string `json:"kind,omitempty"`
  184. Resource *GroupItemResource `json:"resource,omitempty"`
  185. // ServerResponse contains the HTTP response code and headers from the
  186. // server.
  187. googleapi.ServerResponse `json:"-"`
  188. // ForceSendFields is a list of field names (e.g. "Etag") to
  189. // unconditionally include in API requests. By default, fields with
  190. // empty values are omitted from API requests. However, any non-pointer,
  191. // non-interface field appearing in ForceSendFields will be sent to the
  192. // server regardless of whether the field is empty or not. This may be
  193. // used to include empty fields in Patch requests.
  194. ForceSendFields []string `json:"-"`
  195. // NullFields is a list of field names (e.g. "Etag") to include in API
  196. // requests with the JSON null value. By default, fields with empty
  197. // values are omitted from API requests. However, any field with an
  198. // empty value appearing in NullFields will be sent to the server as
  199. // null. It is an error if a field in this list has a non-empty value.
  200. // This may be used to include null fields in Patch requests.
  201. NullFields []string `json:"-"`
  202. }
  203. func (s *GroupItem) MarshalJSON() ([]byte, error) {
  204. type NoMethod GroupItem
  205. raw := NoMethod(*s)
  206. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  207. }
  208. type GroupItemResource struct {
  209. Id string `json:"id,omitempty"`
  210. Kind string `json:"kind,omitempty"`
  211. // ForceSendFields is a list of field names (e.g. "Id") to
  212. // unconditionally include in API requests. By default, fields with
  213. // empty values are omitted from API requests. However, any non-pointer,
  214. // non-interface field appearing in ForceSendFields will be sent to the
  215. // server regardless of whether the field is empty or not. This may be
  216. // used to include empty fields in Patch requests.
  217. ForceSendFields []string `json:"-"`
  218. // NullFields is a list of field names (e.g. "Id") to include in API
  219. // requests with the JSON null value. By default, fields with empty
  220. // values are omitted from API requests. However, any field with an
  221. // empty value appearing in NullFields will be sent to the server as
  222. // null. It is an error if a field in this list has a non-empty value.
  223. // This may be used to include null fields in Patch requests.
  224. NullFields []string `json:"-"`
  225. }
  226. func (s *GroupItemResource) MarshalJSON() ([]byte, error) {
  227. type NoMethod GroupItemResource
  228. raw := NoMethod(*s)
  229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  230. }
  231. // GroupItemListResponse: A paginated list of grouList resources
  232. // returned in response to a youtubeAnalytics.groupApi.list request.
  233. type GroupItemListResponse struct {
  234. Etag string `json:"etag,omitempty"`
  235. Items []*GroupItem `json:"items,omitempty"`
  236. Kind string `json:"kind,omitempty"`
  237. // ServerResponse contains the HTTP response code and headers from the
  238. // server.
  239. googleapi.ServerResponse `json:"-"`
  240. // ForceSendFields is a list of field names (e.g. "Etag") to
  241. // unconditionally include in API requests. By default, fields with
  242. // empty values are omitted from API requests. However, any non-pointer,
  243. // non-interface field appearing in ForceSendFields will be sent to the
  244. // server regardless of whether the field is empty or not. This may be
  245. // used to include empty fields in Patch requests.
  246. ForceSendFields []string `json:"-"`
  247. // NullFields is a list of field names (e.g. "Etag") to include in API
  248. // requests with the JSON null value. By default, fields with empty
  249. // values are omitted from API requests. However, any field with an
  250. // empty value appearing in NullFields will be sent to the server as
  251. // null. It is an error if a field in this list has a non-empty value.
  252. // This may be used to include null fields in Patch requests.
  253. NullFields []string `json:"-"`
  254. }
  255. func (s *GroupItemListResponse) MarshalJSON() ([]byte, error) {
  256. type NoMethod GroupItemListResponse
  257. raw := NoMethod(*s)
  258. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  259. }
  260. // GroupListResponse: A paginated list of grouList resources returned in
  261. // response to a youtubeAnalytics.groupApi.list request.
  262. type GroupListResponse struct {
  263. Etag string `json:"etag,omitempty"`
  264. Items []*Group `json:"items,omitempty"`
  265. Kind string `json:"kind,omitempty"`
  266. NextPageToken string `json:"nextPageToken,omitempty"`
  267. // ServerResponse contains the HTTP response code and headers from the
  268. // server.
  269. googleapi.ServerResponse `json:"-"`
  270. // ForceSendFields is a list of field names (e.g. "Etag") to
  271. // unconditionally include in API requests. By default, fields with
  272. // empty values are omitted from API requests. However, any non-pointer,
  273. // non-interface field appearing in ForceSendFields will be sent to the
  274. // server regardless of whether the field is empty or not. This may be
  275. // used to include empty fields in Patch requests.
  276. ForceSendFields []string `json:"-"`
  277. // NullFields is a list of field names (e.g. "Etag") to include in API
  278. // requests with the JSON null value. By default, fields with empty
  279. // values are omitted from API requests. However, any field with an
  280. // empty value appearing in NullFields will be sent to the server as
  281. // null. It is an error if a field in this list has a non-empty value.
  282. // This may be used to include null fields in Patch requests.
  283. NullFields []string `json:"-"`
  284. }
  285. func (s *GroupListResponse) MarshalJSON() ([]byte, error) {
  286. type NoMethod GroupListResponse
  287. raw := NoMethod(*s)
  288. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  289. }
  290. // ResultTable: Contains a single result table. The table is returned as
  291. // an array of rows that contain the values for the cells of the table.
  292. // Depending on the metric or dimension, the cell can contain a string
  293. // (video ID, country code) or a number (number of views or number of
  294. // likes).
  295. type ResultTable struct {
  296. // ColumnHeaders: This value specifies information about the data
  297. // returned in the rows fields. Each item in the columnHeaders list
  298. // identifies a field returned in the rows value, which contains a list
  299. // of comma-delimited data. The columnHeaders list will begin with the
  300. // dimensions specified in the API request, which will be followed by
  301. // the metrics specified in the API request. The order of both
  302. // dimensions and metrics will match the ordering in the API request.
  303. // For example, if the API request contains the parameters
  304. // dimensions=ageGroup,gender&metrics=viewerPercentage, the API response
  305. // will return columns in this order: ageGroup,gender,viewerPercentage.
  306. ColumnHeaders []*ResultTableColumnHeaders `json:"columnHeaders,omitempty"`
  307. // Kind: This value specifies the type of data included in the API
  308. // response. For the query method, the kind property value will be
  309. // youtubeAnalytics#resultTable.
  310. Kind string `json:"kind,omitempty"`
  311. // Rows: The list contains all rows of the result table. Each item in
  312. // the list is an array that contains comma-delimited data corresponding
  313. // to a single row of data. The order of the comma-delimited data fields
  314. // will match the order of the columns listed in the columnHeaders
  315. // field. If no data is available for the given query, the rows element
  316. // will be omitted from the response. The response for a query with the
  317. // day dimension will not contain rows for the most recent days.
  318. Rows [][]interface{} `json:"rows,omitempty"`
  319. // ServerResponse contains the HTTP response code and headers from the
  320. // server.
  321. googleapi.ServerResponse `json:"-"`
  322. // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to
  323. // unconditionally include in API requests. By default, fields with
  324. // empty values are omitted from API requests. However, any non-pointer,
  325. // non-interface field appearing in ForceSendFields will be sent to the
  326. // server regardless of whether the field is empty or not. This may be
  327. // used to include empty fields in Patch requests.
  328. ForceSendFields []string `json:"-"`
  329. // NullFields is a list of field names (e.g. "ColumnHeaders") to include
  330. // in API requests with the JSON null value. By default, fields with
  331. // empty values are omitted from API requests. However, any field with
  332. // an empty value appearing in NullFields will be sent to the server as
  333. // null. It is an error if a field in this list has a non-empty value.
  334. // This may be used to include null fields in Patch requests.
  335. NullFields []string `json:"-"`
  336. }
  337. func (s *ResultTable) MarshalJSON() ([]byte, error) {
  338. type NoMethod ResultTable
  339. raw := NoMethod(*s)
  340. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  341. }
  342. type ResultTableColumnHeaders struct {
  343. // ColumnType: The type of the column (DIMENSION or METRIC).
  344. ColumnType string `json:"columnType,omitempty"`
  345. // DataType: The type of the data in the column (STRING, INTEGER, FLOAT,
  346. // etc.).
  347. DataType string `json:"dataType,omitempty"`
  348. // Name: The name of the dimension or metric.
  349. Name string `json:"name,omitempty"`
  350. // ForceSendFields is a list of field names (e.g. "ColumnType") to
  351. // unconditionally include in API requests. By default, fields with
  352. // empty values are omitted from API requests. However, any non-pointer,
  353. // non-interface field appearing in ForceSendFields will be sent to the
  354. // server regardless of whether the field is empty or not. This may be
  355. // used to include empty fields in Patch requests.
  356. ForceSendFields []string `json:"-"`
  357. // NullFields is a list of field names (e.g. "ColumnType") to include in
  358. // API requests with the JSON null value. By default, fields with empty
  359. // values are omitted from API requests. However, any field with an
  360. // empty value appearing in NullFields will be sent to the server as
  361. // null. It is an error if a field in this list has a non-empty value.
  362. // This may be used to include null fields in Patch requests.
  363. NullFields []string `json:"-"`
  364. }
  365. func (s *ResultTableColumnHeaders) MarshalJSON() ([]byte, error) {
  366. type NoMethod ResultTableColumnHeaders
  367. raw := NoMethod(*s)
  368. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  369. }
  370. // method id "youtubeAnalytics.groupItems.delete":
  371. type GroupItemsDeleteCall struct {
  372. s *Service
  373. urlParams_ gensupport.URLParams
  374. ctx_ context.Context
  375. header_ http.Header
  376. }
  377. // Delete: Removes an item from a group.
  378. func (r *GroupItemsService) Delete(id string) *GroupItemsDeleteCall {
  379. c := &GroupItemsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  380. c.urlParams_.Set("id", id)
  381. return c
  382. }
  383. // OnBehalfOfContentOwner sets the optional parameter
  384. // "onBehalfOfContentOwner": Note: This parameter is intended
  385. // exclusively for YouTube content partners.
  386. //
  387. // The onBehalfOfContentOwner parameter indicates that the request's
  388. // authorization credentials identify a YouTube CMS user who is acting
  389. // on behalf of the content owner specified in the parameter value. This
  390. // parameter is intended for YouTube content partners that own and
  391. // manage many different YouTube channels. It allows content owners to
  392. // authenticate once and get access to all their video and channel data,
  393. // without having to provide authentication credentials for each
  394. // individual channel. The CMS account that the user authenticates with
  395. // must be linked to the specified YouTube content owner.
  396. func (c *GroupItemsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *GroupItemsDeleteCall {
  397. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  398. return c
  399. }
  400. // Fields allows partial responses to be retrieved. See
  401. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  402. // for more information.
  403. func (c *GroupItemsDeleteCall) Fields(s ...googleapi.Field) *GroupItemsDeleteCall {
  404. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  405. return c
  406. }
  407. // Context sets the context to be used in this call's Do method. Any
  408. // pending HTTP request will be aborted if the provided context is
  409. // canceled.
  410. func (c *GroupItemsDeleteCall) Context(ctx context.Context) *GroupItemsDeleteCall {
  411. c.ctx_ = ctx
  412. return c
  413. }
  414. // Header returns an http.Header that can be modified by the caller to
  415. // add HTTP headers to the request.
  416. func (c *GroupItemsDeleteCall) Header() http.Header {
  417. if c.header_ == nil {
  418. c.header_ = make(http.Header)
  419. }
  420. return c.header_
  421. }
  422. func (c *GroupItemsDeleteCall) doRequest(alt string) (*http.Response, error) {
  423. reqHeaders := make(http.Header)
  424. for k, v := range c.header_ {
  425. reqHeaders[k] = v
  426. }
  427. reqHeaders.Set("User-Agent", c.s.userAgent())
  428. var body io.Reader = nil
  429. c.urlParams_.Set("alt", alt)
  430. urls := googleapi.ResolveRelative(c.s.BasePath, "groupItems")
  431. urls += "?" + c.urlParams_.Encode()
  432. req, _ := http.NewRequest("DELETE", urls, body)
  433. req.Header = reqHeaders
  434. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  435. }
  436. // Do executes the "youtubeAnalytics.groupItems.delete" call.
  437. func (c *GroupItemsDeleteCall) Do(opts ...googleapi.CallOption) error {
  438. gensupport.SetOptions(c.urlParams_, opts...)
  439. res, err := c.doRequest("json")
  440. if err != nil {
  441. return err
  442. }
  443. defer googleapi.CloseBody(res)
  444. if err := googleapi.CheckResponse(res); err != nil {
  445. return err
  446. }
  447. return nil
  448. // {
  449. // "description": "Removes an item from a group.",
  450. // "httpMethod": "DELETE",
  451. // "id": "youtubeAnalytics.groupItems.delete",
  452. // "parameterOrder": [
  453. // "id"
  454. // ],
  455. // "parameters": {
  456. // "id": {
  457. // "description": "The id parameter specifies the YouTube group item ID for the group that is being deleted.",
  458. // "location": "query",
  459. // "required": true,
  460. // "type": "string"
  461. // },
  462. // "onBehalfOfContentOwner": {
  463. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  464. // "location": "query",
  465. // "type": "string"
  466. // }
  467. // },
  468. // "path": "groupItems",
  469. // "scopes": [
  470. // "https://www.googleapis.com/auth/youtube",
  471. // "https://www.googleapis.com/auth/youtubepartner"
  472. // ]
  473. // }
  474. }
  475. // method id "youtubeAnalytics.groupItems.insert":
  476. type GroupItemsInsertCall struct {
  477. s *Service
  478. groupitem *GroupItem
  479. urlParams_ gensupport.URLParams
  480. ctx_ context.Context
  481. header_ http.Header
  482. }
  483. // Insert: Creates a group item.
  484. func (r *GroupItemsService) Insert(groupitem *GroupItem) *GroupItemsInsertCall {
  485. c := &GroupItemsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  486. c.groupitem = groupitem
  487. return c
  488. }
  489. // OnBehalfOfContentOwner sets the optional parameter
  490. // "onBehalfOfContentOwner": Note: This parameter is intended
  491. // exclusively for YouTube content partners.
  492. //
  493. // The onBehalfOfContentOwner parameter indicates that the request's
  494. // authorization credentials identify a YouTube CMS user who is acting
  495. // on behalf of the content owner specified in the parameter value. This
  496. // parameter is intended for YouTube content partners that own and
  497. // manage many different YouTube channels. It allows content owners to
  498. // authenticate once and get access to all their video and channel data,
  499. // without having to provide authentication credentials for each
  500. // individual channel. The CMS account that the user authenticates with
  501. // must be linked to the specified YouTube content owner.
  502. func (c *GroupItemsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *GroupItemsInsertCall {
  503. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  504. return c
  505. }
  506. // Fields allows partial responses to be retrieved. See
  507. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  508. // for more information.
  509. func (c *GroupItemsInsertCall) Fields(s ...googleapi.Field) *GroupItemsInsertCall {
  510. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  511. return c
  512. }
  513. // Context sets the context to be used in this call's Do method. Any
  514. // pending HTTP request will be aborted if the provided context is
  515. // canceled.
  516. func (c *GroupItemsInsertCall) Context(ctx context.Context) *GroupItemsInsertCall {
  517. c.ctx_ = ctx
  518. return c
  519. }
  520. // Header returns an http.Header that can be modified by the caller to
  521. // add HTTP headers to the request.
  522. func (c *GroupItemsInsertCall) Header() http.Header {
  523. if c.header_ == nil {
  524. c.header_ = make(http.Header)
  525. }
  526. return c.header_
  527. }
  528. func (c *GroupItemsInsertCall) doRequest(alt string) (*http.Response, error) {
  529. reqHeaders := make(http.Header)
  530. for k, v := range c.header_ {
  531. reqHeaders[k] = v
  532. }
  533. reqHeaders.Set("User-Agent", c.s.userAgent())
  534. var body io.Reader = nil
  535. body, err := googleapi.WithoutDataWrapper.JSONReader(c.groupitem)
  536. if err != nil {
  537. return nil, err
  538. }
  539. reqHeaders.Set("Content-Type", "application/json")
  540. c.urlParams_.Set("alt", alt)
  541. urls := googleapi.ResolveRelative(c.s.BasePath, "groupItems")
  542. urls += "?" + c.urlParams_.Encode()
  543. req, _ := http.NewRequest("POST", urls, body)
  544. req.Header = reqHeaders
  545. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  546. }
  547. // Do executes the "youtubeAnalytics.groupItems.insert" call.
  548. // Exactly one of *GroupItem or error will be non-nil. Any non-2xx
  549. // status code is an error. Response headers are in either
  550. // *GroupItem.ServerResponse.Header or (if a response was returned at
  551. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  552. // to check whether the returned error was because
  553. // http.StatusNotModified was returned.
  554. func (c *GroupItemsInsertCall) Do(opts ...googleapi.CallOption) (*GroupItem, error) {
  555. gensupport.SetOptions(c.urlParams_, opts...)
  556. res, err := c.doRequest("json")
  557. if res != nil && res.StatusCode == http.StatusNotModified {
  558. if res.Body != nil {
  559. res.Body.Close()
  560. }
  561. return nil, &googleapi.Error{
  562. Code: res.StatusCode,
  563. Header: res.Header,
  564. }
  565. }
  566. if err != nil {
  567. return nil, err
  568. }
  569. defer googleapi.CloseBody(res)
  570. if err := googleapi.CheckResponse(res); err != nil {
  571. return nil, err
  572. }
  573. ret := &GroupItem{
  574. ServerResponse: googleapi.ServerResponse{
  575. Header: res.Header,
  576. HTTPStatusCode: res.StatusCode,
  577. },
  578. }
  579. target := &ret
  580. if err := gensupport.DecodeResponse(target, res); err != nil {
  581. return nil, err
  582. }
  583. return ret, nil
  584. // {
  585. // "description": "Creates a group item.",
  586. // "httpMethod": "POST",
  587. // "id": "youtubeAnalytics.groupItems.insert",
  588. // "parameters": {
  589. // "onBehalfOfContentOwner": {
  590. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  591. // "location": "query",
  592. // "type": "string"
  593. // }
  594. // },
  595. // "path": "groupItems",
  596. // "request": {
  597. // "$ref": "GroupItem"
  598. // },
  599. // "response": {
  600. // "$ref": "GroupItem"
  601. // },
  602. // "scopes": [
  603. // "https://www.googleapis.com/auth/youtube",
  604. // "https://www.googleapis.com/auth/youtubepartner"
  605. // ]
  606. // }
  607. }
  608. // method id "youtubeAnalytics.groupItems.list":
  609. type GroupItemsListCall struct {
  610. s *Service
  611. urlParams_ gensupport.URLParams
  612. ifNoneMatch_ string
  613. ctx_ context.Context
  614. header_ http.Header
  615. }
  616. // List: Returns a collection of group items that match the API request
  617. // parameters.
  618. func (r *GroupItemsService) List(groupId string) *GroupItemsListCall {
  619. c := &GroupItemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  620. c.urlParams_.Set("groupId", groupId)
  621. return c
  622. }
  623. // OnBehalfOfContentOwner sets the optional parameter
  624. // "onBehalfOfContentOwner": Note: This parameter is intended
  625. // exclusively for YouTube content partners.
  626. //
  627. // The onBehalfOfContentOwner parameter indicates that the request's
  628. // authorization credentials identify a YouTube CMS user who is acting
  629. // on behalf of the content owner specified in the parameter value. This
  630. // parameter is intended for YouTube content partners that own and
  631. // manage many different YouTube channels. It allows content owners to
  632. // authenticate once and get access to all their video and channel data,
  633. // without having to provide authentication credentials for each
  634. // individual channel. The CMS account that the user authenticates with
  635. // must be linked to the specified YouTube content owner.
  636. func (c *GroupItemsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *GroupItemsListCall {
  637. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  638. return c
  639. }
  640. // Fields allows partial responses to be retrieved. See
  641. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  642. // for more information.
  643. func (c *GroupItemsListCall) Fields(s ...googleapi.Field) *GroupItemsListCall {
  644. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  645. return c
  646. }
  647. // IfNoneMatch sets the optional parameter which makes the operation
  648. // fail if the object's ETag matches the given value. This is useful for
  649. // getting updates only after the object has changed since the last
  650. // request. Use googleapi.IsNotModified to check whether the response
  651. // error from Do is the result of In-None-Match.
  652. func (c *GroupItemsListCall) IfNoneMatch(entityTag string) *GroupItemsListCall {
  653. c.ifNoneMatch_ = entityTag
  654. return c
  655. }
  656. // Context sets the context to be used in this call's Do method. Any
  657. // pending HTTP request will be aborted if the provided context is
  658. // canceled.
  659. func (c *GroupItemsListCall) Context(ctx context.Context) *GroupItemsListCall {
  660. c.ctx_ = ctx
  661. return c
  662. }
  663. // Header returns an http.Header that can be modified by the caller to
  664. // add HTTP headers to the request.
  665. func (c *GroupItemsListCall) Header() http.Header {
  666. if c.header_ == nil {
  667. c.header_ = make(http.Header)
  668. }
  669. return c.header_
  670. }
  671. func (c *GroupItemsListCall) doRequest(alt string) (*http.Response, error) {
  672. reqHeaders := make(http.Header)
  673. for k, v := range c.header_ {
  674. reqHeaders[k] = v
  675. }
  676. reqHeaders.Set("User-Agent", c.s.userAgent())
  677. if c.ifNoneMatch_ != "" {
  678. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  679. }
  680. var body io.Reader = nil
  681. c.urlParams_.Set("alt", alt)
  682. urls := googleapi.ResolveRelative(c.s.BasePath, "groupItems")
  683. urls += "?" + c.urlParams_.Encode()
  684. req, _ := http.NewRequest("GET", urls, body)
  685. req.Header = reqHeaders
  686. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  687. }
  688. // Do executes the "youtubeAnalytics.groupItems.list" call.
  689. // Exactly one of *GroupItemListResponse or error will be non-nil. Any
  690. // non-2xx status code is an error. Response headers are in either
  691. // *GroupItemListResponse.ServerResponse.Header or (if a response was
  692. // returned at all) in error.(*googleapi.Error).Header. Use
  693. // googleapi.IsNotModified to check whether the returned error was
  694. // because http.StatusNotModified was returned.
  695. func (c *GroupItemsListCall) Do(opts ...googleapi.CallOption) (*GroupItemListResponse, error) {
  696. gensupport.SetOptions(c.urlParams_, opts...)
  697. res, err := c.doRequest("json")
  698. if res != nil && res.StatusCode == http.StatusNotModified {
  699. if res.Body != nil {
  700. res.Body.Close()
  701. }
  702. return nil, &googleapi.Error{
  703. Code: res.StatusCode,
  704. Header: res.Header,
  705. }
  706. }
  707. if err != nil {
  708. return nil, err
  709. }
  710. defer googleapi.CloseBody(res)
  711. if err := googleapi.CheckResponse(res); err != nil {
  712. return nil, err
  713. }
  714. ret := &GroupItemListResponse{
  715. ServerResponse: googleapi.ServerResponse{
  716. Header: res.Header,
  717. HTTPStatusCode: res.StatusCode,
  718. },
  719. }
  720. target := &ret
  721. if err := gensupport.DecodeResponse(target, res); err != nil {
  722. return nil, err
  723. }
  724. return ret, nil
  725. // {
  726. // "description": "Returns a collection of group items that match the API request parameters.",
  727. // "httpMethod": "GET",
  728. // "id": "youtubeAnalytics.groupItems.list",
  729. // "parameterOrder": [
  730. // "groupId"
  731. // ],
  732. // "parameters": {
  733. // "groupId": {
  734. // "description": "The id parameter specifies the unique ID of the group for which you want to retrieve group items.",
  735. // "location": "query",
  736. // "required": true,
  737. // "type": "string"
  738. // },
  739. // "onBehalfOfContentOwner": {
  740. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  741. // "location": "query",
  742. // "type": "string"
  743. // }
  744. // },
  745. // "path": "groupItems",
  746. // "response": {
  747. // "$ref": "GroupItemListResponse"
  748. // },
  749. // "scopes": [
  750. // "https://www.googleapis.com/auth/youtube",
  751. // "https://www.googleapis.com/auth/youtube.readonly",
  752. // "https://www.googleapis.com/auth/youtubepartner",
  753. // "https://www.googleapis.com/auth/yt-analytics.readonly"
  754. // ]
  755. // }
  756. }
  757. // method id "youtubeAnalytics.groups.delete":
  758. type GroupsDeleteCall struct {
  759. s *Service
  760. urlParams_ gensupport.URLParams
  761. ctx_ context.Context
  762. header_ http.Header
  763. }
  764. // Delete: Deletes a group.
  765. func (r *GroupsService) Delete(id string) *GroupsDeleteCall {
  766. c := &GroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  767. c.urlParams_.Set("id", id)
  768. return c
  769. }
  770. // OnBehalfOfContentOwner sets the optional parameter
  771. // "onBehalfOfContentOwner": Note: This parameter is intended
  772. // exclusively for YouTube content partners.
  773. //
  774. // The onBehalfOfContentOwner parameter indicates that the request's
  775. // authorization credentials identify a YouTube CMS user who is acting
  776. // on behalf of the content owner specified in the parameter value. This
  777. // parameter is intended for YouTube content partners that own and
  778. // manage many different YouTube channels. It allows content owners to
  779. // authenticate once and get access to all their video and channel data,
  780. // without having to provide authentication credentials for each
  781. // individual channel. The CMS account that the user authenticates with
  782. // must be linked to the specified YouTube content owner.
  783. func (c *GroupsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *GroupsDeleteCall {
  784. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  785. return c
  786. }
  787. // Fields allows partial responses to be retrieved. See
  788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  789. // for more information.
  790. func (c *GroupsDeleteCall) Fields(s ...googleapi.Field) *GroupsDeleteCall {
  791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  792. return c
  793. }
  794. // Context sets the context to be used in this call's Do method. Any
  795. // pending HTTP request will be aborted if the provided context is
  796. // canceled.
  797. func (c *GroupsDeleteCall) Context(ctx context.Context) *GroupsDeleteCall {
  798. c.ctx_ = ctx
  799. return c
  800. }
  801. // Header returns an http.Header that can be modified by the caller to
  802. // add HTTP headers to the request.
  803. func (c *GroupsDeleteCall) Header() http.Header {
  804. if c.header_ == nil {
  805. c.header_ = make(http.Header)
  806. }
  807. return c.header_
  808. }
  809. func (c *GroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  810. reqHeaders := make(http.Header)
  811. for k, v := range c.header_ {
  812. reqHeaders[k] = v
  813. }
  814. reqHeaders.Set("User-Agent", c.s.userAgent())
  815. var body io.Reader = nil
  816. c.urlParams_.Set("alt", alt)
  817. urls := googleapi.ResolveRelative(c.s.BasePath, "groups")
  818. urls += "?" + c.urlParams_.Encode()
  819. req, _ := http.NewRequest("DELETE", urls, body)
  820. req.Header = reqHeaders
  821. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  822. }
  823. // Do executes the "youtubeAnalytics.groups.delete" call.
  824. func (c *GroupsDeleteCall) Do(opts ...googleapi.CallOption) error {
  825. gensupport.SetOptions(c.urlParams_, opts...)
  826. res, err := c.doRequest("json")
  827. if err != nil {
  828. return err
  829. }
  830. defer googleapi.CloseBody(res)
  831. if err := googleapi.CheckResponse(res); err != nil {
  832. return err
  833. }
  834. return nil
  835. // {
  836. // "description": "Deletes a group.",
  837. // "httpMethod": "DELETE",
  838. // "id": "youtubeAnalytics.groups.delete",
  839. // "parameterOrder": [
  840. // "id"
  841. // ],
  842. // "parameters": {
  843. // "id": {
  844. // "description": "The id parameter specifies the YouTube group ID for the group that is being deleted.",
  845. // "location": "query",
  846. // "required": true,
  847. // "type": "string"
  848. // },
  849. // "onBehalfOfContentOwner": {
  850. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  851. // "location": "query",
  852. // "type": "string"
  853. // }
  854. // },
  855. // "path": "groups",
  856. // "scopes": [
  857. // "https://www.googleapis.com/auth/youtube",
  858. // "https://www.googleapis.com/auth/youtubepartner"
  859. // ]
  860. // }
  861. }
  862. // method id "youtubeAnalytics.groups.insert":
  863. type GroupsInsertCall struct {
  864. s *Service
  865. group *Group
  866. urlParams_ gensupport.URLParams
  867. ctx_ context.Context
  868. header_ http.Header
  869. }
  870. // Insert: Creates a group.
  871. func (r *GroupsService) Insert(group *Group) *GroupsInsertCall {
  872. c := &GroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  873. c.group = group
  874. return c
  875. }
  876. // OnBehalfOfContentOwner sets the optional parameter
  877. // "onBehalfOfContentOwner": Note: This parameter is intended
  878. // exclusively for YouTube content partners.
  879. //
  880. // The onBehalfOfContentOwner parameter indicates that the request's
  881. // authorization credentials identify a YouTube CMS user who is acting
  882. // on behalf of the content owner specified in the parameter value. This
  883. // parameter is intended for YouTube content partners that own and
  884. // manage many different YouTube channels. It allows content owners to
  885. // authenticate once and get access to all their video and channel data,
  886. // without having to provide authentication credentials for each
  887. // individual channel. The CMS account that the user authenticates with
  888. // must be linked to the specified YouTube content owner.
  889. func (c *GroupsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *GroupsInsertCall {
  890. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  891. return c
  892. }
  893. // Fields allows partial responses to be retrieved. See
  894. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  895. // for more information.
  896. func (c *GroupsInsertCall) Fields(s ...googleapi.Field) *GroupsInsertCall {
  897. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  898. return c
  899. }
  900. // Context sets the context to be used in this call's Do method. Any
  901. // pending HTTP request will be aborted if the provided context is
  902. // canceled.
  903. func (c *GroupsInsertCall) Context(ctx context.Context) *GroupsInsertCall {
  904. c.ctx_ = ctx
  905. return c
  906. }
  907. // Header returns an http.Header that can be modified by the caller to
  908. // add HTTP headers to the request.
  909. func (c *GroupsInsertCall) Header() http.Header {
  910. if c.header_ == nil {
  911. c.header_ = make(http.Header)
  912. }
  913. return c.header_
  914. }
  915. func (c *GroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  916. reqHeaders := make(http.Header)
  917. for k, v := range c.header_ {
  918. reqHeaders[k] = v
  919. }
  920. reqHeaders.Set("User-Agent", c.s.userAgent())
  921. var body io.Reader = nil
  922. body, err := googleapi.WithoutDataWrapper.JSONReader(c.group)
  923. if err != nil {
  924. return nil, err
  925. }
  926. reqHeaders.Set("Content-Type", "application/json")
  927. c.urlParams_.Set("alt", alt)
  928. urls := googleapi.ResolveRelative(c.s.BasePath, "groups")
  929. urls += "?" + c.urlParams_.Encode()
  930. req, _ := http.NewRequest("POST", urls, body)
  931. req.Header = reqHeaders
  932. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  933. }
  934. // Do executes the "youtubeAnalytics.groups.insert" call.
  935. // Exactly one of *Group or error will be non-nil. Any non-2xx status
  936. // code is an error. Response headers are in either
  937. // *Group.ServerResponse.Header or (if a response was returned at all)
  938. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  939. // check whether the returned error was because http.StatusNotModified
  940. // was returned.
  941. func (c *GroupsInsertCall) Do(opts ...googleapi.CallOption) (*Group, error) {
  942. gensupport.SetOptions(c.urlParams_, opts...)
  943. res, err := c.doRequest("json")
  944. if res != nil && res.StatusCode == http.StatusNotModified {
  945. if res.Body != nil {
  946. res.Body.Close()
  947. }
  948. return nil, &googleapi.Error{
  949. Code: res.StatusCode,
  950. Header: res.Header,
  951. }
  952. }
  953. if err != nil {
  954. return nil, err
  955. }
  956. defer googleapi.CloseBody(res)
  957. if err := googleapi.CheckResponse(res); err != nil {
  958. return nil, err
  959. }
  960. ret := &Group{
  961. ServerResponse: googleapi.ServerResponse{
  962. Header: res.Header,
  963. HTTPStatusCode: res.StatusCode,
  964. },
  965. }
  966. target := &ret
  967. if err := gensupport.DecodeResponse(target, res); err != nil {
  968. return nil, err
  969. }
  970. return ret, nil
  971. // {
  972. // "description": "Creates a group.",
  973. // "httpMethod": "POST",
  974. // "id": "youtubeAnalytics.groups.insert",
  975. // "parameters": {
  976. // "onBehalfOfContentOwner": {
  977. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  978. // "location": "query",
  979. // "type": "string"
  980. // }
  981. // },
  982. // "path": "groups",
  983. // "request": {
  984. // "$ref": "Group"
  985. // },
  986. // "response": {
  987. // "$ref": "Group"
  988. // },
  989. // "scopes": [
  990. // "https://www.googleapis.com/auth/youtube",
  991. // "https://www.googleapis.com/auth/youtubepartner"
  992. // ]
  993. // }
  994. }
  995. // method id "youtubeAnalytics.groups.list":
  996. type GroupsListCall struct {
  997. s *Service
  998. urlParams_ gensupport.URLParams
  999. ifNoneMatch_ string
  1000. ctx_ context.Context
  1001. header_ http.Header
  1002. }
  1003. // List: Returns a collection of groups that match the API request
  1004. // parameters. For example, you can retrieve all groups that the
  1005. // authenticated user owns, or you can retrieve one or more groups by
  1006. // their unique IDs.
  1007. func (r *GroupsService) List() *GroupsListCall {
  1008. c := &GroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1009. return c
  1010. }
  1011. // Id sets the optional parameter "id": The id parameter specifies a
  1012. // comma-separated list of the YouTube group ID(s) for the resource(s)
  1013. // that are being retrieved. In a group resource, the id property
  1014. // specifies the group's YouTube group ID.
  1015. func (c *GroupsListCall) Id(id string) *GroupsListCall {
  1016. c.urlParams_.Set("id", id)
  1017. return c
  1018. }
  1019. // Mine sets the optional parameter "mine": Set this parameter's value
  1020. // to true to instruct the API to only return groups owned by the
  1021. // authenticated user.
  1022. func (c *GroupsListCall) Mine(mine bool) *GroupsListCall {
  1023. c.urlParams_.Set("mine", fmt.Sprint(mine))
  1024. return c
  1025. }
  1026. // OnBehalfOfContentOwner sets the optional parameter
  1027. // "onBehalfOfContentOwner": Note: This parameter is intended
  1028. // exclusively for YouTube content partners.
  1029. //
  1030. // The onBehalfOfContentOwner parameter indicates that the request's
  1031. // authorization credentials identify a YouTube CMS user who is acting
  1032. // on behalf of the content owner specified in the parameter value. This
  1033. // parameter is intended for YouTube content partners that own and
  1034. // manage many different YouTube channels. It allows content owners to
  1035. // authenticate once and get access to all their video and channel data,
  1036. // without having to provide authentication credentials for each
  1037. // individual channel. The CMS account that the user authenticates with
  1038. // must be linked to the specified YouTube content owner.
  1039. func (c *GroupsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *GroupsListCall {
  1040. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  1041. return c
  1042. }
  1043. // PageToken sets the optional parameter "pageToken": The pageToken
  1044. // parameter identifies a specific page in the result set that should be
  1045. // returned. In an API response, the nextPageToken property identifies
  1046. // the next page that can be retrieved.
  1047. func (c *GroupsListCall) PageToken(pageToken string) *GroupsListCall {
  1048. c.urlParams_.Set("pageToken", pageToken)
  1049. return c
  1050. }
  1051. // Fields allows partial responses to be retrieved. See
  1052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1053. // for more information.
  1054. func (c *GroupsListCall) Fields(s ...googleapi.Field) *GroupsListCall {
  1055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1056. return c
  1057. }
  1058. // IfNoneMatch sets the optional parameter which makes the operation
  1059. // fail if the object's ETag matches the given value. This is useful for
  1060. // getting updates only after the object has changed since the last
  1061. // request. Use googleapi.IsNotModified to check whether the response
  1062. // error from Do is the result of In-None-Match.
  1063. func (c *GroupsListCall) IfNoneMatch(entityTag string) *GroupsListCall {
  1064. c.ifNoneMatch_ = entityTag
  1065. return c
  1066. }
  1067. // Context sets the context to be used in this call's Do method. Any
  1068. // pending HTTP request will be aborted if the provided context is
  1069. // canceled.
  1070. func (c *GroupsListCall) Context(ctx context.Context) *GroupsListCall {
  1071. c.ctx_ = ctx
  1072. return c
  1073. }
  1074. // Header returns an http.Header that can be modified by the caller to
  1075. // add HTTP headers to the request.
  1076. func (c *GroupsListCall) Header() http.Header {
  1077. if c.header_ == nil {
  1078. c.header_ = make(http.Header)
  1079. }
  1080. return c.header_
  1081. }
  1082. func (c *GroupsListCall) doRequest(alt string) (*http.Response, error) {
  1083. reqHeaders := make(http.Header)
  1084. for k, v := range c.header_ {
  1085. reqHeaders[k] = v
  1086. }
  1087. reqHeaders.Set("User-Agent", c.s.userAgent())
  1088. if c.ifNoneMatch_ != "" {
  1089. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1090. }
  1091. var body io.Reader = nil
  1092. c.urlParams_.Set("alt", alt)
  1093. urls := googleapi.ResolveRelative(c.s.BasePath, "groups")
  1094. urls += "?" + c.urlParams_.Encode()
  1095. req, _ := http.NewRequest("GET", urls, body)
  1096. req.Header = reqHeaders
  1097. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1098. }
  1099. // Do executes the "youtubeAnalytics.groups.list" call.
  1100. // Exactly one of *GroupListResponse or error will be non-nil. Any
  1101. // non-2xx status code is an error. Response headers are in either
  1102. // *GroupListResponse.ServerResponse.Header or (if a response was
  1103. // returned at all) in error.(*googleapi.Error).Header. Use
  1104. // googleapi.IsNotModified to check whether the returned error was
  1105. // because http.StatusNotModified was returned.
  1106. func (c *GroupsListCall) Do(opts ...googleapi.CallOption) (*GroupListResponse, error) {
  1107. gensupport.SetOptions(c.urlParams_, opts...)
  1108. res, err := c.doRequest("json")
  1109. if res != nil && res.StatusCode == http.StatusNotModified {
  1110. if res.Body != nil {
  1111. res.Body.Close()
  1112. }
  1113. return nil, &googleapi.Error{
  1114. Code: res.StatusCode,
  1115. Header: res.Header,
  1116. }
  1117. }
  1118. if err != nil {
  1119. return nil, err
  1120. }
  1121. defer googleapi.CloseBody(res)
  1122. if err := googleapi.CheckResponse(res); err != nil {
  1123. return nil, err
  1124. }
  1125. ret := &GroupListResponse{
  1126. ServerResponse: googleapi.ServerResponse{
  1127. Header: res.Header,
  1128. HTTPStatusCode: res.StatusCode,
  1129. },
  1130. }
  1131. target := &ret
  1132. if err := gensupport.DecodeResponse(target, res); err != nil {
  1133. return nil, err
  1134. }
  1135. return ret, nil
  1136. // {
  1137. // "description": "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.",
  1138. // "httpMethod": "GET",
  1139. // "id": "youtubeAnalytics.groups.list",
  1140. // "parameters": {
  1141. // "id": {
  1142. // "description": "The id parameter specifies a comma-separated list of the YouTube group ID(s) for the resource(s) that are being retrieved. In a group resource, the id property specifies the group's YouTube group ID.",
  1143. // "location": "query",
  1144. // "type": "string"
  1145. // },
  1146. // "mine": {
  1147. // "description": "Set this parameter's value to true to instruct the API to only return groups owned by the authenticated user.",
  1148. // "location": "query",
  1149. // "type": "boolean"
  1150. // },
  1151. // "onBehalfOfContentOwner": {
  1152. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  1153. // "location": "query",
  1154. // "type": "string"
  1155. // },
  1156. // "pageToken": {
  1157. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page that can be retrieved.",
  1158. // "location": "query",
  1159. // "type": "string"
  1160. // }
  1161. // },
  1162. // "path": "groups",
  1163. // "response": {
  1164. // "$ref": "GroupListResponse"
  1165. // },
  1166. // "scopes": [
  1167. // "https://www.googleapis.com/auth/youtube",
  1168. // "https://www.googleapis.com/auth/youtube.readonly",
  1169. // "https://www.googleapis.com/auth/youtubepartner",
  1170. // "https://www.googleapis.com/auth/yt-analytics.readonly"
  1171. // ]
  1172. // }
  1173. }
  1174. // Pages invokes f for each page of results.
  1175. // A non-nil error returned from f will halt the iteration.
  1176. // The provided context supersedes any context provided to the Context method.
  1177. func (c *GroupsListCall) Pages(ctx context.Context, f func(*GroupListResponse) error) error {
  1178. c.ctx_ = ctx
  1179. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1180. for {
  1181. x, err := c.Do()
  1182. if err != nil {
  1183. return err
  1184. }
  1185. if err := f(x); err != nil {
  1186. return err
  1187. }
  1188. if x.NextPageToken == "" {
  1189. return nil
  1190. }
  1191. c.PageToken(x.NextPageToken)
  1192. }
  1193. }
  1194. // method id "youtubeAnalytics.groups.update":
  1195. type GroupsUpdateCall struct {
  1196. s *Service
  1197. group *Group
  1198. urlParams_ gensupport.URLParams
  1199. ctx_ context.Context
  1200. header_ http.Header
  1201. }
  1202. // Update: Modifies a group. For example, you could change a group's
  1203. // title.
  1204. func (r *GroupsService) Update(group *Group) *GroupsUpdateCall {
  1205. c := &GroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1206. c.group = group
  1207. return c
  1208. }
  1209. // OnBehalfOfContentOwner sets the optional parameter
  1210. // "onBehalfOfContentOwner": Note: This parameter is intended
  1211. // exclusively for YouTube content partners.
  1212. //
  1213. // The onBehalfOfContentOwner parameter indicates that the request's
  1214. // authorization credentials identify a YouTube CMS user who is acting
  1215. // on behalf of the content owner specified in the parameter value. This
  1216. // parameter is intended for YouTube content partners that own and
  1217. // manage many different YouTube channels. It allows content owners to
  1218. // authenticate once and get access to all their video and channel data,
  1219. // without having to provide authentication credentials for each
  1220. // individual channel. The CMS account that the user authenticates with
  1221. // must be linked to the specified YouTube content owner.
  1222. func (c *GroupsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *GroupsUpdateCall {
  1223. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  1224. return c
  1225. }
  1226. // Fields allows partial responses to be retrieved. See
  1227. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1228. // for more information.
  1229. func (c *GroupsUpdateCall) Fields(s ...googleapi.Field) *GroupsUpdateCall {
  1230. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1231. return c
  1232. }
  1233. // Context sets the context to be used in this call's Do method. Any
  1234. // pending HTTP request will be aborted if the provided context is
  1235. // canceled.
  1236. func (c *GroupsUpdateCall) Context(ctx context.Context) *GroupsUpdateCall {
  1237. c.ctx_ = ctx
  1238. return c
  1239. }
  1240. // Header returns an http.Header that can be modified by the caller to
  1241. // add HTTP headers to the request.
  1242. func (c *GroupsUpdateCall) Header() http.Header {
  1243. if c.header_ == nil {
  1244. c.header_ = make(http.Header)
  1245. }
  1246. return c.header_
  1247. }
  1248. func (c *GroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  1249. reqHeaders := make(http.Header)
  1250. for k, v := range c.header_ {
  1251. reqHeaders[k] = v
  1252. }
  1253. reqHeaders.Set("User-Agent", c.s.userAgent())
  1254. var body io.Reader = nil
  1255. body, err := googleapi.WithoutDataWrapper.JSONReader(c.group)
  1256. if err != nil {
  1257. return nil, err
  1258. }
  1259. reqHeaders.Set("Content-Type", "application/json")
  1260. c.urlParams_.Set("alt", alt)
  1261. urls := googleapi.ResolveRelative(c.s.BasePath, "groups")
  1262. urls += "?" + c.urlParams_.Encode()
  1263. req, _ := http.NewRequest("PUT", urls, body)
  1264. req.Header = reqHeaders
  1265. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1266. }
  1267. // Do executes the "youtubeAnalytics.groups.update" call.
  1268. // Exactly one of *Group or error will be non-nil. Any non-2xx status
  1269. // code is an error. Response headers are in either
  1270. // *Group.ServerResponse.Header or (if a response was returned at all)
  1271. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1272. // check whether the returned error was because http.StatusNotModified
  1273. // was returned.
  1274. func (c *GroupsUpdateCall) Do(opts ...googleapi.CallOption) (*Group, error) {
  1275. gensupport.SetOptions(c.urlParams_, opts...)
  1276. res, err := c.doRequest("json")
  1277. if res != nil && res.StatusCode == http.StatusNotModified {
  1278. if res.Body != nil {
  1279. res.Body.Close()
  1280. }
  1281. return nil, &googleapi.Error{
  1282. Code: res.StatusCode,
  1283. Header: res.Header,
  1284. }
  1285. }
  1286. if err != nil {
  1287. return nil, err
  1288. }
  1289. defer googleapi.CloseBody(res)
  1290. if err := googleapi.CheckResponse(res); err != nil {
  1291. return nil, err
  1292. }
  1293. ret := &Group{
  1294. ServerResponse: googleapi.ServerResponse{
  1295. Header: res.Header,
  1296. HTTPStatusCode: res.StatusCode,
  1297. },
  1298. }
  1299. target := &ret
  1300. if err := gensupport.DecodeResponse(target, res); err != nil {
  1301. return nil, err
  1302. }
  1303. return ret, nil
  1304. // {
  1305. // "description": "Modifies a group. For example, you could change a group's title.",
  1306. // "httpMethod": "PUT",
  1307. // "id": "youtubeAnalytics.groups.update",
  1308. // "parameters": {
  1309. // "onBehalfOfContentOwner": {
  1310. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  1311. // "location": "query",
  1312. // "type": "string"
  1313. // }
  1314. // },
  1315. // "path": "groups",
  1316. // "request": {
  1317. // "$ref": "Group"
  1318. // },
  1319. // "response": {
  1320. // "$ref": "Group"
  1321. // },
  1322. // "scopes": [
  1323. // "https://www.googleapis.com/auth/youtube",
  1324. // "https://www.googleapis.com/auth/youtubepartner"
  1325. // ]
  1326. // }
  1327. }
  1328. // method id "youtubeAnalytics.reports.query":
  1329. type ReportsQueryCall struct {
  1330. s *Service
  1331. urlParams_ gensupport.URLParams
  1332. ifNoneMatch_ string
  1333. ctx_ context.Context
  1334. header_ http.Header
  1335. }
  1336. // Query: Retrieve your YouTube Analytics reports.
  1337. func (r *ReportsService) Query(ids string, startDate string, endDate string, metrics string) *ReportsQueryCall {
  1338. c := &ReportsQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1339. c.urlParams_.Set("ids", ids)
  1340. c.urlParams_.Set("start-date", startDate)
  1341. c.urlParams_.Set("end-date", endDate)
  1342. c.urlParams_.Set("metrics", metrics)
  1343. return c
  1344. }
  1345. // Currency sets the optional parameter "currency": The currency to
  1346. // which financial metrics should be converted. The default is US Dollar
  1347. // (USD). If the result contains no financial metrics, this flag will be
  1348. // ignored. Responds with an error if the specified currency is not
  1349. // recognized.
  1350. func (c *ReportsQueryCall) Currency(currency string) *ReportsQueryCall {
  1351. c.urlParams_.Set("currency", currency)
  1352. return c
  1353. }
  1354. // Dimensions sets the optional parameter "dimensions": A
  1355. // comma-separated list of YouTube Analytics dimensions, such as views
  1356. // or ageGroup,gender. See the Available Reports document for a list of
  1357. // the reports that you can retrieve and the dimensions used for those
  1358. // reports. Also see the Dimensions document for definitions of those
  1359. // dimensions.
  1360. func (c *ReportsQueryCall) Dimensions(dimensions string) *ReportsQueryCall {
  1361. c.urlParams_.Set("dimensions", dimensions)
  1362. return c
  1363. }
  1364. // Filters sets the optional parameter "filters": A list of filters that
  1365. // should be applied when retrieving YouTube Analytics data. The
  1366. // Available Reports document identifies the dimensions that can be used
  1367. // to filter each report, and the Dimensions document defines those
  1368. // dimensions. If a request uses multiple filters, join them together
  1369. // with a semicolon (;), and the returned result table will satisfy both
  1370. // filters. For example, a filters parameter value of
  1371. // video==dMH0bHeiRNg;country==IT restricts the result set to include
  1372. // data for the given video in Italy.
  1373. func (c *ReportsQueryCall) Filters(filters string) *ReportsQueryCall {
  1374. c.urlParams_.Set("filters", filters)
  1375. return c
  1376. }
  1377. // IncludeHistoricalChannelData sets the optional parameter
  1378. // "include-historical-channel-data": If set to true historical data
  1379. // (i.e. channel data from before the linking of the channel to the
  1380. // content owner) will be retrieved.
  1381. func (c *ReportsQueryCall) IncludeHistoricalChannelData(includeHistoricalChannelData bool) *ReportsQueryCall {
  1382. c.urlParams_.Set("include-historical-channel-data", fmt.Sprint(includeHistoricalChannelData))
  1383. return c
  1384. }
  1385. // MaxResults sets the optional parameter "max-results": The maximum
  1386. // number of rows to include in the response.
  1387. func (c *ReportsQueryCall) MaxResults(maxResults int64) *ReportsQueryCall {
  1388. c.urlParams_.Set("max-results", fmt.Sprint(maxResults))
  1389. return c
  1390. }
  1391. // Sort sets the optional parameter "sort": A comma-separated list of
  1392. // dimensions or metrics that determine the sort order for YouTube
  1393. // Analytics data. By default the sort order is ascending. The '-'
  1394. // prefix causes descending sort order.
  1395. func (c *ReportsQueryCall) Sort(sort string) *ReportsQueryCall {
  1396. c.urlParams_.Set("sort", sort)
  1397. return c
  1398. }
  1399. // StartIndex sets the optional parameter "start-index": An index of the
  1400. // first entity to retrieve. Use this parameter as a pagination
  1401. // mechanism along with the max-results parameter (one-based,
  1402. // inclusive).
  1403. func (c *ReportsQueryCall) StartIndex(startIndex int64) *ReportsQueryCall {
  1404. c.urlParams_.Set("start-index", fmt.Sprint(startIndex))
  1405. return c
  1406. }
  1407. // Fields allows partial responses to be retrieved. See
  1408. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1409. // for more information.
  1410. func (c *ReportsQueryCall) Fields(s ...googleapi.Field) *ReportsQueryCall {
  1411. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1412. return c
  1413. }
  1414. // IfNoneMatch sets the optional parameter which makes the operation
  1415. // fail if the object's ETag matches the given value. This is useful for
  1416. // getting updates only after the object has changed since the last
  1417. // request. Use googleapi.IsNotModified to check whether the response
  1418. // error from Do is the result of In-None-Match.
  1419. func (c *ReportsQueryCall) IfNoneMatch(entityTag string) *ReportsQueryCall {
  1420. c.ifNoneMatch_ = entityTag
  1421. return c
  1422. }
  1423. // Context sets the context to be used in this call's Do method. Any
  1424. // pending HTTP request will be aborted if the provided context is
  1425. // canceled.
  1426. func (c *ReportsQueryCall) Context(ctx context.Context) *ReportsQueryCall {
  1427. c.ctx_ = ctx
  1428. return c
  1429. }
  1430. // Header returns an http.Header that can be modified by the caller to
  1431. // add HTTP headers to the request.
  1432. func (c *ReportsQueryCall) Header() http.Header {
  1433. if c.header_ == nil {
  1434. c.header_ = make(http.Header)
  1435. }
  1436. return c.header_
  1437. }
  1438. func (c *ReportsQueryCall) doRequest(alt string) (*http.Response, error) {
  1439. reqHeaders := make(http.Header)
  1440. for k, v := range c.header_ {
  1441. reqHeaders[k] = v
  1442. }
  1443. reqHeaders.Set("User-Agent", c.s.userAgent())
  1444. if c.ifNoneMatch_ != "" {
  1445. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1446. }
  1447. var body io.Reader = nil
  1448. c.urlParams_.Set("alt", alt)
  1449. urls := googleapi.ResolveRelative(c.s.BasePath, "reports")
  1450. urls += "?" + c.urlParams_.Encode()
  1451. req, _ := http.NewRequest("GET", urls, body)
  1452. req.Header = reqHeaders
  1453. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1454. }
  1455. // Do executes the "youtubeAnalytics.reports.query" call.
  1456. // Exactly one of *ResultTable or error will be non-nil. Any non-2xx
  1457. // status code is an error. Response headers are in either
  1458. // *ResultTable.ServerResponse.Header or (if a response was returned at
  1459. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1460. // to check whether the returned error was because
  1461. // http.StatusNotModified was returned.
  1462. func (c *ReportsQueryCall) Do(opts ...googleapi.CallOption) (*ResultTable, error) {
  1463. gensupport.SetOptions(c.urlParams_, opts...)
  1464. res, err := c.doRequest("json")
  1465. if res != nil && res.StatusCode == http.StatusNotModified {
  1466. if res.Body != nil {
  1467. res.Body.Close()
  1468. }
  1469. return nil, &googleapi.Error{
  1470. Code: res.StatusCode,
  1471. Header: res.Header,
  1472. }
  1473. }
  1474. if err != nil {
  1475. return nil, err
  1476. }
  1477. defer googleapi.CloseBody(res)
  1478. if err := googleapi.CheckResponse(res); err != nil {
  1479. return nil, err
  1480. }
  1481. ret := &ResultTable{
  1482. ServerResponse: googleapi.ServerResponse{
  1483. Header: res.Header,
  1484. HTTPStatusCode: res.StatusCode,
  1485. },
  1486. }
  1487. target := &ret
  1488. if err := gensupport.DecodeResponse(target, res); err != nil {
  1489. return nil, err
  1490. }
  1491. return ret, nil
  1492. // {
  1493. // "description": "Retrieve your YouTube Analytics reports.",
  1494. // "httpMethod": "GET",
  1495. // "id": "youtubeAnalytics.reports.query",
  1496. // "parameterOrder": [
  1497. // "ids",
  1498. // "start-date",
  1499. // "end-date",
  1500. // "metrics"
  1501. // ],
  1502. // "parameters": {
  1503. // "currency": {
  1504. // "description": "The currency to which financial metrics should be converted. The default is US Dollar (USD). If the result contains no financial metrics, this flag will be ignored. Responds with an error if the specified currency is not recognized.",
  1505. // "location": "query",
  1506. // "pattern": "[A-Z]{3}",
  1507. // "type": "string"
  1508. // },
  1509. // "dimensions": {
  1510. // "description": "A comma-separated list of YouTube Analytics dimensions, such as views or ageGroup,gender. See the Available Reports document for a list of the reports that you can retrieve and the dimensions used for those reports. Also see the Dimensions document for definitions of those dimensions.",
  1511. // "location": "query",
  1512. // "pattern": "[0-9a-zA-Z,]+",
  1513. // "type": "string"
  1514. // },
  1515. // "end-date": {
  1516. // "description": "The end date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format.",
  1517. // "location": "query",
  1518. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}",
  1519. // "required": true,
  1520. // "type": "string"
  1521. // },
  1522. // "filters": {
  1523. // "description": "A list of filters that should be applied when retrieving YouTube Analytics data. The Available Reports document identifies the dimensions that can be used to filter each report, and the Dimensions document defines those dimensions. If a request uses multiple filters, join them together with a semicolon (;), and the returned result table will satisfy both filters. For example, a filters parameter value of video==dMH0bHeiRNg;country==IT restricts the result set to include data for the given video in Italy.",
  1524. // "location": "query",
  1525. // "type": "string"
  1526. // },
  1527. // "ids": {
  1528. // "description": "Identifies the YouTube channel or content owner for which you are retrieving YouTube Analytics data.\n- To request data for a YouTube user, set the ids parameter value to channel==CHANNEL_ID, where CHANNEL_ID specifies the unique YouTube channel ID.\n- To request data for a YouTube CMS content owner, set the ids parameter value to contentOwner==OWNER_NAME, where OWNER_NAME is the CMS name of the content owner.",
  1529. // "location": "query",
  1530. // "pattern": "[a-zA-Z]+==[a-zA-Z0-9_+-]+",
  1531. // "required": true,
  1532. // "type": "string"
  1533. // },
  1534. // "include-historical-channel-data": {
  1535. // "description": "If set to true historical data (i.e. channel data from before the linking of the channel to the content owner) will be retrieved.",
  1536. // "location": "query",
  1537. // "type": "boolean"
  1538. // },
  1539. // "max-results": {
  1540. // "description": "The maximum number of rows to include in the response.",
  1541. // "format": "int32",
  1542. // "location": "query",
  1543. // "minimum": "1",
  1544. // "type": "integer"
  1545. // },
  1546. // "metrics": {
  1547. // "description": "A comma-separated list of YouTube Analytics metrics, such as views or likes,dislikes. See the Available Reports document for a list of the reports that you can retrieve and the metrics available in each report, and see the Metrics document for definitions of those metrics.",
  1548. // "location": "query",
  1549. // "pattern": "[0-9a-zA-Z,]+",
  1550. // "required": true,
  1551. // "type": "string"
  1552. // },
  1553. // "sort": {
  1554. // "description": "A comma-separated list of dimensions or metrics that determine the sort order for YouTube Analytics data. By default the sort order is ascending. The '-' prefix causes descending sort order.",
  1555. // "location": "query",
  1556. // "pattern": "[-0-9a-zA-Z,]+",
  1557. // "type": "string"
  1558. // },
  1559. // "start-date": {
  1560. // "description": "The start date for fetching YouTube Analytics data. The value should be in YYYY-MM-DD format.",
  1561. // "location": "query",
  1562. // "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}",
  1563. // "required": true,
  1564. // "type": "string"
  1565. // },
  1566. // "start-index": {
  1567. // "description": "An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter (one-based, inclusive).",
  1568. // "format": "int32",
  1569. // "location": "query",
  1570. // "minimum": "1",
  1571. // "type": "integer"
  1572. // }
  1573. // },
  1574. // "path": "reports",
  1575. // "response": {
  1576. // "$ref": "ResultTable"
  1577. // },
  1578. // "scopes": [
  1579. // "https://www.googleapis.com/auth/youtube",
  1580. // "https://www.googleapis.com/auth/youtube.readonly",
  1581. // "https://www.googleapis.com/auth/yt-analytics-monetary.readonly",
  1582. // "https://www.googleapis.com/auth/yt-analytics.readonly"
  1583. // ]
  1584. // }
  1585. }