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
|
// Copyright 2021 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package run provides access to the Cloud Run Admin API.
//
// For product documentation, see: https://cloud.google.com/run/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/run/v1beta1"
// ...
// ctx := context.Background()
// runService, err := run.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// runService, err := run.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// runService, err := run.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package run // import "google.golang.org/api/run/v1beta1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
const apiId = "run:v1beta1"
const apiName = "run"
const apiVersion = "v1beta1"
const basePath = "https://run.googleapis.com/"
const mtlsBasePath = "https://run.mtls.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// View and manage your data across Google Cloud Platform services
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Customresourcedefinitions = NewCustomresourcedefinitionsService(s)
s.Namespaces = NewNamespacesService(s)
s.Projects = NewProjectsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Customresourcedefinitions *CustomresourcedefinitionsService
Namespaces *NamespacesService
Projects *ProjectsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewCustomresourcedefinitionsService(s *Service) *CustomresourcedefinitionsService {
rs := &CustomresourcedefinitionsService{s: s}
return rs
}
type CustomresourcedefinitionsService struct {
s *Service
}
func NewNamespacesService(s *Service) *NamespacesService {
rs := &NamespacesService{s: s}
rs.Customresourcedefinitions = NewNamespacesCustomresourcedefinitionsService(s)
return rs
}
type NamespacesService struct {
s *Service
Customresourcedefinitions *NamespacesCustomresourcedefinitionsService
}
func NewNamespacesCustomresourcedefinitionsService(s *Service) *NamespacesCustomresourcedefinitionsService {
rs := &NamespacesCustomresourcedefinitionsService{s: s}
return rs
}
type NamespacesCustomresourcedefinitionsService struct {
s *Service
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
rs.Locations = NewProjectsLocationsService(s)
return rs
}
type ProjectsService struct {
s *Service
Locations *ProjectsLocationsService
}
func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
rs := &ProjectsLocationsService{s: s}
rs.Customresourcedefinitions = NewProjectsLocationsCustomresourcedefinitionsService(s)
return rs
}
type ProjectsLocationsService struct {
s *Service
Customresourcedefinitions *ProjectsLocationsCustomresourcedefinitionsService
}
func NewProjectsLocationsCustomresourcedefinitionsService(s *Service) *ProjectsLocationsCustomresourcedefinitionsService {
rs := &ProjectsLocationsCustomresourcedefinitionsService{s: s}
return rs
}
type ProjectsLocationsCustomresourcedefinitionsService struct {
s *Service
}
// CustomResourceColumnDefinition: CustomResourceColumnDefinition
// specifies a column for server side printing.
type CustomResourceColumnDefinition struct {
// Description: description is a human readable description of this
// column. +optional
Description string `json:"description,omitempty"`
// Format: format is an optional OpenAPI type definition for this
// column. The 'name' format is applied to the primary identifier column
// to assist in clients identifying column is the resource name. See
// https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types
// for more. +optional
Format string `json:"format,omitempty"`
// JsonPath: JSONPath is a simple JSON path, i.e. with array notation.
JsonPath string `json:"jsonPath,omitempty"`
// Name: name is a human readable name for the column.
Name string `json:"name,omitempty"`
// Priority: priority is an integer defining the relative importance of
// this column compared to others. Lower numbers are considered higher
// priority. Columns that may be omitted in limited space scenarios
// should be given a higher priority. +optional
Priority int64 `json:"priority,omitempty"`
// Type: type is an OpenAPI type definition for this column. See
// https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types
// for more.
Type string `json:"type,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CustomResourceColumnDefinition) MarshalJSON() ([]byte, error) {
type NoMethod CustomResourceColumnDefinition
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CustomResourceDefinition: CustomResourceDefinition represents a
// resource that should be exposed on the API server. Its name MUST be
// in the format <.spec.name>.<.spec.group>.
type CustomResourceDefinition struct {
// ApiVersion: The API version for this call such as
// "k8s.apiextensions.io/v1beta1".
ApiVersion string `json:"apiVersion,omitempty"`
// Kind: The kind of resource, in this case always
// "CustomResourceDefinition".
Kind string `json:"kind,omitempty"`
// Metadata: Metadata associated with this CustomResourceDefinition.
Metadata *ObjectMeta `json:"metadata,omitempty"`
// Spec: Spec describes how the user wants the resources to appear
Spec *CustomResourceDefinitionSpec `json:"spec,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "ApiVersion") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ApiVersion") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CustomResourceDefinition) MarshalJSON() ([]byte, error) {
type NoMethod CustomResourceDefinition
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CustomResourceDefinitionNames: CustomResourceDefinitionNames
// indicates the names to serve this CustomResourceDefinition
type CustomResourceDefinitionNames struct {
// Categories: Categories is a list of grouped resources custom
// resources belong to (e.g. 'all') +optional
Categories []string `json:"categories,omitempty"`
// Kind: Kind is the serialized kind of the resource. It is normally
// CamelCase and singular.
Kind string `json:"kind,omitempty"`
// ListKind: ListKind is the serialized kind of the list for this
// resource. Defaults to List. +optional
ListKind string `json:"listKind,omitempty"`
// Plural: Plural is the plural name of the resource to serve. It must
// match the name of the CustomResourceDefinition-registration too:
// plural.group and it must be all lowercase.
Plural string `json:"plural,omitempty"`
// ShortNames: ShortNames are short names for the resource. It must be
// all lowercase. +optional
ShortNames []string `json:"shortNames,omitempty"`
// Singular: Singular is the singular name of the resource. It must be
// all lowercase Defaults to lowercased +optional
Singular string `json:"singular,omitempty"`
// ForceSendFields is a list of field names (e.g. "Categories") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Categories") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CustomResourceDefinitionNames) MarshalJSON() ([]byte, error) {
type NoMethod CustomResourceDefinitionNames
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CustomResourceDefinitionSpec: CustomResourceDefinitionSpec describes
// how a user wants their resource to appear
type CustomResourceDefinitionSpec struct {
// AdditionalPrinterColumns: AdditionalPrinterColumns are additional
// columns shown e.g. in kubectl next to the name. Defaults to a
// created-at column. +optional
AdditionalPrinterColumns []*CustomResourceColumnDefinition `json:"additionalPrinterColumns,omitempty"`
// Group: Group is the group this resource belongs in
Group string `json:"group,omitempty"`
// Names: Names are the names used to describe this custom resource
Names *CustomResourceDefinitionNames `json:"names,omitempty"`
// Scope: Scope indicates whether this resource is cluster or namespace
// scoped. Default is namespaced
Scope string `json:"scope,omitempty"`
// Subresources: Subresources describes the subresources for
// CustomResources +optional
Subresources *CustomResourceSubresources `json:"subresources,omitempty"`
// Validation: Validation describes the validation methods for
// CustomResources +optional
Validation *CustomResourceValidation `json:"validation,omitempty"`
// Version: Version is the version this resource belongs in Should be
// always first item in Versions field if provided. Optional, but at
// least one of Version or Versions must be set. Deprecated: Please use
// `Versions`. +optional
Version string `json:"version,omitempty"`
// Versions: Versions is the list of all supported versions for this
// resource. If Version field is provided, this field is optional.
// Validation: All versions must use the same validation schema for now.
// i.e., top level Validation field is applied to all of these versions.
// Order: The version name will be used to compute the order. If the
// version string is "kube-like", it will sort above non "kube-like"
// version strings, which are ordered lexicographically. "Kube-like"
// versions start with a "v", then are followed by a number (the major
// version), then optionally the string "alpha" or "beta" and another
// number (the minor version). These are sorted first by GA > beta >
// alpha (where GA is a version with no suffix such as beta or alpha),
// and then by comparing major version, then minor version. An example
// sorted list of versions: v10, v2, v1, v11beta2, v10beta3, v3beta1,
// v12alpha1, v11alpha2, foo1, foo10. +optional
Versions []*CustomResourceDefinitionVersion `json:"versions,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "AdditionalPrinterColumns") to unconditionally include in API
// requests. By default, fields with empty values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AdditionalPrinterColumns")
// to include in API requests with the JSON null value. By default,
// fields with empty values are omitted from API requests. However, any
// field with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *CustomResourceDefinitionSpec) MarshalJSON() ([]byte, error) {
type NoMethod CustomResourceDefinitionSpec
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type CustomResourceDefinitionVersion struct {
// Name: Name is the version name, e.g. “v1”, “v2beta1”, etc.
Name string `json:"name,omitempty"`
// Served: Served is a flag enabling/disabling this version from being
// served via REST APIs
Served bool `json:"served,omitempty"`
// Storage: Storage flags the version as storage version. There must be
// exactly one flagged as storage version.
Storage bool `json:"storage,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CustomResourceDefinitionVersion) MarshalJSON() ([]byte, error) {
type NoMethod CustomResourceDefinitionVersion
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CustomResourceSubresourceScale: CustomResourceSubresourceScale
// defines how to serve the scale subresource for CustomResources.
type CustomResourceSubresourceScale struct {
// LabelSelectorPath: LabelSelectorPath defines the JSON path inside of
// a CustomResource that corresponds to Scale.Status.Selector. Only JSON
// paths without the array notation are allowed. Must be a JSON Path
// under .status. Must be set to work with HPA. If there is no value
// under the given path in the CustomResource, the status label selector
// value in the /scale subresource will default to the empty string.
// +optional
LabelSelectorPath string `json:"labelSelectorPath,omitempty"`
// SpecReplicasPath: SpecReplicasPath defines the JSON path inside of a
// CustomResource that corresponds to Scale.Spec.Replicas. Only JSON
// paths without the array notation are allowed. Must be a JSON Path
// under .spec. If there is no value under the given path in the
// CustomResource, the /scale subresource will return an error on GET.
SpecReplicasPath string `json:"specReplicasPath,omitempty"`
// StatusReplicasPath: StatusReplicasPath defines the JSON path inside
// of a CustomResource that corresponds to Scale.Status.Replicas. Only
// JSON paths without the array notation are allowed. Must be a JSON
// Path under .status. If there is no value under the given path in the
// CustomResource, the status replica value in the /scale subresource
// will default to 0.
StatusReplicasPath string `json:"statusReplicasPath,omitempty"`
// ForceSendFields is a list of field names (e.g. "LabelSelectorPath")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "LabelSelectorPath") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *CustomResourceSubresourceScale) MarshalJSON() ([]byte, error) {
type NoMethod CustomResourceSubresourceScale
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CustomResourceSubresourceStatus: CustomResourceSubresourceStatus
// defines how to serve the status subresource for CustomResources.
// Status is represented by the `.status` JSON path inside of a
// CustomResource. When set, * exposes a /status subresource for the
// custom resource * PUT requests to the /status subresource take a
// custom resource object, and ignore changes to anything except the
// status stanza * PUT/POST/PATCH requests to the custom resource ignore
// changes to the status stanza
type CustomResourceSubresourceStatus struct {
}
// CustomResourceSubresources: CustomResourceSubresources defines the
// status and scale subresources for CustomResources.
type CustomResourceSubresources struct {
// Scale: Scale denotes the scale subresource for CustomResources
// +optional
Scale *CustomResourceSubresourceScale `json:"scale,omitempty"`
// Status: Status denotes the status subresource for CustomResources
// +optional
Status *CustomResourceSubresourceStatus `json:"status,omitempty"`
// ForceSendFields is a list of field names (e.g. "Scale") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Scale") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CustomResourceSubresources) MarshalJSON() ([]byte, error) {
type NoMethod CustomResourceSubresources
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CustomResourceValidation: CustomResourceValidation is a list of
// validation methods for CustomResources.
type CustomResourceValidation struct {
// OpenAPIV3Schema: OpenAPIV3Schema is the OpenAPI v3 schema to be
// validated against. +optional
OpenAPIV3Schema *JSONSchemaProps `json:"openAPIV3Schema,omitempty"`
// ForceSendFields is a list of field names (e.g. "OpenAPIV3Schema") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "OpenAPIV3Schema") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *CustomResourceValidation) MarshalJSON() ([]byte, error) {
type NoMethod CustomResourceValidation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ExternalDocumentation: ExternalDocumentation allows referencing an
// external resource for extended documentation.
type ExternalDocumentation struct {
Description string `json:"description,omitempty"`
Url string `json:"url,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ExternalDocumentation) MarshalJSON() ([]byte, error) {
type NoMethod ExternalDocumentation
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// JSON: JSON represents any valid JSON value. These types are
// supported: bool, int64, float64, string, []interface{},
// map[string]interface{} and nil.
type JSON struct {
Raw string `json:"raw,omitempty"`
// ForceSendFields is a list of field names (e.g. "Raw") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Raw") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *JSON) MarshalJSON() ([]byte, error) {
type NoMethod JSON
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// JSONSchemaProps: JSONSchemaProps is a JSON-Schema following
// Specification Draft 4 (http://json-schema.org/).
type JSONSchemaProps struct {
AdditionalItems *JSONSchemaPropsOrBool `json:"additionalItems,omitempty"`
AdditionalProperties *JSONSchemaPropsOrBool `json:"additionalProperties,omitempty"`
AllOf []*JSONSchemaProps `json:"allOf,omitempty"`
AnyOf []*JSONSchemaProps `json:"anyOf,omitempty"`
Default *JSON `json:"default,omitempty"`
Definitions map[string]JSONSchemaProps `json:"definitions,omitempty"`
Dependencies map[string]JSONSchemaPropsOrStringArray `json:"dependencies,omitempty"`
Description string `json:"description,omitempty"`
Enum []string `json:"enum,omitempty"`
Example *JSON `json:"example,omitempty"`
ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"`
ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"`
ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"`
Format string `json:"format,omitempty"`
Id string `json:"id,omitempty"`
Items *JSONSchemaPropsOrArray `json:"items,omitempty"`
MaxItems int64 `json:"maxItems,omitempty,string"`
MaxLength int64 `json:"maxLength,omitempty,string"`
MaxProperties int64 `json:"maxProperties,omitempty,string"`
Maximum float64 `json:"maximum,omitempty"`
MinItems int64 `json:"minItems,omitempty,string"`
MinLength int64 `json:"minLength,omitempty,string"`
MinProperties int64 `json:"minProperties,omitempty,string"`
Minimum float64 `json:"minimum,omitempty"`
MultipleOf float64 `json:"multipleOf,omitempty"`
Not *JSONSchemaProps `json:"not,omitempty"`
OneOf []*JSONSchemaProps `json:"oneOf,omitempty"`
Pattern string `json:"pattern,omitempty"`
PatternProperties map[string]JSONSchemaProps `json:"patternProperties,omitempty"`
Properties map[string]JSONSchemaProps `json:"properties,omitempty"`
Ref string `json:"ref,omitempty"`
Required []string `json:"required,omitempty"`
Schema string `json:"schema,omitempty"`
Title string `json:"title,omitempty"`
Type string `json:"type,omitempty"`
UniqueItems bool `json:"uniqueItems,omitempty"`
// ForceSendFields is a list of field names (e.g. "AdditionalItems") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AdditionalItems") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *JSONSchemaProps) MarshalJSON() ([]byte, error) {
type NoMethod JSONSchemaProps
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *JSONSchemaProps) UnmarshalJSON(data []byte) error {
type NoMethod JSONSchemaProps
var s1 struct {
Maximum gensupport.JSONFloat64 `json:"maximum"`
Minimum gensupport.JSONFloat64 `json:"minimum"`
MultipleOf gensupport.JSONFloat64 `json:"multipleOf"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Maximum = float64(s1.Maximum)
s.Minimum = float64(s1.Minimum)
s.MultipleOf = float64(s1.MultipleOf)
return nil
}
// JSONSchemaPropsOrArray: JSONSchemaPropsOrArray represents a value
// that can either be a JSONSchemaProps or an array of JSONSchemaProps.
// Mainly here for serialization purposes.
type JSONSchemaPropsOrArray struct {
JsonSchemas []*JSONSchemaProps `json:"jsonSchemas,omitempty"`
Schema *JSONSchemaProps `json:"schema,omitempty"`
// ForceSendFields is a list of field names (e.g. "JsonSchemas") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "JsonSchemas") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *JSONSchemaPropsOrArray) MarshalJSON() ([]byte, error) {
type NoMethod JSONSchemaPropsOrArray
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// JSONSchemaPropsOrBool: JSONSchemaPropsOrBool represents
// JSONSchemaProps or a boolean value. Defaults to true for the boolean
// property.
type JSONSchemaPropsOrBool struct {
Allows bool `json:"allows,omitempty"`
Schema *JSONSchemaProps `json:"schema,omitempty"`
// ForceSendFields is a list of field names (e.g. "Allows") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Allows") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *JSONSchemaPropsOrBool) MarshalJSON() ([]byte, error) {
type NoMethod JSONSchemaPropsOrBool
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// JSONSchemaPropsOrStringArray: JSONSchemaPropsOrStringArray represents
// a JSONSchemaProps or a string array.
type JSONSchemaPropsOrStringArray struct {
Property []string `json:"property,omitempty"`
Schema *JSONSchemaProps `json:"schema,omitempty"`
// ForceSendFields is a list of field names (e.g. "Property") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Property") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *JSONSchemaPropsOrStringArray) MarshalJSON() ([]byte, error) {
type NoMethod JSONSchemaPropsOrStringArray
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type ListCustomResourceDefinitionsResponse struct {
// ApiVersion: The API version for this call such as
// "k8s.apiextensions.io/v1beta1".
ApiVersion string `json:"apiVersion,omitempty"`
// Items: List of CustomResourceDefinitions.
Items []*CustomResourceDefinition `json:"items,omitempty"`
// Kind: The kind of this resource, in this case
// "CustomResourceDefinitionList".
Kind string `json:"kind,omitempty"`
// Metadata: Metadata associated with this CustomResourceDefinition
// list.
Metadata *ListMeta `json:"metadata,omitempty"`
// Unreachable: Locations that could not be reached.
Unreachable []string `json:"unreachable,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "ApiVersion") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ApiVersion") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListCustomResourceDefinitionsResponse) MarshalJSON() ([]byte, error) {
type NoMethod ListCustomResourceDefinitionsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ListMeta: ListMeta describes metadata that synthetic resources must
// have, including lists and various status objects. A resource may have
// only one of {ObjectMeta, ListMeta}.
type ListMeta struct {
// Continue: continue may be set if the user set a limit on the number
// of items returned, and indicates that the server has more data
// available. The value is opaque and may be used to issue another
// request to the endpoint that served this list to retrieve the next
// set of available objects. Continuing a list may not be possible if
// the server configuration has changed or more than a few minutes have
// passed. The resourceVersion field returned when using this continue
// value will be identical to the value in the first response.
Continue string `json:"continue,omitempty"`
// ResourceVersion: String that identifies the server's internal version
// of this object that can be used by clients to determine when objects
// have changed. Value must be treated as opaque by clients and passed
// unmodified back to the server. Populated by the system. Read-only.
// More info:
// https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency
// +optional
ResourceVersion string `json:"resourceVersion,omitempty"`
// SelfLink: SelfLink is a URL representing this object. Populated by
// the system. Read-only. +optional
SelfLink string `json:"selfLink,omitempty"`
// ForceSendFields is a list of field names (e.g. "Continue") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Continue") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ListMeta) MarshalJSON() ([]byte, error) {
type NoMethod ListMeta
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ObjectMeta: k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta is
// metadata that all persisted resources must have, which includes all
// objects users must create.
type ObjectMeta struct {
// Annotations: (Optional) Annotations is an unstructured key value map
// stored with a resource that may be set by external tools to store and
// retrieve arbitrary metadata. They are not queryable and should be
// preserved when modifying objects. More info:
// http://kubernetes.io/docs/user-guide/annotations
Annotations map[string]string `json:"annotations,omitempty"`
// ClusterName: (Optional) Cloud Run fully managed: not supported Cloud
// Run for Anthos: supported The name of the cluster which the object
// belongs to. This is used to distinguish resources with same name and
// namespace in different clusters. This field is not set anywhere right
// now and apiserver is going to ignore it if set in create or update
// request.
ClusterName string `json:"clusterName,omitempty"`
// CreationTimestamp: (Optional) CreationTimestamp is a timestamp
// representing the server time when this object was created. It is not
// guaranteed to be set in happens-before order across separate
// operations. Clients may not set this value. It is represented in
// RFC3339 form and is in UTC. Populated by the system. Read-only. Null
// for lists. More info:
// https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
CreationTimestamp string `json:"creationTimestamp,omitempty"`
// DeletionGracePeriodSeconds: (Optional) Cloud Run fully managed: not
// supported Cloud Run for Anthos: supported Number of seconds allowed
// for this object to gracefully terminate before it will be removed
// from the system. Only set when deletionTimestamp is also set. May
// only be shortened. Read-only.
DeletionGracePeriodSeconds int64 `json:"deletionGracePeriodSeconds,omitempty"`
// DeletionTimestamp: (Optional) Cloud Run fully managed: not supported
// Cloud Run for Anthos: supported DeletionTimestamp is RFC 3339 date
// and time at which this resource will be deleted. This field is set by
// the server when a graceful deletion is requested by the user, and is
// not directly settable by a client. The resource is expected to be
// deleted (no longer visible from resource lists, and not reachable by
// name) after the time in this field, once the finalizers list is
// empty. As long as the finalizers list contains items, deletion is
// blocked. Once the deletionTimestamp is set, this value may not be
// unset or be set further into the future, although it may be shortened
// or the resource may be deleted prior to this time. For example, a
// user may request that a pod is deleted in 30 seconds. The Kubelet
// will react by sending a graceful termination signal to the containers
// in the pod. After that 30 seconds, the Kubelet will send a hard
// termination signal (SIGKILL) to the container and after cleanup,
// remove the pod from the API. In the presence of network partitions,
// this object may still exist after this timestamp, until an
// administrator or automated process can determine the resource is
// fully terminated. If not set, graceful deletion of the object has not
// been requested. Populated by the system when a graceful deletion is
// requested. Read-only. More info:
// https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
DeletionTimestamp string `json:"deletionTimestamp,omitempty"`
// Finalizers: (Optional) Cloud Run fully managed: not supported Cloud
// Run for Anthos: supported Must be empty before the object is deleted
// from the registry. Each entry is an identifier for the responsible
// component that will remove the entry from the list. If the
// deletionTimestamp of the object is non-nil, entries in this list can
// only be removed. +patchStrategy=merge
Finalizers []string `json:"finalizers,omitempty"`
// GenerateName: (Optional) Cloud Run fully managed: not supported Cloud
// Run for Anthos: supported GenerateName is an optional prefix, used by
// the server, to generate a unique name ONLY IF the Name field has not
// been provided. If this field is used, the name returned to the client
// will be different than the name passed. This value will also be
// combined with a unique suffix. The provided value has the same
// validation rules as the Name field, and may be truncated by the
// length of the suffix required to make the value unique on the server.
// If this field is specified and the generated name exists, the server
// will NOT return a 409 - instead, it will either return 201 Created or
// 500 with Reason ServerTimeout indicating a unique name could not be
// found in the time allotted, and the client should retry (optionally
// after the time indicated in the Retry-After header). Applied only if
// Name is not specified. More info:
// https://git.k8s.io/community/contributors/devel/api-conventions.md#idempotency
// string generateName = 2;
GenerateName string `json:"generateName,omitempty"`
// Generation: (Optional) A sequence number representing a specific
// generation of the desired state. Populated by the system. Read-only.
Generation int64 `json:"generation,omitempty"`
// Labels: (Optional) Map of string keys and values that can be used to
// organize and categorize (scope and select) objects. May match
// selectors of replication controllers and routes. More info:
// http://kubernetes.io/docs/user-guide/labels
Labels map[string]string `json:"labels,omitempty"`
// Name: Name must be unique within a namespace, within a Cloud Run
// region. Is required when creating resources, although some resources
// may allow a client to request the generation of an appropriate name
// automatically. Name is primarily intended for creation idempotence
// and configuration definition. Cannot be updated. More info:
// http://kubernetes.io/docs/user-guide/identifiers#names +optional
Name string `json:"name,omitempty"`
// Namespace: Namespace defines the space within each name must be
// unique, within a Cloud Run region. In Cloud Run the namespace must be
// equal to either the project ID or project number.
Namespace string `json:"namespace,omitempty"`
// OwnerReferences: (Optional) Cloud Run fully managed: not supported
// Cloud Run for Anthos: supported List of objects that own this object.
// If ALL objects in the list have been deleted, this object will be
// garbage collected.
OwnerReferences []*OwnerReference `json:"ownerReferences,omitempty"`
// ResourceVersion: (Optional) An opaque value that represents the
// internal version of this object that can be used by clients to
// determine when objects have changed. May be used for optimistic
// concurrency, change detection, and the watch operation on a resource
// or set of resources. Clients must treat these values as opaque and
// passed unmodified back to the server. They may only be valid for a
// particular resource or set of resources. Populated by the system.
// Read-only. Value must be treated as opaque by clients. More info:
// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
ResourceVersion string `json:"resourceVersion,omitempty"`
// SelfLink: (Optional) SelfLink is a URL representing this object.
// Populated by the system. Read-only. string selfLink = 4;
SelfLink string `json:"selfLink,omitempty"`
// Uid: (Optional) UID is the unique in time and space value for this
// object. It is typically generated by the server on successful
// creation of a resource and is not allowed to change on PUT
// operations. Populated by the system. Read-only. More info:
// http://kubernetes.io/docs/user-guide/identifiers#uids
Uid string `json:"uid,omitempty"`
// ForceSendFields is a list of field names (e.g. "Annotations") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Annotations") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ObjectMeta) MarshalJSON() ([]byte, error) {
type NoMethod ObjectMeta
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// OwnerReference: OwnerReference contains enough information to let you
// identify an owning object. Currently, an owning object must be in the
// same namespace, so there is no namespace field.
type OwnerReference struct {
// ApiVersion: API version of the referent.
ApiVersion string `json:"apiVersion,omitempty"`
// BlockOwnerDeletion: If true, AND if the owner has the
// "foregroundDeletion" finalizer, then the owner cannot be deleted from
// the key-value store until this reference is removed. Defaults to
// false. To set this field, a user needs "delete" permission of the
// owner, otherwise 422 (Unprocessable Entity) will be returned.
// +optional
BlockOwnerDeletion bool `json:"blockOwnerDeletion,omitempty"`
// Controller: If true, this reference points to the managing
// controller. +optional
Controller bool `json:"controller,omitempty"`
// Kind: Kind of the referent. More info:
// https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
Kind string `json:"kind,omitempty"`
// Name: Name of the referent. More info:
// http://kubernetes.io/docs/user-guide/identifiers#names
Name string `json:"name,omitempty"`
// Uid: UID of the referent. More info:
// http://kubernetes.io/docs/user-guide/identifiers#uids
Uid string `json:"uid,omitempty"`
// ForceSendFields is a list of field names (e.g. "ApiVersion") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ApiVersion") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *OwnerReference) MarshalJSON() ([]byte, error) {
type NoMethod OwnerReference
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// method id "run.customresourcedefinitions.list":
type CustomresourcedefinitionsListCall struct {
s *Service
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Rpc to list custom resource definitions.
func (r *CustomresourcedefinitionsService) List() *CustomresourcedefinitionsListCall {
c := &CustomresourcedefinitionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
return c
}
// Continue sets the optional parameter "continue": Optional encoded
// string to continue paging.
func (c *CustomresourcedefinitionsListCall) Continue(continue_ string) *CustomresourcedefinitionsListCall {
c.urlParams_.Set("continue", continue_)
return c
}
// FieldSelector sets the optional parameter "fieldSelector": Allows to
// filter resources based on a specific value for a field name. Send
// this in a query string format. i.e. 'metadata.name%3Dlorem'. Not
// currently used by Cloud Run.
func (c *CustomresourcedefinitionsListCall) FieldSelector(fieldSelector string) *CustomresourcedefinitionsListCall {
c.urlParams_.Set("fieldSelector", fieldSelector)
return c
}
// IncludeUninitialized sets the optional parameter
// "includeUninitialized": Not currently used by Cloud Run.
func (c *CustomresourcedefinitionsListCall) IncludeUninitialized(includeUninitialized bool) *CustomresourcedefinitionsListCall {
c.urlParams_.Set("includeUninitialized", fmt.Sprint(includeUninitialized))
return c
}
// LabelSelector sets the optional parameter "labelSelector": Allows to
// filter resources based on a label. Supported operations are =, !=,
// exists, in, and notIn.
func (c *CustomresourcedefinitionsListCall) LabelSelector(labelSelector string) *CustomresourcedefinitionsListCall {
c.urlParams_.Set("labelSelector", labelSelector)
return c
}
// Limit sets the optional parameter "limit":
func (c *CustomresourcedefinitionsListCall) Limit(limit int64) *CustomresourcedefinitionsListCall {
c.urlParams_.Set("limit", fmt.Sprint(limit))
return c
}
// Parent sets the optional parameter "parent": The project ID or
// project number from which the storages should be listed.
func (c *CustomresourcedefinitionsListCall) Parent(parent string) *CustomresourcedefinitionsListCall {
c.urlParams_.Set("parent", parent)
return c
}
// ResourceVersion sets the optional parameter "resourceVersion": The
// baseline resource version from which the list or watch operation
// should start. Not currently used by Cloud Run.
func (c *CustomresourcedefinitionsListCall) ResourceVersion(resourceVersion string) *CustomresourcedefinitionsListCall {
c.urlParams_.Set("resourceVersion", resourceVersion)
return c
}
// Watch sets the optional parameter "watch": Flag that indicates that
// the client expects to watch this resource as well. Not currently used
// by Cloud Run.
func (c *CustomresourcedefinitionsListCall) Watch(watch bool) *CustomresourcedefinitionsListCall {
c.urlParams_.Set("watch", fmt.Sprint(watch))
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *CustomresourcedefinitionsListCall) Fields(s ...googleapi.Field) *CustomresourcedefinitionsListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *CustomresourcedefinitionsListCall) IfNoneMatch(entityTag string) *CustomresourcedefinitionsListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *CustomresourcedefinitionsListCall) Context(ctx context.Context) *CustomresourcedefinitionsListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *CustomresourcedefinitionsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *CustomresourcedefinitionsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210331")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "run.customresourcedefinitions.list" call.
// Exactly one of *ListCustomResourceDefinitionsResponse or error will
// be non-nil. Any non-2xx status code is an error. Response headers are
// in either
// *ListCustomResourceDefinitionsResponse.ServerResponse.Header or (if a
// response was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *CustomresourcedefinitionsListCall) Do(opts ...googleapi.CallOption) (*ListCustomResourceDefinitionsResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ListCustomResourceDefinitionsResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Rpc to list custom resource definitions.",
// "flatPath": "apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions",
// "httpMethod": "GET",
// "id": "run.customresourcedefinitions.list",
// "parameterOrder": [],
// "parameters": {
// "continue": {
// "description": "Optional encoded string to continue paging.",
// "location": "query",
// "type": "string"
// },
// "fieldSelector": {
// "description": "Allows to filter resources based on a specific value for a field name. Send this in a query string format. i.e. 'metadata.name%3Dlorem'. Not currently used by Cloud Run.",
// "location": "query",
// "type": "string"
// },
// "includeUninitialized": {
// "description": "Not currently used by Cloud Run.",
// "location": "query",
// "type": "boolean"
// },
// "labelSelector": {
// "description": "Allows to filter resources based on a label. Supported operations are =, !=, exists, in, and notIn.",
// "location": "query",
// "type": "string"
// },
// "limit": {
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "parent": {
// "description": "The project ID or project number from which the storages should be listed.",
// "location": "query",
// "type": "string"
// },
// "resourceVersion": {
// "description": "The baseline resource version from which the list or watch operation should start. Not currently used by Cloud Run.",
// "location": "query",
// "type": "string"
// },
// "watch": {
// "description": "Flag that indicates that the client expects to watch this resource as well. Not currently used by Cloud Run.",
// "location": "query",
// "type": "boolean"
// }
// },
// "path": "apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions",
// "response": {
// "$ref": "ListCustomResourceDefinitionsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "run.namespaces.customresourcedefinitions.get":
type NamespacesCustomresourcedefinitionsGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Rpc to get information about a CustomResourceDefinition.
//
// - name: The name of the CustomResourceDefinition being retrieved. If
// needed, replace {namespace_id} with the project ID.
func (r *NamespacesCustomresourcedefinitionsService) Get(name string) *NamespacesCustomresourcedefinitionsGetCall {
c := &NamespacesCustomresourcedefinitionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *NamespacesCustomresourcedefinitionsGetCall) Fields(s ...googleapi.Field) *NamespacesCustomresourcedefinitionsGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *NamespacesCustomresourcedefinitionsGetCall) IfNoneMatch(entityTag string) *NamespacesCustomresourcedefinitionsGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *NamespacesCustomresourcedefinitionsGetCall) Context(ctx context.Context) *NamespacesCustomresourcedefinitionsGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *NamespacesCustomresourcedefinitionsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *NamespacesCustomresourcedefinitionsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210331")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "apis/apiextensions.k8s.io/v1beta1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "run.namespaces.customresourcedefinitions.get" call.
// Exactly one of *CustomResourceDefinition or error will be non-nil.
// Any non-2xx status code is an error. Response headers are in either
// *CustomResourceDefinition.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *NamespacesCustomresourcedefinitionsGetCall) Do(opts ...googleapi.CallOption) (*CustomResourceDefinition, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &CustomResourceDefinition{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Rpc to get information about a CustomResourceDefinition.",
// "flatPath": "apis/apiextensions.k8s.io/v1beta1/namespaces/{namespacesId}/customresourcedefinitions/{customresourcedefinitionsId}",
// "httpMethod": "GET",
// "id": "run.namespaces.customresourcedefinitions.get",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "The name of the CustomResourceDefinition being retrieved. If needed, replace {namespace_id} with the project ID.",
// "location": "path",
// "pattern": "^namespaces/[^/]+/customresourcedefinitions/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "apis/apiextensions.k8s.io/v1beta1/{+name}",
// "response": {
// "$ref": "CustomResourceDefinition"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "run.projects.locations.customresourcedefinitions.get":
type ProjectsLocationsCustomresourcedefinitionsGetCall struct {
s *Service
name string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// Get: Rpc to get information about a CustomResourceDefinition.
//
// - name: The name of the CustomResourceDefinition being retrieved. If
// needed, replace {namespace_id} with the project ID.
func (r *ProjectsLocationsCustomresourcedefinitionsService) Get(name string) *ProjectsLocationsCustomresourcedefinitionsGetCall {
c := &ProjectsLocationsCustomresourcedefinitionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.name = name
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsLocationsCustomresourcedefinitionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsCustomresourcedefinitionsGetCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ProjectsLocationsCustomresourcedefinitionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsCustomresourcedefinitionsGetCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ProjectsLocationsCustomresourcedefinitionsGetCall) Context(ctx context.Context) *ProjectsLocationsCustomresourcedefinitionsGetCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsLocationsCustomresourcedefinitionsGetCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsLocationsCustomresourcedefinitionsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210331")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"name": c.name,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "run.projects.locations.customresourcedefinitions.get" call.
// Exactly one of *CustomResourceDefinition or error will be non-nil.
// Any non-2xx status code is an error. Response headers are in either
// *CustomResourceDefinition.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *ProjectsLocationsCustomresourcedefinitionsGetCall) Do(opts ...googleapi.CallOption) (*CustomResourceDefinition, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &CustomResourceDefinition{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Rpc to get information about a CustomResourceDefinition.",
// "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/customresourcedefinitions/{customresourcedefinitionsId}",
// "httpMethod": "GET",
// "id": "run.projects.locations.customresourcedefinitions.get",
// "parameterOrder": [
// "name"
// ],
// "parameters": {
// "name": {
// "description": "The name of the CustomResourceDefinition being retrieved. If needed, replace {namespace_id} with the project ID.",
// "location": "path",
// "pattern": "^projects/[^/]+/locations/[^/]+/customresourcedefinitions/[^/]+$",
// "required": true,
// "type": "string"
// }
// },
// "path": "v1beta1/{+name}",
// "response": {
// "$ref": "CustomResourceDefinition"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
// method id "run.projects.locations.customresourcedefinitions.list":
type ProjectsLocationsCustomresourcedefinitionsListCall struct {
s *Service
parent string
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
header_ http.Header
}
// List: Rpc to list custom resource definitions.
//
// - parent: The project ID or project number from which the storages
// should be listed.
func (r *ProjectsLocationsCustomresourcedefinitionsService) List(parent string) *ProjectsLocationsCustomresourcedefinitionsListCall {
c := &ProjectsLocationsCustomresourcedefinitionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.parent = parent
return c
}
// Continue sets the optional parameter "continue": Optional encoded
// string to continue paging.
func (c *ProjectsLocationsCustomresourcedefinitionsListCall) Continue(continue_ string) *ProjectsLocationsCustomresourcedefinitionsListCall {
c.urlParams_.Set("continue", continue_)
return c
}
// FieldSelector sets the optional parameter "fieldSelector": Allows to
// filter resources based on a specific value for a field name. Send
// this in a query string format. i.e. 'metadata.name%3Dlorem'. Not
// currently used by Cloud Run.
func (c *ProjectsLocationsCustomresourcedefinitionsListCall) FieldSelector(fieldSelector string) *ProjectsLocationsCustomresourcedefinitionsListCall {
c.urlParams_.Set("fieldSelector", fieldSelector)
return c
}
// IncludeUninitialized sets the optional parameter
// "includeUninitialized": Not currently used by Cloud Run.
func (c *ProjectsLocationsCustomresourcedefinitionsListCall) IncludeUninitialized(includeUninitialized bool) *ProjectsLocationsCustomresourcedefinitionsListCall {
c.urlParams_.Set("includeUninitialized", fmt.Sprint(includeUninitialized))
return c
}
// LabelSelector sets the optional parameter "labelSelector": Allows to
// filter resources based on a label. Supported operations are =, !=,
// exists, in, and notIn.
func (c *ProjectsLocationsCustomresourcedefinitionsListCall) LabelSelector(labelSelector string) *ProjectsLocationsCustomresourcedefinitionsListCall {
c.urlParams_.Set("labelSelector", labelSelector)
return c
}
// Limit sets the optional parameter "limit":
func (c *ProjectsLocationsCustomresourcedefinitionsListCall) Limit(limit int64) *ProjectsLocationsCustomresourcedefinitionsListCall {
c.urlParams_.Set("limit", fmt.Sprint(limit))
return c
}
// ResourceVersion sets the optional parameter "resourceVersion": The
// baseline resource version from which the list or watch operation
// should start. Not currently used by Cloud Run.
func (c *ProjectsLocationsCustomresourcedefinitionsListCall) ResourceVersion(resourceVersion string) *ProjectsLocationsCustomresourcedefinitionsListCall {
c.urlParams_.Set("resourceVersion", resourceVersion)
return c
}
// Watch sets the optional parameter "watch": Flag that indicates that
// the client expects to watch this resource as well. Not currently used
// by Cloud Run.
func (c *ProjectsLocationsCustomresourcedefinitionsListCall) Watch(watch bool) *ProjectsLocationsCustomresourcedefinitionsListCall {
c.urlParams_.Set("watch", fmt.Sprint(watch))
return c
}
// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ProjectsLocationsCustomresourcedefinitionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsCustomresourcedefinitionsListCall {
c.urlParams_.Set("fields", googleapi.CombineFields(s))
return c
}
// IfNoneMatch sets the optional parameter which makes the operation
// fail if the object's ETag matches the given value. This is useful for
// getting updates only after the object has changed since the last
// request. Use googleapi.IsNotModified to check whether the response
// error from Do is the result of In-None-Match.
func (c *ProjectsLocationsCustomresourcedefinitionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsCustomresourcedefinitionsListCall {
c.ifNoneMatch_ = entityTag
return c
}
// Context sets the context to be used in this call's Do method. Any
// pending HTTP request will be aborted if the provided context is
// canceled.
func (c *ProjectsLocationsCustomresourcedefinitionsListCall) Context(ctx context.Context) *ProjectsLocationsCustomresourcedefinitionsListCall {
c.ctx_ = ctx
return c
}
// Header returns an http.Header that can be modified by the caller to
// add HTTP headers to the request.
func (c *ProjectsLocationsCustomresourcedefinitionsListCall) Header() http.Header {
if c.header_ == nil {
c.header_ = make(http.Header)
}
return c.header_
}
func (c *ProjectsLocationsCustomresourcedefinitionsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210331")
for k, v := range c.header_ {
reqHeaders[k] = v
}
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
}
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
c.urlParams_.Set("prettyPrint", "false")
urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/customresourcedefinitions")
urls += "?" + c.urlParams_.Encode()
req, err := http.NewRequest("GET", urls, body)
if err != nil {
return nil, err
}
req.Header = reqHeaders
googleapi.Expand(req.URL, map[string]string{
"parent": c.parent,
})
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
// Do executes the "run.projects.locations.customresourcedefinitions.list" call.
// Exactly one of *ListCustomResourceDefinitionsResponse or error will
// be non-nil. Any non-2xx status code is an error. Response headers are
// in either
// *ListCustomResourceDefinitionsResponse.ServerResponse.Header or (if a
// response was returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was
// because http.StatusNotModified was returned.
func (c *ProjectsLocationsCustomresourcedefinitionsListCall) Do(opts ...googleapi.CallOption) (*ListCustomResourceDefinitionsResponse, error) {
gensupport.SetOptions(c.urlParams_, opts...)
res, err := c.doRequest("json")
if res != nil && res.StatusCode == http.StatusNotModified {
if res.Body != nil {
res.Body.Close()
}
return nil, &googleapi.Error{
Code: res.StatusCode,
Header: res.Header,
}
}
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
ret := &ListCustomResourceDefinitionsResponse{
ServerResponse: googleapi.ServerResponse{
Header: res.Header,
HTTPStatusCode: res.StatusCode,
},
}
target := &ret
if err := gensupport.DecodeResponse(target, res); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Rpc to list custom resource definitions.",
// "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/customresourcedefinitions",
// "httpMethod": "GET",
// "id": "run.projects.locations.customresourcedefinitions.list",
// "parameterOrder": [
// "parent"
// ],
// "parameters": {
// "continue": {
// "description": "Optional encoded string to continue paging.",
// "location": "query",
// "type": "string"
// },
// "fieldSelector": {
// "description": "Allows to filter resources based on a specific value for a field name. Send this in a query string format. i.e. 'metadata.name%3Dlorem'. Not currently used by Cloud Run.",
// "location": "query",
// "type": "string"
// },
// "includeUninitialized": {
// "description": "Not currently used by Cloud Run.",
// "location": "query",
// "type": "boolean"
// },
// "labelSelector": {
// "description": "Allows to filter resources based on a label. Supported operations are =, !=, exists, in, and notIn.",
// "location": "query",
// "type": "string"
// },
// "limit": {
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "parent": {
// "description": "The project ID or project number from which the storages should be listed.",
// "location": "path",
// "pattern": "^projects/[^/]+/locations/[^/]+$",
// "required": true,
// "type": "string"
// },
// "resourceVersion": {
// "description": "The baseline resource version from which the list or watch operation should start. Not currently used by Cloud Run.",
// "location": "query",
// "type": "string"
// },
// "watch": {
// "description": "Flag that indicates that the client expects to watch this resource as well. Not currently used by Cloud Run.",
// "location": "query",
// "type": "boolean"
// }
// },
// "path": "v1beta1/{+parent}/customresourcedefinitions",
// "response": {
// "$ref": "ListCustomResourceDefinitionsResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform"
// ]
// }
}
|