1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392
|
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module YoutubeV3
# YouTube Data API
#
# Supports core YouTube features, such as uploading videos, creating and
# managing playlists, searching for content, and much more.
#
# @example
# require 'google/apis/youtube_v3'
#
# Youtube = Google::Apis::YoutubeV3 # Alias the module
# service = Youtube::YouTubeService.new
#
# @see https://developers.google.com/youtube/v3
class YouTubeService < Google::Apis::Core::BaseService
# @return [String]
# 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.
attr_accessor :key
# @return [String]
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
attr_accessor :quota_user
# @return [String]
# Deprecated. Please use quotaUser instead.
attr_accessor :user_ip
def initialize
super('https://www.googleapis.com/', 'youtube/v3/')
@batch_path = 'batch/youtube/v3'
end
# Posts a bulletin for a specific channel. (The user submitting the request must
# be authorized to act on the channel's behalf.)
# Note: Even though an activity resource can contain information about actions
# like a user rating a video or marking a video as a favorite, you need to use
# other API methods to generate those activity resources. For example, you would
# use the API's videos.rate() method to rate a video and the playlistItems.
# insert() method to mark a video as a favorite.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include.
# @param [Google::Apis::YoutubeV3::Activity] activity_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::Activity] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::Activity]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_activity(part, activity_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'activities', options)
command.request_representation = Google::Apis::YoutubeV3::Activity::Representation
command.request_object = activity_object
command.response_representation = Google::Apis::YoutubeV3::Activity::Representation
command.response_class = Google::Apis::YoutubeV3::Activity
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a list of channel activity events that match the request criteria. For
# example, you can retrieve events associated with a particular channel, events
# associated with the user's subscriptions and Google+ friends, or the YouTube
# home page feed, which is customized for each user.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more activity
# resource properties that the API response will include.
# If the parameter identifies a property that contains child properties, the
# child properties will be included in the response. For example, in an activity
# resource, the snippet property contains other properties that identify the
# type of activity, a display title for the activity, and so forth. If you set
# part=snippet, the API response will also contain all of those nested
# properties.
# @param [String] channel_id
# The channelId parameter specifies a unique YouTube channel ID. The API will
# then return a list of that channel's activities.
# @param [Boolean] home
# Set this parameter's value to true to retrieve the activity feed that displays
# on the YouTube home page for the currently authenticated user.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of items that should be
# returned in the result set.
# @param [Boolean] mine
# Set this parameter's value to true to retrieve a feed of the authenticated
# user's activities.
# @param [String] page_token
# The pageToken parameter identifies a specific page in the result set that
# should be returned. In an API response, the nextPageToken and prevPageToken
# properties identify other pages that could be retrieved.
# @param [DateTime] published_after
# The publishedAfter parameter specifies the earliest date and time that an
# activity could have occurred for that activity to be included in the API
# response. If the parameter value specifies a day, but not a time, then any
# activities that occurred that day will be included in the result set. The
# value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
# @param [DateTime] published_before
# The publishedBefore parameter specifies the date and time before which an
# activity must have occurred for that activity to be included in the API
# response. If the parameter value specifies a day, but not a time, then any
# activities that occurred that day will be excluded from the result set. The
# value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
# @param [String] region_code
# The regionCode parameter instructs the API to return results for the specified
# country. The parameter value is an ISO 3166-1 alpha-2 country code. YouTube
# uses this value when the authorized user's previous activity on YouTube does
# not provide enough information to generate the activity feed.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListActivitiesResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListActivitiesResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_activities(part, channel_id: nil, home: nil, max_results: nil, mine: nil, page_token: nil, published_after: nil, published_before: nil, region_code: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'activities', options)
command.response_representation = Google::Apis::YoutubeV3::ListActivitiesResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListActivitiesResponse
command.query['channelId'] = channel_id unless channel_id.nil?
command.query['home'] = home unless home.nil?
command.query['maxResults'] = max_results unless max_results.nil?
command.query['mine'] = mine unless mine.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['part'] = part unless part.nil?
command.query['publishedAfter'] = published_after unless published_after.nil?
command.query['publishedBefore'] = published_before unless published_before.nil?
command.query['regionCode'] = region_code unless region_code.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Deletes a specified caption track.
# @param [String] id
# The id parameter identifies the caption track that is being deleted. The value
# is a caption track ID as identified by the id property in a caption resource.
# @param [String] on_behalf_of
# ID of the Google+ Page for the channel that the request is be on behalf of
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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 actual CMS account that the user
# authenticates with must be linked to the specified YouTube content owner.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_caption(id, on_behalf_of: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:delete, 'captions', options)
command.query['id'] = id unless id.nil?
command.query['onBehalfOf'] = on_behalf_of unless on_behalf_of.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?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Downloads a caption track. The caption track is returned in its original
# format unless the request specifies a value for the tfmt parameter and in its
# original language unless the request specifies a value for the tlang parameter.
# @param [String] id
# The id parameter identifies the caption track that is being retrieved. The
# value is a caption track ID as identified by the id property in a caption
# resource.
# @param [String] on_behalf_of
# ID of the Google+ Page for the channel that the request is be on behalf of
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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 actual CMS account that the user
# authenticates with must be linked to the specified YouTube content owner.
# @param [String] tfmt
# The tfmt parameter specifies that the caption track should be returned in a
# specific format. If the parameter is not included in the request, the track is
# returned in its original format.
# @param [String] tlang
# The tlang parameter specifies that the API response should return a
# translation of the specified caption track. The parameter value is an ISO 639-
# 1 two-letter language code that identifies the desired caption language. The
# translation is generated by using machine translation, such as Google
# Translate.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [IO, String] download_dest
# IO stream or filename to receive content download
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def download_caption(id, on_behalf_of: nil, on_behalf_of_content_owner: nil, tfmt: nil, tlang: nil, fields: nil, quota_user: nil, user_ip: nil, download_dest: nil, options: nil, &block)
if download_dest.nil?
command = make_simple_command(:get, 'captions/{id}', options)
else
command = make_download_command(:get, 'captions/{id}', options)
command.download_dest = download_dest
end
command.params['id'] = id unless id.nil?
command.query['onBehalfOf'] = on_behalf_of unless on_behalf_of.nil?
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['tfmt'] = tfmt unless tfmt.nil?
command.query['tlang'] = tlang unless tlang.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Uploads a caption track.
# @param [String] part
# The part parameter specifies the caption resource parts that the API response
# will include. Set the parameter value to snippet.
# @param [Google::Apis::YoutubeV3::Caption] caption_object
# @param [String] on_behalf_of
# ID of the Google+ Page for the channel that the request is be on behalf of
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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 actual CMS account that the user
# authenticates with must be linked to the specified YouTube content owner.
# @param [Boolean] sync
# The sync parameter indicates whether YouTube should automatically synchronize
# the caption file with the audio track of the video. If you set the value to
# true, YouTube will disregard any time codes that are in the uploaded caption
# file and generate new time codes for the captions.
# You should set the sync parameter to true if you are uploading a transcript,
# which has no time codes, or if you suspect the time codes in your file are
# incorrect and want YouTube to try to fix them.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [IO, String] upload_source
# IO stream or filename containing content to upload
# @param [String] content_type
# Content type of the uploaded content.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::Caption] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::Caption]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_caption(part, caption_object = nil, on_behalf_of: nil, on_behalf_of_content_owner: nil, sync: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
if upload_source.nil?
command = make_simple_command(:post, 'captions', options)
else
command = make_upload_command(:post, 'captions', options)
command.upload_source = upload_source
command.upload_content_type = content_type
end
command.request_representation = Google::Apis::YoutubeV3::Caption::Representation
command.request_object = caption_object
command.response_representation = Google::Apis::YoutubeV3::Caption::Representation
command.response_class = Google::Apis::YoutubeV3::Caption
command.query['onBehalfOf'] = on_behalf_of unless on_behalf_of.nil?
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['part'] = part unless part.nil?
command.query['sync'] = sync unless sync.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a list of caption tracks that are associated with a specified video.
# Note that the API response does not contain the actual captions and that the
# captions.download method provides the ability to retrieve a caption track.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more caption
# resource parts that the API response will include. The part names that you can
# include in the parameter value are id and snippet.
# @param [String] video_id
# The videoId parameter specifies the YouTube video ID of the video for which
# the API should return caption tracks.
# @param [String] id
# The id parameter specifies a comma-separated list of IDs that identify the
# caption resources that should be retrieved. Each ID must identify a caption
# track associated with the specified video.
# @param [String] on_behalf_of
# ID of the Google+ Page for the channel that the request is on behalf of.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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 actual CMS account that the user
# authenticates with must be linked to the specified YouTube content owner.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListCaptionsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListCaptionsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_captions(part, video_id, id: nil, on_behalf_of: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'captions', options)
command.response_representation = Google::Apis::YoutubeV3::ListCaptionsResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListCaptionsResponse
command.query['id'] = id unless id.nil?
command.query['onBehalfOf'] = on_behalf_of unless on_behalf_of.nil?
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['part'] = part unless part.nil?
command.query['videoId'] = video_id unless video_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Updates a caption track. When updating a caption track, you can change the
# track's draft status, upload a new caption file for the track, or both.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include. Set the property value to snippet if you are
# updating the track's draft status. Otherwise, set the property value to id.
# @param [Google::Apis::YoutubeV3::Caption] caption_object
# @param [String] on_behalf_of
# ID of the Google+ Page for the channel that the request is be on behalf of
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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 actual CMS account that the user
# authenticates with must be linked to the specified YouTube content owner.
# @param [Boolean] sync
# Note: The API server only processes the parameter value if the request
# contains an updated caption file.
# The sync parameter indicates whether YouTube should automatically synchronize
# the caption file with the audio track of the video. If you set the value to
# true, YouTube will automatically synchronize the caption track with the audio
# track.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [IO, String] upload_source
# IO stream or filename containing content to upload
# @param [String] content_type
# Content type of the uploaded content.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::Caption] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::Caption]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def update_caption(part, caption_object = nil, on_behalf_of: nil, on_behalf_of_content_owner: nil, sync: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
if upload_source.nil?
command = make_simple_command(:put, 'captions', options)
else
command = make_upload_command(:put, 'captions', options)
command.upload_source = upload_source
command.upload_content_type = content_type
end
command.request_representation = Google::Apis::YoutubeV3::Caption::Representation
command.request_object = caption_object
command.response_representation = Google::Apis::YoutubeV3::Caption::Representation
command.response_class = Google::Apis::YoutubeV3::Caption
command.query['onBehalfOf'] = on_behalf_of unless on_behalf_of.nil?
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['part'] = part unless part.nil?
command.query['sync'] = sync unless sync.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Uploads a channel banner image to YouTube. This method represents the first
# two steps in a three-step process to update the banner image for a channel:
# - Call the channelBanners.insert method to upload the binary image data to
# YouTube. The image must have a 16:9 aspect ratio and be at least 2120x1192
# pixels.
# - Extract the url property's value from the response that the API returns for
# step 1.
# - Call the channels.update method to update the channel's branding settings.
# Set the brandingSettings.image.bannerExternalUrl property's value to the URL
# obtained in step 2.
# @param [Google::Apis::YoutubeV3::ChannelBannerResource] channel_banner_resource_object
# @param [String] channel_id
# The channelId parameter identifies the YouTube channel to which the banner is
# uploaded. The channelId parameter was introduced as a required parameter in
# May 2017. As this was a backward-incompatible change, channelBanners.insert
# requests that do not specify this parameter will not return an error until six
# months have passed from the time that the parameter was introduced. Please see
# the API Terms of Service for the official policy regarding backward
# incompatible changes and the API revision history for the exact date that the
# parameter was introduced.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [IO, String] upload_source
# IO stream or filename containing content to upload
# @param [String] content_type
# Content type of the uploaded content.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ChannelBannerResource] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ChannelBannerResource]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_channel_banner(channel_banner_resource_object = nil, channel_id: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
if upload_source.nil?
command = make_simple_command(:post, 'channelBanners/insert', options)
else
command = make_upload_command(:post, 'channelBanners/insert', options)
command.upload_source = upload_source
command.upload_content_type = content_type
end
command.request_representation = Google::Apis::YoutubeV3::ChannelBannerResource::Representation
command.request_object = channel_banner_resource_object
command.response_representation = Google::Apis::YoutubeV3::ChannelBannerResource::Representation
command.response_class = Google::Apis::YoutubeV3::ChannelBannerResource
command.query['channelId'] = channel_id unless channel_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?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Deletes a channelSection.
# @param [String] id
# The id parameter specifies the YouTube channelSection ID for the resource that
# is being deleted. In a channelSection resource, the id property specifies the
# YouTube channelSection ID.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_channel_section(id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:delete, 'channelSections', options)
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?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Adds a channelSection for the authenticated user's channel.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include.
# The part names that you can include in the parameter value are snippet and
# contentDetails.
# @param [Google::Apis::YoutubeV3::ChannelSection] channel_section_object
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ChannelSection] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ChannelSection]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_channel_section(part, channel_section_object = nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'channelSections', options)
command.request_representation = Google::Apis::YoutubeV3::ChannelSection::Representation
command.request_object = channel_section_object
command.response_representation = Google::Apis::YoutubeV3::ChannelSection::Representation
command.response_class = Google::Apis::YoutubeV3::ChannelSection
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns channelSection resources that match the API request criteria.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more
# channelSection resource properties that the API response will include. The
# part names that you can include in the parameter value are id, snippet, and
# contentDetails.
# If the parameter identifies a property that contains child properties, the
# child properties will be included in the response. For example, in a
# channelSection resource, the snippet property contains other properties, such
# as a display title for the channelSection. If you set part=snippet, the API
# response will also contain all of those nested properties.
# @param [String] channel_id
# The channelId parameter specifies a YouTube channel ID. The API will only
# return that channel's channelSections.
# @param [String] hl
# The hl parameter indicates that the snippet.localized property values in the
# returned channelSection resources should be in the specified language if
# localized values for that language are available. For example, if the API
# request specifies hl=de, the snippet.localized properties in the API response
# will contain German titles if German titles are available. Channel owners can
# provide localized channel section titles using either the channelSections.
# insert or channelSections.update method.
# @param [String] id
# The id parameter specifies a comma-separated list of the YouTube
# channelSection ID(s) for the resource(s) that are being retrieved. In a
# channelSection resource, the id property specifies the YouTube channelSection
# ID.
# @param [Boolean] mine
# Set this parameter's value to true to retrieve a feed of the authenticated
# user's channelSections.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListChannelSectionsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListChannelSectionsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_channel_sections(part, channel_id: nil, hl: nil, id: nil, mine: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'channelSections', options)
command.response_representation = Google::Apis::YoutubeV3::ListChannelSectionsResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListChannelSectionsResponse
command.query['channelId'] = channel_id unless channel_id.nil?
command.query['hl'] = hl unless hl.nil?
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['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Update a channelSection.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include.
# The part names that you can include in the parameter value are snippet and
# contentDetails.
# @param [Google::Apis::YoutubeV3::ChannelSection] channel_section_object
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ChannelSection] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ChannelSection]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def update_channel_section(part, channel_section_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:put, 'channelSections', options)
command.request_representation = Google::Apis::YoutubeV3::ChannelSection::Representation
command.request_object = channel_section_object
command.response_representation = Google::Apis::YoutubeV3::ChannelSection::Representation
command.response_class = Google::Apis::YoutubeV3::ChannelSection
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a collection of zero or more channel resources that match the request
# criteria.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more channel
# resource properties that the API response will include.
# If the parameter identifies a property that contains child properties, the
# child properties will be included in the response. For example, in a channel
# resource, the contentDetails property contains other properties, such as the
# uploads properties. As such, if you set part=contentDetails, the API response
# will also contain all of those nested properties.
# @param [String] category_id
# The categoryId parameter specifies a YouTube guide category, thereby
# requesting YouTube channels associated with that category.
# @param [String] for_username
# The forUsername parameter specifies a YouTube username, thereby requesting the
# channel associated with that username.
# @param [String] hl
# The hl parameter should be used for filter out the properties that are not in
# the given language. Used for the brandingSettings part.
# @param [String] id
# The id parameter specifies a comma-separated list of the YouTube channel ID(s)
# for the resource(s) that are being retrieved. In a channel resource, the id
# property specifies the channel's YouTube channel ID.
# @param [Boolean] managed_by_me
# Note: This parameter is intended exclusively for YouTube content partners.
# Set this parameter's value to true to instruct the API to only return channels
# managed by the content owner that the onBehalfOfContentOwner parameter
# specifies. The user must be authenticated as a CMS account linked to the
# specified content owner and onBehalfOfContentOwner must be provided.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of items that should be
# returned in the result set.
# @param [Boolean] mine
# Set this parameter's value to true to instruct the API to only return channels
# owned by the authenticated user.
# @param [Boolean] my_subscribers
# Use the subscriptions.list method and its mySubscribers parameter to retrieve
# a list of subscribers to the authenticated user's channel.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] page_token
# The pageToken parameter identifies a specific page in the result set that
# should be returned. In an API response, the nextPageToken and prevPageToken
# properties identify other pages that could be retrieved.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListChannelsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListChannelsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_channels(part, category_id: nil, for_username: nil, hl: nil, id: nil, managed_by_me: nil, max_results: nil, mine: nil, my_subscribers: nil, on_behalf_of_content_owner: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'channels', options)
command.response_representation = Google::Apis::YoutubeV3::ListChannelsResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListChannelsResponse
command.query['categoryId'] = category_id unless category_id.nil?
command.query['forUsername'] = for_username unless for_username.nil?
command.query['hl'] = hl unless hl.nil?
command.query['id'] = id unless id.nil?
command.query['managedByMe'] = managed_by_me unless managed_by_me.nil?
command.query['maxResults'] = max_results unless max_results.nil?
command.query['mine'] = mine unless mine.nil?
command.query['mySubscribers'] = my_subscribers unless my_subscribers.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['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Updates a channel's metadata. Note that this method currently only supports
# updates to the channel resource's brandingSettings and invideoPromotion
# objects and their child properties.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include.
# The API currently only allows the parameter value to be set to either
# brandingSettings or invideoPromotion. (You cannot update both of those parts
# with a single request.)
# Note that this method overrides the existing values for all of the mutable
# properties that are contained in any parts that the parameter value specifies.
# @param [Google::Apis::YoutubeV3::Channel] channel_object
# @param [String] on_behalf_of_content_owner
# The onBehalfOfContentOwner parameter indicates that the authenticated user 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 actual CMS account
# that the user authenticates with needs to be linked to the specified YouTube
# content owner.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::Channel] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::Channel]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def update_channel(part, channel_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:put, 'channels', options)
command.request_representation = Google::Apis::YoutubeV3::Channel::Representation
command.request_object = channel_object
command.response_representation = Google::Apis::YoutubeV3::Channel::Representation
command.response_class = Google::Apis::YoutubeV3::Channel
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Creates a new top-level comment. To add a reply to an existing comment, use
# the comments.insert method instead.
# @param [String] part
# The part parameter identifies the properties that the API response will
# include. Set the parameter value to snippet. The snippet part has a quota cost
# of 2 units.
# @param [Google::Apis::YoutubeV3::CommentThread] comment_thread_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::CommentThread] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::CommentThread]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_comment_thread(part, comment_thread_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'commentThreads', options)
command.request_representation = Google::Apis::YoutubeV3::CommentThread::Representation
command.request_object = comment_thread_object
command.response_representation = Google::Apis::YoutubeV3::CommentThread::Representation
command.response_class = Google::Apis::YoutubeV3::CommentThread
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a list of comment threads that match the API request parameters.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more
# commentThread resource properties that the API response will include.
# @param [String] all_threads_related_to_channel_id
# The allThreadsRelatedToChannelId parameter instructs the API to return all
# comment threads associated with the specified channel. The response can
# include comments about the channel or about the channel's videos.
# @param [String] channel_id
# The channelId parameter instructs the API to return comment threads containing
# comments about the specified channel. (The response will not include comments
# left on videos that the channel uploaded.)
# @param [String] id
# The id parameter specifies a comma-separated list of comment thread IDs for
# the resources that should be retrieved.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of items that should be
# returned in the result set.
# Note: This parameter is not supported for use in conjunction with the id
# parameter.
# @param [String] moderation_status
# Set this parameter to limit the returned comment threads to a particular
# moderation state.
# Note: This parameter is not supported for use in conjunction with the id
# parameter.
# @param [String] order
# The order parameter specifies the order in which the API response should list
# comment threads. Valid values are:
# - time - Comment threads are ordered by time. This is the default behavior.
# - relevance - Comment threads are ordered by relevance.Note: This parameter is
# not supported for use in conjunction with the id parameter.
# @param [String] page_token
# 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 of the result that can be retrieved.
# Note: This parameter is not supported for use in conjunction with the id
# parameter.
# @param [String] search_terms
# The searchTerms parameter instructs the API to limit the API response to only
# contain comments that contain the specified search terms.
# Note: This parameter is not supported for use in conjunction with the id
# parameter.
# @param [String] text_format
# Set this parameter's value to html or plainText to instruct the API to return
# the comments left by users in html formatted or in plain text.
# @param [String] video_id
# The videoId parameter instructs the API to return comment threads associated
# with the specified video ID.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListCommentThreadsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListCommentThreadsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_comment_threads(part, all_threads_related_to_channel_id: nil, channel_id: nil, id: nil, max_results: nil, moderation_status: nil, order: nil, page_token: nil, search_terms: nil, text_format: nil, video_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'commentThreads', options)
command.response_representation = Google::Apis::YoutubeV3::ListCommentThreadsResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListCommentThreadsResponse
command.query['allThreadsRelatedToChannelId'] = all_threads_related_to_channel_id unless all_threads_related_to_channel_id.nil?
command.query['channelId'] = channel_id unless channel_id.nil?
command.query['id'] = id unless id.nil?
command.query['maxResults'] = max_results unless max_results.nil?
command.query['moderationStatus'] = moderation_status unless moderation_status.nil?
command.query['order'] = order unless order.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['part'] = part unless part.nil?
command.query['searchTerms'] = search_terms unless search_terms.nil?
command.query['textFormat'] = text_format unless text_format.nil?
command.query['videoId'] = video_id unless video_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Modifies the top-level comment in a comment thread.
# @param [String] part
# The part parameter specifies a comma-separated list of commentThread resource
# properties that the API response will include. You must at least include the
# snippet part in the parameter value since that part contains all of the
# properties that the API request can update.
# @param [Google::Apis::YoutubeV3::CommentThread] comment_thread_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::CommentThread] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::CommentThread]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def update_comment_thread(part, comment_thread_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:put, 'commentThreads', options)
command.request_representation = Google::Apis::YoutubeV3::CommentThread::Representation
command.request_object = comment_thread_object
command.response_representation = Google::Apis::YoutubeV3::CommentThread::Representation
command.response_class = Google::Apis::YoutubeV3::CommentThread
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Deletes a comment.
# @param [String] id
# The id parameter specifies the comment ID for the resource that is being
# deleted.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_comment(id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:delete, 'comments', options)
command.query['id'] = id unless id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Creates a reply to an existing comment. Note: To create a top-level comment,
# use the commentThreads.insert method.
# @param [String] part
# The part parameter identifies the properties that the API response will
# include. Set the parameter value to snippet. The snippet part has a quota cost
# of 2 units.
# @param [Google::Apis::YoutubeV3::Comment] comment_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::Comment] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::Comment]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_comment(part, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'comments', options)
command.request_representation = Google::Apis::YoutubeV3::Comment::Representation
command.request_object = comment_object
command.response_representation = Google::Apis::YoutubeV3::Comment::Representation
command.response_class = Google::Apis::YoutubeV3::Comment
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a list of comments that match the API request parameters.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more comment
# resource properties that the API response will include.
# @param [String] id
# The id parameter specifies a comma-separated list of comment IDs for the
# resources that are being retrieved. In a comment resource, the id property
# specifies the comment's ID.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of items that should be
# returned in the result set.
# Note: This parameter is not supported for use in conjunction with the id
# parameter.
# @param [String] page_token
# 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 of the result that can be retrieved.
# Note: This parameter is not supported for use in conjunction with the id
# parameter.
# @param [String] parent_id
# The parentId parameter specifies the ID of the comment for which replies
# should be retrieved.
# Note: YouTube currently supports replies only for top-level comments. However,
# replies to replies may be supported in the future.
# @param [String] text_format
# This parameter indicates whether the API should return comments formatted as
# HTML or as plain text.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListCommentsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListCommentsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_comments(part, id: nil, max_results: nil, page_token: nil, parent_id: nil, text_format: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'comments', options)
command.response_representation = Google::Apis::YoutubeV3::ListCommentsResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListCommentsResponse
command.query['id'] = id unless id.nil?
command.query['maxResults'] = max_results unless max_results.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['parentId'] = parent_id unless parent_id.nil?
command.query['part'] = part unless part.nil?
command.query['textFormat'] = text_format unless text_format.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Expresses the caller's opinion that one or more comments should be flagged as
# spam.
# @param [String] id
# The id parameter specifies a comma-separated list of IDs of comments that the
# caller believes should be classified as spam.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def mark_comment_as_spam(id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'comments/markAsSpam', options)
command.query['id'] = id unless id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Sets the moderation status of one or more comments. The API request must be
# authorized by the owner of the channel or video associated with the comments.
# @param [String] id
# The id parameter specifies a comma-separated list of IDs that identify the
# comments for which you are updating the moderation status.
# @param [String] moderation_status
# Identifies the new moderation status of the specified comments.
# @param [Boolean] ban_author
# The banAuthor parameter lets you indicate that you want to automatically
# reject any additional comments written by the comment's author. Set the
# parameter value to true to ban the author.
# Note: This parameter is only valid if the moderationStatus parameter is also
# set to rejected.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def set_comment_moderation_status(id, moderation_status, ban_author: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'comments/setModerationStatus', options)
command.query['banAuthor'] = ban_author unless ban_author.nil?
command.query['id'] = id unless id.nil?
command.query['moderationStatus'] = moderation_status unless moderation_status.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Modifies a comment.
# @param [String] part
# The part parameter identifies the properties that the API response will
# include. You must at least include the snippet part in the parameter value
# since that part contains all of the properties that the API request can update.
# @param [Google::Apis::YoutubeV3::Comment] comment_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::Comment] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::Comment]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def update_comment(part, comment_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:put, 'comments', options)
command.request_representation = Google::Apis::YoutubeV3::Comment::Representation
command.request_object = comment_object
command.response_representation = Google::Apis::YoutubeV3::Comment::Representation
command.response_class = Google::Apis::YoutubeV3::Comment
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a list of categories that can be associated with YouTube channels.
# @param [String] part
# The part parameter specifies the guideCategory resource properties that the
# API response will include. Set the parameter value to snippet.
# @param [String] hl
# The hl parameter specifies the language that will be used for text values in
# the API response.
# @param [String] id
# The id parameter specifies a comma-separated list of the YouTube channel
# category ID(s) for the resource(s) that are being retrieved. In a
# guideCategory resource, the id property specifies the YouTube channel category
# ID.
# @param [String] region_code
# The regionCode parameter instructs the API to return the list of guide
# categories available in the specified country. The parameter value is an ISO
# 3166-1 alpha-2 country code.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListGuideCategoriesResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListGuideCategoriesResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_guide_categories(part, hl: nil, id: nil, region_code: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'guideCategories', options)
command.response_representation = Google::Apis::YoutubeV3::ListGuideCategoriesResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListGuideCategoriesResponse
command.query['hl'] = hl unless hl.nil?
command.query['id'] = id unless id.nil?
command.query['part'] = part unless part.nil?
command.query['regionCode'] = region_code unless region_code.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a list of application languages that the YouTube website supports.
# @param [String] part
# The part parameter specifies the i18nLanguage resource properties that the API
# response will include. Set the parameter value to snippet.
# @param [String] hl
# The hl parameter specifies the language that should be used for text values in
# the API response.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListI18nLanguagesResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListI18nLanguagesResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_i18n_languages(part, hl: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'i18nLanguages', options)
command.response_representation = Google::Apis::YoutubeV3::ListI18nLanguagesResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListI18nLanguagesResponse
command.query['hl'] = hl unless hl.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a list of content regions that the YouTube website supports.
# @param [String] part
# The part parameter specifies the i18nRegion resource properties that the API
# response will include. Set the parameter value to snippet.
# @param [String] hl
# The hl parameter specifies the language that should be used for text values in
# the API response.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListI18nRegionsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListI18nRegionsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_i18n_regions(part, hl: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'i18nRegions', options)
command.response_representation = Google::Apis::YoutubeV3::ListI18nRegionsResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListI18nRegionsResponse
command.query['hl'] = hl unless hl.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Binds a YouTube broadcast to a stream or removes an existing binding between a
# broadcast and a stream. A broadcast can only be bound to one video stream,
# though a video stream may be bound to more than one broadcast.
# @param [String] id
# The id parameter specifies the unique ID of the broadcast that is being bound
# to a video stream.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more
# liveBroadcast resource properties that the API response will include. The part
# names that you can include in the parameter value are id, snippet,
# contentDetails, and status.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [String] stream_id
# The streamId parameter specifies the unique ID of the video stream that is
# being bound to a broadcast. If this parameter is omitted, the API will remove
# any existing binding between the broadcast and a video stream.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::LiveBroadcast] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::LiveBroadcast]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def bind_live_broadcast(id, part, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, stream_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'liveBroadcasts/bind', options)
command.response_representation = Google::Apis::YoutubeV3::LiveBroadcast::Representation
command.response_class = Google::Apis::YoutubeV3::LiveBroadcast
command.query['id'] = id unless id.nil?
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['part'] = part unless part.nil?
command.query['streamId'] = stream_id unless stream_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Controls the settings for a slate that can be displayed in the broadcast
# stream.
# @param [String] id
# The id parameter specifies the YouTube live broadcast ID that uniquely
# identifies the broadcast in which the slate is being updated.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more
# liveBroadcast resource properties that the API response will include. The part
# names that you can include in the parameter value are id, snippet,
# contentDetails, and status.
# @param [Boolean] display_slate
# The displaySlate parameter specifies whether the slate is being enabled or
# disabled.
# @param [Fixnum] offset_time_ms
# The offsetTimeMs parameter specifies a positive time offset when the specified
# slate change will occur. The value is measured in milliseconds from the
# beginning of the broadcast's monitor stream, which is the time that the
# testing phase for the broadcast began. Even though it is specified in
# milliseconds, the value is actually an approximation, and YouTube completes
# the requested action as closely as possible to that time.
# If you do not specify a value for this parameter, then YouTube performs the
# action as soon as possible. See the Getting started guide for more details.
# Important: You should only specify a value for this parameter if your
# broadcast stream is delayed.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [DateTime] walltime
# The walltime parameter specifies the wall clock time at which the specified
# slate change will occur. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:
# ss.sssZ) format.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::LiveBroadcast] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::LiveBroadcast]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def control_live_broadcast(id, part, display_slate: nil, offset_time_ms: nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, walltime: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'liveBroadcasts/control', options)
command.response_representation = Google::Apis::YoutubeV3::LiveBroadcast::Representation
command.response_class = Google::Apis::YoutubeV3::LiveBroadcast
command.query['displaySlate'] = display_slate unless display_slate.nil?
command.query['id'] = id unless id.nil?
command.query['offsetTimeMs'] = offset_time_ms unless offset_time_ms.nil?
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['part'] = part unless part.nil?
command.query['walltime'] = walltime unless walltime.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Deletes a broadcast.
# @param [String] id
# The id parameter specifies the YouTube live broadcast ID for the resource that
# is being deleted.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_live_broadcast(id, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:delete, 'liveBroadcasts', options)
command.query['id'] = id unless id.nil?
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Creates a broadcast.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include.
# The part properties that you can include in the parameter value are id,
# snippet, contentDetails, and status.
# @param [Google::Apis::YoutubeV3::LiveBroadcast] live_broadcast_object
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::LiveBroadcast] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::LiveBroadcast]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_live_broadcast(part, live_broadcast_object = nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'liveBroadcasts', options)
command.request_representation = Google::Apis::YoutubeV3::LiveBroadcast::Representation
command.request_object = live_broadcast_object
command.response_representation = Google::Apis::YoutubeV3::LiveBroadcast::Representation
command.response_class = Google::Apis::YoutubeV3::LiveBroadcast
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a list of YouTube broadcasts that match the API request parameters.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more
# liveBroadcast resource properties that the API response will include. The part
# names that you can include in the parameter value are id, snippet,
# contentDetails, and status.
# @param [String] broadcast_status
# The broadcastStatus parameter filters the API response to only include
# broadcasts with the specified status.
# @param [String] broadcast_type
# The broadcastType parameter filters the API response to only include
# broadcasts with the specified type. This is only compatible with the mine
# filter for now.
# @param [String] id
# The id parameter specifies a comma-separated list of YouTube broadcast IDs
# that identify the broadcasts being retrieved. In a liveBroadcast resource, the
# id property specifies the broadcast's ID.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of items that should be
# returned in the result set.
# @param [Boolean] mine
# The mine parameter can be used to instruct the API to only return broadcasts
# owned by the authenticated user. Set the parameter value to true to only
# retrieve your own broadcasts.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [String] page_token
# The pageToken parameter identifies a specific page in the result set that
# should be returned. In an API response, the nextPageToken and prevPageToken
# properties identify other pages that could be retrieved.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListLiveBroadcastsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListLiveBroadcastsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_live_broadcasts(part, broadcast_status: nil, broadcast_type: nil, id: nil, max_results: nil, mine: nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'liveBroadcasts', options)
command.response_representation = Google::Apis::YoutubeV3::ListLiveBroadcastsResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListLiveBroadcastsResponse
command.query['broadcastStatus'] = broadcast_status unless broadcast_status.nil?
command.query['broadcastType'] = broadcast_type unless broadcast_type.nil?
command.query['id'] = id unless id.nil?
command.query['maxResults'] = max_results unless max_results.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['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Changes the status of a YouTube live broadcast and initiates any processes
# associated with the new status. For example, when you transition a broadcast's
# status to testing, YouTube starts to transmit video to that broadcast's
# monitor stream. Before calling this method, you should confirm that the value
# of the status.streamStatus property for the stream bound to your broadcast is
# active.
# @param [String] broadcast_status
# The broadcastStatus parameter identifies the state to which the broadcast is
# changing. Note that to transition a broadcast to either the testing or live
# state, the status.streamStatus must be active for the stream that the
# broadcast is bound to.
# @param [String] id
# The id parameter specifies the unique ID of the broadcast that is
# transitioning to another status.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more
# liveBroadcast resource properties that the API response will include. The part
# names that you can include in the parameter value are id, snippet,
# contentDetails, and status.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::LiveBroadcast] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::LiveBroadcast]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def transition_live_broadcast(broadcast_status, id, part, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'liveBroadcasts/transition', options)
command.response_representation = Google::Apis::YoutubeV3::LiveBroadcast::Representation
command.response_class = Google::Apis::YoutubeV3::LiveBroadcast
command.query['broadcastStatus'] = broadcast_status unless broadcast_status.nil?
command.query['id'] = id unless id.nil?
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Updates a broadcast. For example, you could modify the broadcast settings
# defined in the liveBroadcast resource's contentDetails object.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include.
# The part properties that you can include in the parameter value are id,
# snippet, contentDetails, and status.
# Note that this method will override the existing values for all of the mutable
# properties that are contained in any parts that the parameter value specifies.
# For example, a broadcast's privacy status is defined in the status part. As
# such, if your request is updating a private or unlisted broadcast, and the
# request's part parameter value includes the status part, the broadcast's
# privacy setting will be updated to whatever value the request body specifies.
# If the request body does not specify a value, the existing privacy setting
# will be removed and the broadcast will revert to the default privacy setting.
# @param [Google::Apis::YoutubeV3::LiveBroadcast] live_broadcast_object
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::LiveBroadcast] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::LiveBroadcast]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def update_live_broadcast(part, live_broadcast_object = nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:put, 'liveBroadcasts', options)
command.request_representation = Google::Apis::YoutubeV3::LiveBroadcast::Representation
command.request_object = live_broadcast_object
command.response_representation = Google::Apis::YoutubeV3::LiveBroadcast::Representation
command.response_class = Google::Apis::YoutubeV3::LiveBroadcast
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Removes a chat ban.
# @param [String] id
# The id parameter identifies the chat ban to remove. The value uniquely
# identifies both the ban and the chat.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_live_chat_ban(id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:delete, 'liveChat/bans', options)
command.query['id'] = id unless id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Adds a new ban to the chat.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response returns. Set the parameter value to snippet.
# @param [Google::Apis::YoutubeV3::LiveChatBan] live_chat_ban_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::LiveChatBan] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::LiveChatBan]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_live_chat_ban(part, live_chat_ban_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'liveChat/bans', options)
command.request_representation = Google::Apis::YoutubeV3::LiveChatBan::Representation
command.request_object = live_chat_ban_object
command.response_representation = Google::Apis::YoutubeV3::LiveChatBan::Representation
command.response_class = Google::Apis::YoutubeV3::LiveChatBan
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Deletes a chat message.
# @param [String] id
# The id parameter specifies the YouTube chat message ID of the resource that is
# being deleted.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_live_chat_message(id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:delete, 'liveChat/messages', options)
command.query['id'] = id unless id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Adds a message to a live chat.
# @param [String] part
# The part parameter serves two purposes. It identifies the properties that the
# write operation will set as well as the properties that the API response will
# include. Set the parameter value to snippet.
# @param [Google::Apis::YoutubeV3::LiveChatMessage] live_chat_message_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::LiveChatMessage] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::LiveChatMessage]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_live_chat_message(part, live_chat_message_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'liveChat/messages', options)
command.request_representation = Google::Apis::YoutubeV3::LiveChatMessage::Representation
command.request_object = live_chat_message_object
command.response_representation = Google::Apis::YoutubeV3::LiveChatMessage::Representation
command.response_class = Google::Apis::YoutubeV3::LiveChatMessage
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Lists live chat messages for a specific chat.
# @param [String] live_chat_id
# The liveChatId parameter specifies the ID of the chat whose messages will be
# returned.
# @param [String] part
# The part parameter specifies the liveChatComment resource parts that the API
# response will include. Supported values are id and snippet.
# @param [String] hl
# The hl parameter instructs the API to retrieve localized resource metadata for
# a specific application language that the YouTube website supports. The
# parameter value must be a language code included in the list returned by the
# i18nLanguages.list method.
# If localized resource details are available in that language, the resource's
# snippet.localized object will contain the localized values. However, if
# localized details are not available, the snippet.localized object will contain
# resource details in the resource's default language.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of messages that should
# be returned in the result set.
# @param [String] page_token
# The pageToken parameter identifies a specific page in the result set that
# should be returned. In an API response, the nextPageToken property identify
# other pages that could be retrieved.
# @param [Fixnum] profile_image_size
# The profileImageSize parameter specifies the size of the user profile pictures
# that should be returned in the result set. Default: 88.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::LiveChatMessageListResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::LiveChatMessageListResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_live_chat_messages(live_chat_id, part, hl: nil, max_results: nil, page_token: nil, profile_image_size: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'liveChat/messages', options)
command.response_representation = Google::Apis::YoutubeV3::LiveChatMessageListResponse::Representation
command.response_class = Google::Apis::YoutubeV3::LiveChatMessageListResponse
command.query['hl'] = hl unless hl.nil?
command.query['liveChatId'] = live_chat_id unless live_chat_id.nil?
command.query['maxResults'] = max_results unless max_results.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['part'] = part unless part.nil?
command.query['profileImageSize'] = profile_image_size unless profile_image_size.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Removes a chat moderator.
# @param [String] id
# The id parameter identifies the chat moderator to remove. The value uniquely
# identifies both the moderator and the chat.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_live_chat_moderator(id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:delete, 'liveChat/moderators', options)
command.query['id'] = id unless id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Adds a new moderator for the chat.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response returns. Set the parameter value to snippet.
# @param [Google::Apis::YoutubeV3::LiveChatModerator] live_chat_moderator_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::LiveChatModerator] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::LiveChatModerator]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_live_chat_moderator(part, live_chat_moderator_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'liveChat/moderators', options)
command.request_representation = Google::Apis::YoutubeV3::LiveChatModerator::Representation
command.request_object = live_chat_moderator_object
command.response_representation = Google::Apis::YoutubeV3::LiveChatModerator::Representation
command.response_class = Google::Apis::YoutubeV3::LiveChatModerator
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Lists moderators for a live chat.
# @param [String] live_chat_id
# The liveChatId parameter specifies the YouTube live chat for which the API
# should return moderators.
# @param [String] part
# The part parameter specifies the liveChatModerator resource parts that the API
# response will include. Supported values are id and snippet.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of items that should be
# returned in the result set.
# @param [String] page_token
# The pageToken parameter identifies a specific page in the result set that
# should be returned. In an API response, the nextPageToken and prevPageToken
# properties identify other pages that could be retrieved.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::LiveChatModeratorListResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::LiveChatModeratorListResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_live_chat_moderators(live_chat_id, part, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'liveChat/moderators', options)
command.response_representation = Google::Apis::YoutubeV3::LiveChatModeratorListResponse::Representation
command.response_class = Google::Apis::YoutubeV3::LiveChatModeratorListResponse
command.query['liveChatId'] = live_chat_id unless live_chat_id.nil?
command.query['maxResults'] = max_results unless max_results.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Deletes a video stream.
# @param [String] id
# The id parameter specifies the YouTube live stream ID for the resource that is
# being deleted.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_live_stream(id, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:delete, 'liveStreams', options)
command.query['id'] = id unless id.nil?
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Creates a video stream. The stream enables you to send your video to YouTube,
# which can then broadcast the video to your audience.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include.
# The part properties that you can include in the parameter value are id,
# snippet, cdn, and status.
# @param [Google::Apis::YoutubeV3::LiveStream] live_stream_object
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::LiveStream] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::LiveStream]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_live_stream(part, live_stream_object = nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'liveStreams', options)
command.request_representation = Google::Apis::YoutubeV3::LiveStream::Representation
command.request_object = live_stream_object
command.response_representation = Google::Apis::YoutubeV3::LiveStream::Representation
command.response_class = Google::Apis::YoutubeV3::LiveStream
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a list of video streams that match the API request parameters.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more liveStream
# resource properties that the API response will include. The part names that
# you can include in the parameter value are id, snippet, cdn, and status.
# @param [String] id
# The id parameter specifies a comma-separated list of YouTube stream IDs that
# identify the streams being retrieved. In a liveStream resource, the id
# property specifies the stream's ID.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of items that should be
# returned in the result set.
# @param [Boolean] mine
# The mine parameter can be used to instruct the API to only return streams
# owned by the authenticated user. Set the parameter value to true to only
# retrieve your own streams.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [String] page_token
# The pageToken parameter identifies a specific page in the result set that
# should be returned. In an API response, the nextPageToken and prevPageToken
# properties identify other pages that could be retrieved.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListLiveStreamsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListLiveStreamsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_live_streams(part, id: nil, max_results: nil, mine: nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'liveStreams', options)
command.response_representation = Google::Apis::YoutubeV3::ListLiveStreamsResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListLiveStreamsResponse
command.query['id'] = id unless id.nil?
command.query['maxResults'] = max_results unless max_results.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['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Updates a video stream. If the properties that you want to change cannot be
# updated, then you need to create a new stream with the proper settings.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include.
# The part properties that you can include in the parameter value are id,
# snippet, cdn, and status.
# Note that this method will override the existing values for all of the mutable
# properties that are contained in any parts that the parameter value specifies.
# If the request body does not specify a value for a mutable property, the
# existing value for that property will be removed.
# @param [Google::Apis::YoutubeV3::LiveStream] live_stream_object
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::LiveStream] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::LiveStream]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def update_live_stream(part, live_stream_object = nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:put, 'liveStreams', options)
command.request_representation = Google::Apis::YoutubeV3::LiveStream::Representation
command.request_object = live_stream_object
command.response_representation = Google::Apis::YoutubeV3::LiveStream::Representation
command.response_class = Google::Apis::YoutubeV3::LiveStream
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Lists members for a channel.
# @param [String] part
# The part parameter specifies the member resource parts that the API response
# will include. Supported values are id and snippet.
# @param [String] has_access_to_level
# The hasAccessToLevel parameter specifies, when set, the ID of a pricing level
# that members from the results set should have access to. When not set, all
# members will be considered, regardless of their active pricing level.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of items that should be
# returned in the result set.
# @param [String] mode
# The mode parameter specifies which channel members to return.
# @param [String] page_token
# The pageToken parameter identifies a specific page in the result set that
# should be returned. In an API response, the nextPageToken and prevPageToken
# properties identify other pages that could be retrieved.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::MemberListResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::MemberListResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_members(part, has_access_to_level: nil, max_results: nil, mode: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'members', options)
command.response_representation = Google::Apis::YoutubeV3::MemberListResponse::Representation
command.response_class = Google::Apis::YoutubeV3::MemberListResponse
command.query['hasAccessToLevel'] = has_access_to_level unless has_access_to_level.nil?
command.query['maxResults'] = max_results unless max_results.nil?
command.query['mode'] = mode unless mode.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Lists pricing levels for a channel.
# @param [String] part
# The part parameter specifies the membershipsLevel resource parts that the API
# response will include. Supported values are id and snippet.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::MembershipsLevelListResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::MembershipsLevelListResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_memberships_levels(part, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'membershipsLevels', options)
command.response_representation = Google::Apis::YoutubeV3::MembershipsLevelListResponse::Representation
command.response_class = Google::Apis::YoutubeV3::MembershipsLevelListResponse
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Deletes a playlist item.
# @param [String] id
# The id parameter specifies the YouTube playlist item ID for the playlist item
# that is being deleted. In a playlistItem resource, the id property specifies
# the playlist item's ID.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_playlist_item(id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:delete, 'playlistItems', options)
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?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Adds a resource to a playlist.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include.
# @param [Google::Apis::YoutubeV3::PlaylistItem] playlist_item_object
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::PlaylistItem] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::PlaylistItem]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_playlist_item(part, playlist_item_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'playlistItems', options)
command.request_representation = Google::Apis::YoutubeV3::PlaylistItem::Representation
command.request_object = playlist_item_object
command.response_representation = Google::Apis::YoutubeV3::PlaylistItem::Representation
command.response_class = Google::Apis::YoutubeV3::PlaylistItem
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a collection of playlist items that match the API request parameters.
# You can retrieve all of the playlist items in a specified playlist or retrieve
# one or more playlist items by their unique IDs.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more
# playlistItem resource properties that the API response will include.
# If the parameter identifies a property that contains child properties, the
# child properties will be included in the response. For example, in a
# playlistItem resource, the snippet property contains numerous fields,
# including the title, description, position, and resourceId properties. As such,
# if you set part=snippet, the API response will contain all of those
# properties.
# @param [String] id
# The id parameter specifies a comma-separated list of one or more unique
# playlist item IDs.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of items that should be
# returned in the result set.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] page_token
# The pageToken parameter identifies a specific page in the result set that
# should be returned. In an API response, the nextPageToken and prevPageToken
# properties identify other pages that could be retrieved.
# @param [String] playlist_id
# The playlistId parameter specifies the unique ID of the playlist for which you
# want to retrieve playlist items. Note that even though this is an optional
# parameter, every request to retrieve playlist items must specify a value for
# either the id parameter or the playlistId parameter.
# @param [String] video_id
# The videoId parameter specifies that the request should return only the
# playlist items that contain the specified video.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListPlaylistItemsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListPlaylistItemsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_playlist_items(part, id: nil, max_results: nil, on_behalf_of_content_owner: nil, page_token: nil, playlist_id: nil, video_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'playlistItems', options)
command.response_representation = Google::Apis::YoutubeV3::ListPlaylistItemsResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListPlaylistItemsResponse
command.query['id'] = id unless id.nil?
command.query['maxResults'] = max_results unless max_results.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['part'] = part unless part.nil?
command.query['playlistId'] = playlist_id unless playlist_id.nil?
command.query['videoId'] = video_id unless video_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Modifies a playlist item. For example, you could update the item's position in
# the playlist.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include.
# Note that this method will override the existing values for all of the mutable
# properties that are contained in any parts that the parameter value specifies.
# For example, a playlist item can specify a start time and end time, which
# identify the times portion of the video that should play when users watch the
# video in the playlist. If your request is updating a playlist item that sets
# these values, and the request's part parameter value includes the
# contentDetails part, the playlist item's start and end times will be updated
# to whatever value the request body specifies. If the request body does not
# specify values, the existing start and end times will be removed and replaced
# with the default settings.
# @param [Google::Apis::YoutubeV3::PlaylistItem] playlist_item_object
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::PlaylistItem] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::PlaylistItem]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def update_playlist_item(part, playlist_item_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:put, 'playlistItems', options)
command.request_representation = Google::Apis::YoutubeV3::PlaylistItem::Representation
command.request_object = playlist_item_object
command.response_representation = Google::Apis::YoutubeV3::PlaylistItem::Representation
command.response_class = Google::Apis::YoutubeV3::PlaylistItem
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Deletes a playlist.
# @param [String] id
# The id parameter specifies the YouTube playlist ID for the playlist that is
# being deleted. In a playlist resource, the id property specifies the playlist'
# s ID.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_playlist(id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:delete, 'playlists', options)
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?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Creates a playlist.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include.
# @param [Google::Apis::YoutubeV3::Playlist] playlist_object
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::Playlist] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::Playlist]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_playlist(part, playlist_object = nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'playlists', options)
command.request_representation = Google::Apis::YoutubeV3::Playlist::Representation
command.request_object = playlist_object
command.response_representation = Google::Apis::YoutubeV3::Playlist::Representation
command.response_class = Google::Apis::YoutubeV3::Playlist
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a collection of playlists that match the API request parameters. For
# example, you can retrieve all playlists that the authenticated user owns, or
# you can retrieve one or more playlists by their unique IDs.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more playlist
# resource properties that the API response will include.
# If the parameter identifies a property that contains child properties, the
# child properties will be included in the response. For example, in a playlist
# resource, the snippet property contains properties like author, title,
# description, tags, and timeCreated. As such, if you set part=snippet, the API
# response will contain all of those properties.
# @param [String] channel_id
# This value indicates that the API should only return the specified channel's
# playlists.
# @param [String] hl
# The hl parameter should be used for filter out the properties that are not in
# the given language. Used for the snippet part.
# @param [String] id
# The id parameter specifies a comma-separated list of the YouTube playlist ID(s)
# for the resource(s) that are being retrieved. In a playlist resource, the id
# property specifies the playlist's YouTube playlist ID.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of items that should be
# returned in the result set.
# @param [Boolean] mine
# Set this parameter's value to true to instruct the API to only return
# playlists owned by the authenticated user.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [String] page_token
# The pageToken parameter identifies a specific page in the result set that
# should be returned. In an API response, the nextPageToken and prevPageToken
# properties identify other pages that could be retrieved.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListPlaylistResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListPlaylistResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_playlists(part, channel_id: nil, hl: nil, id: nil, max_results: nil, mine: nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'playlists', options)
command.response_representation = Google::Apis::YoutubeV3::ListPlaylistResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListPlaylistResponse
command.query['channelId'] = channel_id unless channel_id.nil?
command.query['hl'] = hl unless hl.nil?
command.query['id'] = id unless id.nil?
command.query['maxResults'] = max_results unless max_results.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['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Modifies a playlist. For example, you could change a playlist's title,
# description, or privacy status.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include.
# Note that this method will override the existing values for mutable properties
# that are contained in any parts that the request body specifies. For example,
# a playlist's description is contained in the snippet part, which must be
# included in the request body. If the request does not specify a value for the
# snippet.description property, the playlist's existing description will be
# deleted.
# @param [Google::Apis::YoutubeV3::Playlist] playlist_object
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::Playlist] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::Playlist]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def update_playlist(part, playlist_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:put, 'playlists', options)
command.request_representation = Google::Apis::YoutubeV3::Playlist::Representation
command.request_object = playlist_object
command.response_representation = Google::Apis::YoutubeV3::Playlist::Representation
command.response_class = Google::Apis::YoutubeV3::Playlist
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a collection of search results that match the query parameters
# specified in the API request. By default, a search result set identifies
# matching video, channel, and playlist resources, but you can also configure
# queries to only retrieve a specific type of resource.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more search
# resource properties that the API response will include. Set the parameter
# value to snippet.
# @param [String] channel_id
# The channelId parameter indicates that the API response should only contain
# resources created by the channel
# @param [String] channel_type
# The channelType parameter lets you restrict a search to a particular type of
# channel.
# @param [String] event_type
# The eventType parameter restricts a search to broadcast events. If you specify
# a value for this parameter, you must also set the type parameter's value to
# video.
# @param [Boolean] for_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The forContentOwner parameter restricts the search to only retrieve resources
# owned by the content owner specified by the onBehalfOfContentOwner parameter.
# The user must be authenticated using a CMS account linked to the specified
# content owner and onBehalfOfContentOwner must be provided.
# @param [Boolean] for_developer
# The forDeveloper parameter restricts the search to only retrieve videos
# uploaded via the developer's application or website. The API server uses the
# request's authorization credentials to identify the developer. Therefore, a
# developer can restrict results to videos uploaded through the developer's own
# app or website but not to videos uploaded through other apps or sites.
# @param [Boolean] for_mine
# The forMine parameter restricts the search to only retrieve videos owned by
# the authenticated user. If you set this parameter to true, then the type
# parameter's value must also be set to video.
# @param [String] location
# The location parameter, in conjunction with the locationRadius parameter,
# defines a circular geographic area and also restricts a search to videos that
# specify, in their metadata, a geographic location that falls within that area.
# The parameter value is a string that specifies latitude/longitude coordinates
# e.g. (37.42307,-122.08427).
# - The location parameter value identifies the point at the center of the area.
# - The locationRadius parameter specifies the maximum distance that the
# location associated with a video can be from that point for the video to still
# be included in the search results.The API returns an error if your request
# specifies a value for the location parameter but does not also specify a value
# for the locationRadius parameter.
# @param [String] location_radius
# The locationRadius parameter, in conjunction with the location parameter,
# defines a circular geographic area.
# The parameter value must be a floating point number followed by a measurement
# unit. Valid measurement units are m, km, ft, and mi. For example, valid
# parameter values include 1500m, 5km, 10000ft, and 0.75mi. The API does not
# support locationRadius parameter values larger than 1000 kilometers.
# Note: See the definition of the location parameter for more information.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of items that should be
# returned in the result set.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] order
# The order parameter specifies the method that will be used to order resources
# in the API response.
# @param [String] page_token
# The pageToken parameter identifies a specific page in the result set that
# should be returned. In an API response, the nextPageToken and prevPageToken
# properties identify other pages that could be retrieved.
# @param [DateTime] published_after
# The publishedAfter parameter indicates that the API response should only
# contain resources created after the specified time. The value is an RFC 3339
# formatted date-time value (1970-01-01T00:00:00Z).
# @param [DateTime] published_before
# The publishedBefore parameter indicates that the API response should only
# contain resources created before the specified time. The value is an RFC 3339
# formatted date-time value (1970-01-01T00:00:00Z).
# @param [String] q
# The q parameter specifies the query term to search for.
# Your request can also use the Boolean NOT (-) and OR (|) operators to exclude
# videos or to find videos that are associated with one of several search terms.
# For example, to search for videos matching either "boating" or "sailing", set
# the q parameter value to boating|sailing. Similarly, to search for videos
# matching either "boating" or "sailing" but not "fishing", set the q parameter
# value to boating|sailing -fishing. Note that the pipe character must be URL-
# escaped when it is sent in your API request. The URL-escaped value for the
# pipe character is %7C.
# @param [String] region_code
# The regionCode parameter instructs the API to return search results for the
# specified country. The parameter value is an ISO 3166-1 alpha-2 country code.
# @param [String] related_to_video_id
# The relatedToVideoId parameter retrieves a list of videos that are related to
# the video that the parameter value identifies. The parameter value must be set
# to a YouTube video ID and, if you are using this parameter, the type parameter
# must be set to video.
# @param [String] relevance_language
# The relevanceLanguage parameter instructs the API to return search results
# that are most relevant to the specified language. The parameter value is
# typically an ISO 639-1 two-letter language code. However, you should use the
# values zh-Hans for simplified Chinese and zh-Hant for traditional Chinese.
# Please note that results in other languages will still be returned if they are
# highly relevant to the search query term.
# @param [String] safe_search
# The safeSearch parameter indicates whether the search results should include
# restricted content as well as standard content.
# @param [String] topic_id
# The topicId parameter indicates that the API response should only contain
# resources associated with the specified topic. The value identifies a Freebase
# topic ID.
# @param [String] type
# The type parameter restricts a search query to only retrieve a particular type
# of resource. The value is a comma-separated list of resource types.
# @param [String] video_caption
# The videoCaption parameter indicates whether the API should filter video
# search results based on whether they have captions. If you specify a value for
# this parameter, you must also set the type parameter's value to video.
# @param [String] video_category_id
# The videoCategoryId parameter filters video search results based on their
# category. If you specify a value for this parameter, you must also set the
# type parameter's value to video.
# @param [String] video_definition
# The videoDefinition parameter lets you restrict a search to only include
# either high definition (HD) or standard definition (SD) videos. HD videos are
# available for playback in at least 720p, though higher resolutions, like 1080p,
# might also be available. If you specify a value for this parameter, you must
# also set the type parameter's value to video.
# @param [String] video_dimension
# The videoDimension parameter lets you restrict a search to only retrieve 2D or
# 3D videos. If you specify a value for this parameter, you must also set the
# type parameter's value to video.
# @param [String] video_duration
# The videoDuration parameter filters video search results based on their
# duration. If you specify a value for this parameter, you must also set the
# type parameter's value to video.
# @param [String] video_embeddable
# The videoEmbeddable parameter lets you to restrict a search to only videos
# that can be embedded into a webpage. If you specify a value for this parameter,
# you must also set the type parameter's value to video.
# @param [String] video_license
# The videoLicense parameter filters search results to only include videos with
# a particular license. YouTube lets video uploaders choose to attach either the
# Creative Commons license or the standard YouTube license to each of their
# videos. If you specify a value for this parameter, you must also set the type
# parameter's value to video.
# @param [String] video_syndicated
# The videoSyndicated parameter lets you to restrict a search to only videos
# that can be played outside youtube.com. If you specify a value for this
# parameter, you must also set the type parameter's value to video.
# @param [String] video_type
# The videoType parameter lets you restrict a search to a particular type of
# videos. If you specify a value for this parameter, you must also set the type
# parameter's value to video.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::SearchListsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::SearchListsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_searches(part, channel_id: nil, channel_type: nil, event_type: nil, for_content_owner: nil, for_developer: nil, for_mine: nil, location: nil, location_radius: nil, max_results: nil, on_behalf_of_content_owner: nil, order: nil, page_token: nil, published_after: nil, published_before: nil, q: nil, region_code: nil, related_to_video_id: nil, relevance_language: nil, safe_search: nil, topic_id: nil, type: nil, video_caption: nil, video_category_id: nil, video_definition: nil, video_dimension: nil, video_duration: nil, video_embeddable: nil, video_license: nil, video_syndicated: nil, video_type: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'search', options)
command.response_representation = Google::Apis::YoutubeV3::SearchListsResponse::Representation
command.response_class = Google::Apis::YoutubeV3::SearchListsResponse
command.query['channelId'] = channel_id unless channel_id.nil?
command.query['channelType'] = channel_type unless channel_type.nil?
command.query['eventType'] = event_type unless event_type.nil?
command.query['forContentOwner'] = for_content_owner unless for_content_owner.nil?
command.query['forDeveloper'] = for_developer unless for_developer.nil?
command.query['forMine'] = for_mine unless for_mine.nil?
command.query['location'] = location unless location.nil?
command.query['locationRadius'] = location_radius unless location_radius.nil?
command.query['maxResults'] = max_results unless max_results.nil?
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['order'] = order unless order.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['part'] = part unless part.nil?
command.query['publishedAfter'] = published_after unless published_after.nil?
command.query['publishedBefore'] = published_before unless published_before.nil?
command.query['q'] = q unless q.nil?
command.query['regionCode'] = region_code unless region_code.nil?
command.query['relatedToVideoId'] = related_to_video_id unless related_to_video_id.nil?
command.query['relevanceLanguage'] = relevance_language unless relevance_language.nil?
command.query['safeSearch'] = safe_search unless safe_search.nil?
command.query['topicId'] = topic_id unless topic_id.nil?
command.query['type'] = type unless type.nil?
command.query['videoCaption'] = video_caption unless video_caption.nil?
command.query['videoCategoryId'] = video_category_id unless video_category_id.nil?
command.query['videoDefinition'] = video_definition unless video_definition.nil?
command.query['videoDimension'] = video_dimension unless video_dimension.nil?
command.query['videoDuration'] = video_duration unless video_duration.nil?
command.query['videoEmbeddable'] = video_embeddable unless video_embeddable.nil?
command.query['videoLicense'] = video_license unless video_license.nil?
command.query['videoSyndicated'] = video_syndicated unless video_syndicated.nil?
command.query['videoType'] = video_type unless video_type.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Lists sponsors for a channel.
# @param [String] part
# The part parameter specifies the sponsor resource parts that the API response
# will include. Supported values are id and snippet.
# @param [String] filter
# The filter parameter specifies which channel sponsors to return.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of items that should be
# returned in the result set.
# @param [String] page_token
# The pageToken parameter identifies a specific page in the result set that
# should be returned. In an API response, the nextPageToken and prevPageToken
# properties identify other pages that could be retrieved.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::SponsorListResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::SponsorListResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_sponsors(part, filter: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'sponsors', options)
command.response_representation = Google::Apis::YoutubeV3::SponsorListResponse::Representation
command.response_class = Google::Apis::YoutubeV3::SponsorListResponse
command.query['filter'] = filter unless filter.nil?
command.query['maxResults'] = max_results unless max_results.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Deletes a subscription.
# @param [String] id
# The id parameter specifies the YouTube subscription ID for the resource that
# is being deleted. In a subscription resource, the id property specifies the
# YouTube subscription ID.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_subscription(id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:delete, 'subscriptions', options)
command.query['id'] = id unless id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Adds a subscription for the authenticated user's channel.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include.
# @param [Google::Apis::YoutubeV3::Subscription] subscription_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::Subscription] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::Subscription]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_subscription(part, subscription_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'subscriptions', options)
command.request_representation = Google::Apis::YoutubeV3::Subscription::Representation
command.request_object = subscription_object
command.response_representation = Google::Apis::YoutubeV3::Subscription::Representation
command.response_class = Google::Apis::YoutubeV3::Subscription
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns subscription resources that match the API request criteria.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more
# subscription resource properties that the API response will include.
# If the parameter identifies a property that contains child properties, the
# child properties will be included in the response. For example, in a
# subscription resource, the snippet property contains other properties, such as
# a display title for the subscription. If you set part=snippet, the API
# response will also contain all of those nested properties.
# @param [String] channel_id
# The channelId parameter specifies a YouTube channel ID. The API will only
# return that channel's subscriptions.
# @param [String] for_channel_id
# The forChannelId parameter specifies a comma-separated list of channel IDs.
# The API response will then only contain subscriptions matching those channels.
# @param [String] id
# The id parameter specifies a comma-separated list of the YouTube subscription
# ID(s) for the resource(s) that are being retrieved. In a subscription resource,
# the id property specifies the YouTube subscription ID.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of items that should be
# returned in the result set.
# @param [Boolean] mine
# Set this parameter's value to true to retrieve a feed of the authenticated
# user's subscriptions.
# @param [Boolean] my_recent_subscribers
# Set this parameter's value to true to retrieve a feed of the subscribers of
# the authenticated user in reverse chronological order (newest first).
# @param [Boolean] my_subscribers
# Set this parameter's value to true to retrieve a feed of the subscribers of
# the authenticated user in no particular order.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [String] order
# The order parameter specifies the method that will be used to sort resources
# in the API response.
# @param [String] page_token
# The pageToken parameter identifies a specific page in the result set that
# should be returned. In an API response, the nextPageToken and prevPageToken
# properties identify other pages that could be retrieved.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListSubscriptionResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListSubscriptionResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_subscriptions(part, channel_id: nil, for_channel_id: nil, id: nil, max_results: nil, mine: nil, my_recent_subscribers: nil, my_subscribers: nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, order: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'subscriptions', options)
command.response_representation = Google::Apis::YoutubeV3::ListSubscriptionResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListSubscriptionResponse
command.query['channelId'] = channel_id unless channel_id.nil?
command.query['forChannelId'] = for_channel_id unless for_channel_id.nil?
command.query['id'] = id unless id.nil?
command.query['maxResults'] = max_results unless max_results.nil?
command.query['mine'] = mine unless mine.nil?
command.query['myRecentSubscribers'] = my_recent_subscribers unless my_recent_subscribers.nil?
command.query['mySubscribers'] = my_subscribers unless my_subscribers.nil?
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['order'] = order unless order.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Lists Super Chat events for a channel.
# @param [String] part
# The part parameter specifies the superChatEvent resource parts that the API
# response will include. Supported values are id and snippet.
# @param [String] hl
# The hl parameter instructs the API to retrieve localized resource metadata for
# a specific application language that the YouTube website supports. The
# parameter value must be a language code included in the list returned by the
# i18nLanguages.list method.
# If localized resource details are available in that language, the resource's
# snippet.localized object will contain the localized values. However, if
# localized details are not available, the snippet.localized object will contain
# resource details in the resource's default language.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of items that should be
# returned in the result set.
# @param [String] page_token
# The pageToken parameter identifies a specific page in the result set that
# should be returned. In an API response, the nextPageToken and prevPageToken
# properties identify other pages that could be retrieved.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::SuperChatEventListResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::SuperChatEventListResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_super_chat_events(part, hl: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'superChatEvents', options)
command.response_representation = Google::Apis::YoutubeV3::SuperChatEventListResponse::Representation
command.response_class = Google::Apis::YoutubeV3::SuperChatEventListResponse
command.query['hl'] = hl unless hl.nil?
command.query['maxResults'] = max_results unless max_results.nil?
command.query['pageToken'] = page_token unless page_token.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Uploads a custom video thumbnail to YouTube and sets it for a video.
# @param [String] video_id
# The videoId parameter specifies a YouTube video ID for which the custom video
# thumbnail is being provided.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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 actual CMS account that the user
# authenticates with must be linked to the specified YouTube content owner.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [IO, String] upload_source
# IO stream or filename containing content to upload
# @param [String] content_type
# Content type of the uploaded content.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::SetThumbnailResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::SetThumbnailResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def set_thumbnail(video_id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
if upload_source.nil?
command = make_simple_command(:post, 'thumbnails/set', options)
else
command = make_upload_command(:post, 'thumbnails/set', options)
command.upload_source = upload_source
command.upload_content_type = content_type
end
command.response_representation = Google::Apis::YoutubeV3::SetThumbnailResponse::Representation
command.response_class = Google::Apis::YoutubeV3::SetThumbnailResponse
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['videoId'] = video_id unless video_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a list of abuse reasons that can be used for reporting abusive videos.
# @param [String] part
# The part parameter specifies the videoCategory resource parts that the API
# response will include. Supported values are id and snippet.
# @param [String] hl
# The hl parameter specifies the language that should be used for text values in
# the API response.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListVideoAbuseReportReasonResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListVideoAbuseReportReasonResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_video_abuse_report_reasons(part, hl: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'videoAbuseReportReasons', options)
command.response_representation = Google::Apis::YoutubeV3::ListVideoAbuseReportReasonResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListVideoAbuseReportReasonResponse
command.query['hl'] = hl unless hl.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a list of categories that can be associated with YouTube videos.
# @param [String] part
# The part parameter specifies the videoCategory resource properties that the
# API response will include. Set the parameter value to snippet.
# @param [String] hl
# The hl parameter specifies the language that should be used for text values in
# the API response.
# @param [String] id
# The id parameter specifies a comma-separated list of video category IDs for
# the resources that you are retrieving.
# @param [String] region_code
# The regionCode parameter instructs the API to return the list of video
# categories available in the specified country. The parameter value is an ISO
# 3166-1 alpha-2 country code.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListVideoCategoryResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListVideoCategoryResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_video_categories(part, hl: nil, id: nil, region_code: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'videoCategories', options)
command.response_representation = Google::Apis::YoutubeV3::ListVideoCategoryResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListVideoCategoryResponse
command.query['hl'] = hl unless hl.nil?
command.query['id'] = id unless id.nil?
command.query['part'] = part unless part.nil?
command.query['regionCode'] = region_code unless region_code.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Deletes a YouTube video.
# @param [String] id
# The id parameter specifies the YouTube video ID for the resource that is being
# deleted. In a video resource, the id property specifies the video's ID.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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 actual CMS account that the user
# authenticates with must be linked to the specified YouTube content owner.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def delete_video(id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:delete, 'videos', options)
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?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Retrieves the ratings that the authorized user gave to a list of specified
# videos.
# @param [String] id
# The id parameter specifies a comma-separated list of the YouTube video ID(s)
# for the resource(s) for which you are retrieving rating data. In a video
# resource, the id property specifies the video's ID.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::GetVideoRatingResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::GetVideoRatingResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def get_video_rating(id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'videos/getRating', options)
command.response_representation = Google::Apis::YoutubeV3::GetVideoRatingResponse::Representation
command.response_class = Google::Apis::YoutubeV3::GetVideoRatingResponse
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?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Uploads a video to YouTube and optionally sets the video's metadata.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include.
# Note that not all parts contain properties that can be set when inserting or
# updating a video. For example, the statistics object encapsulates statistics
# that YouTube calculates for a video and does not contain values that you can
# set or modify. If the parameter value specifies a part that does not contain
# mutable values, that part will still be included in the API response.
# @param [Google::Apis::YoutubeV3::Video] video_object
# @param [Boolean] auto_levels
# The autoLevels parameter indicates whether YouTube should automatically
# enhance the video's lighting and color.
# @param [Boolean] notify_subscribers
# The notifySubscribers parameter indicates whether YouTube should send a
# notification about the new video to users who subscribe to the video's channel.
# A parameter value of True indicates that subscribers will be notified of
# newly uploaded videos. However, a channel owner who is uploading many videos
# might prefer to set the value to False to avoid sending a notification about
# each new video to the channel's subscribers.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] on_behalf_of_content_owner_channel
# This parameter can only be used in a properly authorized request. Note: This
# parameter is intended exclusively for YouTube content partners.
# The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID
# of the channel to which a video is being added. This parameter is required
# when a request specifies a value for the onBehalfOfContentOwner parameter, and
# it can only be used in conjunction with that parameter. In addition, the
# request must be authorized using a CMS account that is linked to the content
# owner that the onBehalfOfContentOwner parameter specifies. Finally, the
# channel that the onBehalfOfContentOwnerChannel parameter value specifies must
# be linked to the content owner that the onBehalfOfContentOwner parameter
# specifies.
# This parameter is intended for YouTube content partners that own and manage
# many different YouTube channels. It allows content owners to authenticate once
# and perform actions on behalf of the channel specified in the parameter value,
# without having to provide authentication credentials for each separate channel.
# @param [Boolean] stabilize
# The stabilize parameter indicates whether YouTube should adjust the video to
# remove shaky camera motions.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [IO, String] upload_source
# IO stream or filename containing content to upload
# @param [String] content_type
# Content type of the uploaded content.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::Video] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::Video]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def insert_video(part, video_object = nil, auto_levels: nil, notify_subscribers: nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, stabilize: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
if upload_source.nil?
command = make_simple_command(:post, 'videos', options)
else
command = make_upload_command(:post, 'videos', options)
command.upload_source = upload_source
command.upload_content_type = content_type
end
command.request_representation = Google::Apis::YoutubeV3::Video::Representation
command.request_object = video_object
command.response_representation = Google::Apis::YoutubeV3::Video::Representation
command.response_class = Google::Apis::YoutubeV3::Video
command.query['autoLevels'] = auto_levels unless auto_levels.nil?
command.query['notifySubscribers'] = notify_subscribers unless notify_subscribers.nil?
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
command.query['part'] = part unless part.nil?
command.query['stabilize'] = stabilize unless stabilize.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Returns a list of videos that match the API request parameters.
# @param [String] part
# The part parameter specifies a comma-separated list of one or more video
# resource properties that the API response will include.
# If the parameter identifies a property that contains child properties, the
# child properties will be included in the response. For example, in a video
# resource, the snippet property contains the channelId, title, description,
# tags, and categoryId properties. As such, if you set part=snippet, the API
# response will contain all of those properties.
# @param [String] chart
# The chart parameter identifies the chart that you want to retrieve.
# @param [String] hl
# The hl parameter instructs the API to retrieve localized resource metadata for
# a specific application language that the YouTube website supports. The
# parameter value must be a language code included in the list returned by the
# i18nLanguages.list method.
# If localized resource details are available in that language, the resource's
# snippet.localized object will contain the localized values. However, if
# localized details are not available, the snippet.localized object will contain
# resource details in the resource's default language.
# @param [String] id
# The id parameter specifies a comma-separated list of the YouTube video ID(s)
# for the resource(s) that are being retrieved. In a video resource, the id
# property specifies the video's ID.
# @param [String] locale
# DEPRECATED
# @param [Fixnum] max_height
# The maxHeight parameter specifies a maximum height of the embedded player. If
# maxWidth is provided, maxHeight may not be reached in order to not violate the
# width request.
# @param [Fixnum] max_results
# The maxResults parameter specifies the maximum number of items that should be
# returned in the result set.
# Note: This parameter is supported for use in conjunction with the myRating and
# chart parameters, but it is not supported for use in conjunction with the id
# parameter.
# @param [Fixnum] max_width
# The maxWidth parameter specifies a maximum width of the embedded player. If
# maxHeight is provided, maxWidth may not be reached in order to not violate the
# height request.
# @param [String] my_rating
# Set this parameter's value to like or dislike to instruct the API to only
# return videos liked or disliked by the authenticated user.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] page_token
# The pageToken parameter identifies a specific page in the result set that
# should be returned. In an API response, the nextPageToken and prevPageToken
# properties identify other pages that could be retrieved.
# Note: This parameter is supported for use in conjunction with the myRating and
# chart parameters, but it is not supported for use in conjunction with the id
# parameter.
# @param [String] region_code
# The regionCode parameter instructs the API to select a video chart available
# in the specified region. This parameter can only be used in conjunction with
# the chart parameter. The parameter value is an ISO 3166-1 alpha-2 country code.
# @param [String] video_category_id
# The videoCategoryId parameter identifies the video category for which the
# chart should be retrieved. This parameter can only be used in conjunction with
# the chart parameter. By default, charts are not restricted to a particular
# category.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::ListVideosResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::ListVideosResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def list_videos(part, chart: nil, hl: nil, id: nil, locale: nil, max_height: nil, max_results: nil, max_width: nil, my_rating: nil, on_behalf_of_content_owner: nil, page_token: nil, region_code: nil, video_category_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:get, 'videos', options)
command.response_representation = Google::Apis::YoutubeV3::ListVideosResponse::Representation
command.response_class = Google::Apis::YoutubeV3::ListVideosResponse
command.query['chart'] = chart unless chart.nil?
command.query['hl'] = hl unless hl.nil?
command.query['id'] = id unless id.nil?
command.query['locale'] = locale unless locale.nil?
command.query['maxHeight'] = max_height unless max_height.nil?
command.query['maxResults'] = max_results unless max_results.nil?
command.query['maxWidth'] = max_width unless max_width.nil?
command.query['myRating'] = my_rating unless my_rating.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['part'] = part unless part.nil?
command.query['regionCode'] = region_code unless region_code.nil?
command.query['videoCategoryId'] = video_category_id unless video_category_id.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Add a like or dislike rating to a video or remove a rating from a video.
# @param [String] id
# The id parameter specifies the YouTube video ID of the video that is being
# rated or having its rating removed.
# @param [String] rating
# Specifies the rating to record.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def rate_video(id, rating, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'videos/rate', options)
command.query['id'] = id unless id.nil?
command.query['rating'] = rating unless rating.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Report abuse for a video.
# @param [Google::Apis::YoutubeV3::VideoAbuseReport] video_abuse_report_object
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def report_video_abuse(video_abuse_report_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'videos/reportAbuse', options)
command.request_representation = Google::Apis::YoutubeV3::VideoAbuseReport::Representation
command.request_object = video_abuse_report_object
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?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Updates a video's metadata.
# @param [String] part
# The part parameter serves two purposes in this operation. It identifies the
# properties that the write operation will set as well as the properties that
# the API response will include.
# Note that this method will override the existing values for all of the mutable
# properties that are contained in any parts that the parameter value specifies.
# For example, a video's privacy setting is contained in the status part. As
# such, if your request is updating a private video, and the request's part
# parameter value includes the status part, the video's privacy setting will be
# updated to whatever value the request body specifies. If the request body does
# not specify a value, the existing privacy setting will be removed and the
# video will revert to the default privacy setting.
# In addition, not all parts contain properties that can be set when inserting
# or updating a video. For example, the statistics object encapsulates
# statistics that YouTube calculates for a video and does not contain values
# that you can set or modify. If the parameter value specifies a part that does
# not contain mutable values, that part will still be included in the API
# response.
# @param [Google::Apis::YoutubeV3::Video] video_object
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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 actual CMS account that the user
# authenticates with must be linked to the specified YouTube content owner.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::YoutubeV3::Video] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::YoutubeV3::Video]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def update_video(part, video_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:put, 'videos', options)
command.request_representation = Google::Apis::YoutubeV3::Video::Representation
command.request_object = video_object
command.response_representation = Google::Apis::YoutubeV3::Video::Representation
command.response_class = Google::Apis::YoutubeV3::Video
command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
command.query['part'] = part unless part.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Uploads a watermark image to YouTube and sets it for a channel.
# @param [String] channel_id
# The channelId parameter specifies the YouTube channel ID for which the
# watermark is being provided.
# @param [Google::Apis::YoutubeV3::InvideoBranding] invideo_branding_object
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [IO, String] upload_source
# IO stream or filename containing content to upload
# @param [String] content_type
# Content type of the uploaded content.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def set_watermark(channel_id, invideo_branding_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, upload_source: nil, content_type: nil, options: nil, &block)
if upload_source.nil?
command = make_simple_command(:post, 'watermarks/set', options)
else
command = make_upload_command(:post, 'watermarks/set', options)
command.upload_source = upload_source
command.upload_content_type = content_type
end
command.request_representation = Google::Apis::YoutubeV3::InvideoBranding::Representation
command.request_object = invideo_branding_object
command.query['channelId'] = channel_id unless channel_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?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
# Deletes a channel's watermark image.
# @param [String] channel_id
# The channelId parameter specifies the YouTube channel ID for which the
# watermark is being unset.
# @param [String] on_behalf_of_content_owner
# Note: This parameter is intended exclusively for YouTube content partners.
# The 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.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# An opaque string that represents a user for quota purposes. Must not exceed 40
# characters.
# @param [String] user_ip
# Deprecated. Please use quotaUser instead.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [NilClass] No result returned for this method
# @yieldparam err [StandardError] error object if request failed
#
# @return [void]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def unset_watermark(channel_id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
command = make_simple_command(:post, 'watermarks/unset', options)
command.query['channelId'] = channel_id unless channel_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?
command.query['userIp'] = user_ip unless user_ip.nil?
execute_or_queue_command(command, &block)
end
protected
def apply_command_defaults(command)
command.query['key'] = key unless key.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
command.query['userIp'] = user_ip unless user_ip.nil?
end
end
end
end
end
|