您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

6058 行
207 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package cloudprivatecatalogproducer provides access to the Cloud Private Catalog Producer API.
  6. //
  7. // For product documentation, see: https://sites.google.com/corp/google.com/cloudprivatecatalog
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/cloudprivatecatalogproducer/v1beta1"
  14. // ...
  15. // ctx := context.Background()
  16. // cloudprivatecatalogproducerService, err := cloudprivatecatalogproducer.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // cloudprivatecatalogproducerService, err := cloudprivatecatalogproducer.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // cloudprivatecatalogproducerService, err := cloudprivatecatalogproducer.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package cloudprivatecatalogproducer // import "google.golang.org/api/cloudprivatecatalogproducer/v1beta1"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "cloudprivatecatalogproducer:v1beta1"
  67. const apiName = "cloudprivatecatalogproducer"
  68. const apiVersion = "v1beta1"
  69. const basePath = "https://cloudprivatecatalogproducer.googleapis.com/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // View and manage your data across Google Cloud Platform services
  73. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  74. )
  75. // NewService creates a new Service.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/cloud-platform",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new Service. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*Service, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &Service{client: client, BasePath: basePath}
  105. s.Catalogs = NewCatalogsService(s)
  106. s.Operations = NewOperationsService(s)
  107. return s, nil
  108. }
  109. type Service struct {
  110. client *http.Client
  111. BasePath string // API endpoint base URL
  112. UserAgent string // optional additional User-Agent fragment
  113. Catalogs *CatalogsService
  114. Operations *OperationsService
  115. }
  116. func (s *Service) userAgent() string {
  117. if s.UserAgent == "" {
  118. return googleapi.UserAgent
  119. }
  120. return googleapi.UserAgent + " " + s.UserAgent
  121. }
  122. func NewCatalogsService(s *Service) *CatalogsService {
  123. rs := &CatalogsService{s: s}
  124. rs.Associations = NewCatalogsAssociationsService(s)
  125. rs.Products = NewCatalogsProductsService(s)
  126. return rs
  127. }
  128. type CatalogsService struct {
  129. s *Service
  130. Associations *CatalogsAssociationsService
  131. Products *CatalogsProductsService
  132. }
  133. func NewCatalogsAssociationsService(s *Service) *CatalogsAssociationsService {
  134. rs := &CatalogsAssociationsService{s: s}
  135. return rs
  136. }
  137. type CatalogsAssociationsService struct {
  138. s *Service
  139. }
  140. func NewCatalogsProductsService(s *Service) *CatalogsProductsService {
  141. rs := &CatalogsProductsService{s: s}
  142. rs.Icons = NewCatalogsProductsIconsService(s)
  143. rs.Versions = NewCatalogsProductsVersionsService(s)
  144. return rs
  145. }
  146. type CatalogsProductsService struct {
  147. s *Service
  148. Icons *CatalogsProductsIconsService
  149. Versions *CatalogsProductsVersionsService
  150. }
  151. func NewCatalogsProductsIconsService(s *Service) *CatalogsProductsIconsService {
  152. rs := &CatalogsProductsIconsService{s: s}
  153. return rs
  154. }
  155. type CatalogsProductsIconsService struct {
  156. s *Service
  157. }
  158. func NewCatalogsProductsVersionsService(s *Service) *CatalogsProductsVersionsService {
  159. rs := &CatalogsProductsVersionsService{s: s}
  160. return rs
  161. }
  162. type CatalogsProductsVersionsService struct {
  163. s *Service
  164. }
  165. func NewOperationsService(s *Service) *OperationsService {
  166. rs := &OperationsService{s: s}
  167. return rs
  168. }
  169. type OperationsService struct {
  170. s *Service
  171. }
  172. // GoogleCloudPrivatecatalogproducerV1beta1Association: An association
  173. // tuple that pairs a `Catalog` to a resource
  174. // that can use the `Catalog`. After association,
  175. // a
  176. // google.cloud.privatecatalog.v1beta1.Catalog becomes available
  177. // to
  178. // consumers under specified Association.resource and all of its
  179. // child
  180. // nodes.
  181. // Users who have the `cloudprivatecatalog.targets.get` permission on
  182. // any of
  183. // the resource nodes can access the catalog and child products under
  184. // the node.
  185. //
  186. // For example, suppose the cloud resource hierarchy is as follows:
  187. //
  188. // * organizations/example.com
  189. // * folders/team
  190. // * projects/test
  191. //
  192. // After creating an association with `organizations/example.com`, the
  193. // catalog
  194. // `catalogs/1` is accessible from the following paths:
  195. //
  196. // * organizations/example.com
  197. // * folders/team
  198. // * projects/test
  199. //
  200. // Users can access them
  201. // by
  202. // google.cloud.v1beta1.PrivateCatalog.SearchCatalogs action.
  203. type GoogleCloudPrivatecatalogproducerV1beta1Association struct {
  204. // CreateTime: The creation time of the association.
  205. CreateTime string `json:"createTime,omitempty"`
  206. // Name: Output only. The resource name of the catalog association, in
  207. // the format
  208. // `catalogs/{catalog_id}/associations/{association_id}'.
  209. //
  210. // A unique identifier for the catalog association, which is
  211. // generated by catalog service.
  212. Name string `json:"name,omitempty"`
  213. // Resource: Required. The user-supplied fully qualified name of the
  214. // `Resource`
  215. // associated to the `Catalog`. It supports `Organization`,
  216. // `Folder`,
  217. // and `Project`. Values are of the form
  218. //
  219. // * `//cloudresourcemanager.googleapis.com/projects/{product_number}`
  220. // * `//cloudresourcemanager.googleapis.com/folders/{folder_id}`
  221. // *
  222. // `//cloudresourcemanager.googleapis.com/organizations/{organization_id}
  223. // `
  224. Resource string `json:"resource,omitempty"`
  225. // ServerResponse contains the HTTP response code and headers from the
  226. // server.
  227. googleapi.ServerResponse `json:"-"`
  228. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  229. // unconditionally include in API requests. By default, fields with
  230. // empty values are omitted from API requests. However, any non-pointer,
  231. // non-interface field appearing in ForceSendFields will be sent to the
  232. // server regardless of whether the field is empty or not. This may be
  233. // used to include empty fields in Patch requests.
  234. ForceSendFields []string `json:"-"`
  235. // NullFields is a list of field names (e.g. "CreateTime") to include in
  236. // API requests with the JSON null value. By default, fields with empty
  237. // values are omitted from API requests. However, any field with an
  238. // empty value appearing in NullFields will be sent to the server as
  239. // null. It is an error if a field in this list has a non-empty value.
  240. // This may be used to include null fields in Patch requests.
  241. NullFields []string `json:"-"`
  242. }
  243. func (s *GoogleCloudPrivatecatalogproducerV1beta1Association) MarshalJSON() ([]byte, error) {
  244. type NoMethod GoogleCloudPrivatecatalogproducerV1beta1Association
  245. raw := NoMethod(*s)
  246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  247. }
  248. // GoogleCloudPrivatecatalogproducerV1beta1Catalog: The producer
  249. // representation of a catalog which is a curated collection
  250. // of
  251. // solutions that can be managed, controlled, and shared by cloud
  252. // admins.
  253. type GoogleCloudPrivatecatalogproducerV1beta1Catalog struct {
  254. // CreateTime: Output only. The time when the catalog was created.
  255. CreateTime string `json:"createTime,omitempty"`
  256. // Description: Required. The user-supplied description of the catalog.
  257. // Maximum of 512
  258. // characters.
  259. Description string `json:"description,omitempty"`
  260. // DisplayName: Required. The user-supplied descriptive name of the
  261. // catalog as it appears
  262. // in UIs. Maximum 256 characters in length.
  263. DisplayName string `json:"displayName,omitempty"`
  264. // Name: Output only. The resource name of the catalog, in the
  265. // format
  266. // `catalogs/{catalog_id}'.
  267. //
  268. // A unique identifier for the catalog, which is generated
  269. // by catalog service.
  270. Name string `json:"name,omitempty"`
  271. // Parent: Required. The parent resource name of the catalog, which
  272. // can't be changed
  273. // after a catalog is created. It can only be an organization. Values
  274. // are of
  275. // the form
  276. // `//cloudresourcemanager.googleapis.com/organizations/<id>`.
  277. // Maximum 256 characters in length.
  278. Parent string `json:"parent,omitempty"`
  279. // UpdateTime: Output only. The time when the catalog was last updated.
  280. UpdateTime string `json:"updateTime,omitempty"`
  281. // ServerResponse contains the HTTP response code and headers from the
  282. // server.
  283. googleapi.ServerResponse `json:"-"`
  284. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  285. // unconditionally include in API requests. By default, fields with
  286. // empty values are omitted from API requests. However, any non-pointer,
  287. // non-interface field appearing in ForceSendFields will be sent to the
  288. // server regardless of whether the field is empty or not. This may be
  289. // used to include empty fields in Patch requests.
  290. ForceSendFields []string `json:"-"`
  291. // NullFields is a list of field names (e.g. "CreateTime") to include in
  292. // API requests with the JSON null value. By default, fields with empty
  293. // values are omitted from API requests. However, any field with an
  294. // empty value appearing in NullFields will be sent to the server as
  295. // null. It is an error if a field in this list has a non-empty value.
  296. // This may be used to include null fields in Patch requests.
  297. NullFields []string `json:"-"`
  298. }
  299. func (s *GoogleCloudPrivatecatalogproducerV1beta1Catalog) MarshalJSON() ([]byte, error) {
  300. type NoMethod GoogleCloudPrivatecatalogproducerV1beta1Catalog
  301. raw := NoMethod(*s)
  302. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  303. }
  304. type GoogleCloudPrivatecatalogproducerV1beta1CopyProductRequest struct {
  305. // DestinationProductName: The resource name of the destination product
  306. // that is copied to.
  307. DestinationProductName string `json:"destinationProductName,omitempty"`
  308. // ForceSendFields is a list of field names (e.g.
  309. // "DestinationProductName") to unconditionally include in API requests.
  310. // By default, fields with empty values are omitted from API requests.
  311. // However, any non-pointer, non-interface field appearing in
  312. // ForceSendFields will be sent to the server regardless of whether the
  313. // field is empty or not. This may be used to include empty fields in
  314. // Patch requests.
  315. ForceSendFields []string `json:"-"`
  316. // NullFields is a list of field names (e.g. "DestinationProductName")
  317. // to include in API requests with the JSON null value. By default,
  318. // fields with empty values are omitted from API requests. However, any
  319. // field with an empty value appearing in NullFields will be sent to the
  320. // server as null. It is an error if a field in this list has a
  321. // non-empty value. This may be used to include null fields in Patch
  322. // requests.
  323. NullFields []string `json:"-"`
  324. }
  325. func (s *GoogleCloudPrivatecatalogproducerV1beta1CopyProductRequest) MarshalJSON() ([]byte, error) {
  326. type NoMethod GoogleCloudPrivatecatalogproducerV1beta1CopyProductRequest
  327. raw := NoMethod(*s)
  328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  329. }
  330. type GoogleCloudPrivatecatalogproducerV1beta1CreateAssociationRequest struct {
  331. // Association: The user-supplied `Association` that is going to be
  332. // created.
  333. //
  334. // If the `resource` field is set,
  335. // the
  336. // `privatecatalogproducer.catalogTargets.associate` permission is
  337. // checked on
  338. // the target resource.
  339. Association *GoogleCloudPrivatecatalogproducerV1beta1Association `json:"association,omitempty"`
  340. // ForceSendFields is a list of field names (e.g. "Association") to
  341. // unconditionally include in API requests. By default, fields with
  342. // empty values are omitted from API requests. However, any non-pointer,
  343. // non-interface field appearing in ForceSendFields will be sent to the
  344. // server regardless of whether the field is empty or not. This may be
  345. // used to include empty fields in Patch requests.
  346. ForceSendFields []string `json:"-"`
  347. // NullFields is a list of field names (e.g. "Association") to include
  348. // in API requests with the JSON null value. By default, fields with
  349. // empty values are omitted from API requests. However, any field with
  350. // an empty value appearing in NullFields will be sent to the server as
  351. // null. It is an error if a field in this list has a non-empty value.
  352. // This may be used to include null fields in Patch requests.
  353. NullFields []string `json:"-"`
  354. }
  355. func (s *GoogleCloudPrivatecatalogproducerV1beta1CreateAssociationRequest) MarshalJSON() ([]byte, error) {
  356. type NoMethod GoogleCloudPrivatecatalogproducerV1beta1CreateAssociationRequest
  357. raw := NoMethod(*s)
  358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  359. }
  360. type GoogleCloudPrivatecatalogproducerV1beta1ListAssociationsResponse struct {
  361. // Associations: The returned `Association` resources from the list
  362. // call.
  363. Associations []*GoogleCloudPrivatecatalogproducerV1beta1Association `json:"associations,omitempty"`
  364. // NextPageToken: A pagination token returned from a previous call
  365. // to
  366. // `ListAssociations` that indicates where the listing should continue
  367. // from.
  368. // This field is optional.
  369. NextPageToken string `json:"nextPageToken,omitempty"`
  370. // ServerResponse contains the HTTP response code and headers from the
  371. // server.
  372. googleapi.ServerResponse `json:"-"`
  373. // ForceSendFields is a list of field names (e.g. "Associations") to
  374. // unconditionally include in API requests. By default, fields with
  375. // empty values are omitted from API requests. However, any non-pointer,
  376. // non-interface field appearing in ForceSendFields will be sent to the
  377. // server regardless of whether the field is empty or not. This may be
  378. // used to include empty fields in Patch requests.
  379. ForceSendFields []string `json:"-"`
  380. // NullFields is a list of field names (e.g. "Associations") to include
  381. // in API requests with the JSON null value. By default, fields with
  382. // empty values are omitted from API requests. However, any field with
  383. // an empty value appearing in NullFields will be sent to the server as
  384. // null. It is an error if a field in this list has a non-empty value.
  385. // This may be used to include null fields in Patch requests.
  386. NullFields []string `json:"-"`
  387. }
  388. func (s *GoogleCloudPrivatecatalogproducerV1beta1ListAssociationsResponse) MarshalJSON() ([]byte, error) {
  389. type NoMethod GoogleCloudPrivatecatalogproducerV1beta1ListAssociationsResponse
  390. raw := NoMethod(*s)
  391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  392. }
  393. type GoogleCloudPrivatecatalogproducerV1beta1ListCatalogsResponse struct {
  394. // Catalogs: The `Catalogs` returned from the list call.
  395. Catalogs []*GoogleCloudPrivatecatalogproducerV1beta1Catalog `json:"catalogs,omitempty"`
  396. // NextPageToken: A pagination token returned from a previous call to
  397. // ListCatalogs
  398. // that indicates where the listing should continue from.
  399. // This field is optional.
  400. NextPageToken string `json:"nextPageToken,omitempty"`
  401. // ServerResponse contains the HTTP response code and headers from the
  402. // server.
  403. googleapi.ServerResponse `json:"-"`
  404. // ForceSendFields is a list of field names (e.g. "Catalogs") to
  405. // unconditionally include in API requests. By default, fields with
  406. // empty values are omitted from API requests. However, any non-pointer,
  407. // non-interface field appearing in ForceSendFields will be sent to the
  408. // server regardless of whether the field is empty or not. This may be
  409. // used to include empty fields in Patch requests.
  410. ForceSendFields []string `json:"-"`
  411. // NullFields is a list of field names (e.g. "Catalogs") to include in
  412. // API requests with the JSON null value. By default, fields with empty
  413. // values are omitted from API requests. However, any field with an
  414. // empty value appearing in NullFields will be sent to the server as
  415. // null. It is an error if a field in this list has a non-empty value.
  416. // This may be used to include null fields in Patch requests.
  417. NullFields []string `json:"-"`
  418. }
  419. func (s *GoogleCloudPrivatecatalogproducerV1beta1ListCatalogsResponse) MarshalJSON() ([]byte, error) {
  420. type NoMethod GoogleCloudPrivatecatalogproducerV1beta1ListCatalogsResponse
  421. raw := NoMethod(*s)
  422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  423. }
  424. type GoogleCloudPrivatecatalogproducerV1beta1ListProductsResponse struct {
  425. // NextPageToken: A pagination token returned from a previous call to
  426. // ListProducts
  427. // that indicates where the listing should continue from.
  428. // This field is optional.
  429. NextPageToken string `json:"nextPageToken,omitempty"`
  430. // Products: The `Product` returned from the list call.
  431. Products []*GoogleCloudPrivatecatalogproducerV1beta1Product `json:"products,omitempty"`
  432. // ServerResponse contains the HTTP response code and headers from the
  433. // server.
  434. googleapi.ServerResponse `json:"-"`
  435. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  436. // unconditionally include in API requests. By default, fields with
  437. // empty values are omitted from API requests. However, any non-pointer,
  438. // non-interface field appearing in ForceSendFields will be sent to the
  439. // server regardless of whether the field is empty or not. This may be
  440. // used to include empty fields in Patch requests.
  441. ForceSendFields []string `json:"-"`
  442. // NullFields is a list of field names (e.g. "NextPageToken") to include
  443. // in API requests with the JSON null value. By default, fields with
  444. // empty values are omitted from API requests. However, any field with
  445. // an empty value appearing in NullFields will be sent to the server as
  446. // null. It is an error if a field in this list has a non-empty value.
  447. // This may be used to include null fields in Patch requests.
  448. NullFields []string `json:"-"`
  449. }
  450. func (s *GoogleCloudPrivatecatalogproducerV1beta1ListProductsResponse) MarshalJSON() ([]byte, error) {
  451. type NoMethod GoogleCloudPrivatecatalogproducerV1beta1ListProductsResponse
  452. raw := NoMethod(*s)
  453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  454. }
  455. type GoogleCloudPrivatecatalogproducerV1beta1ListVersionsResponse struct {
  456. // NextPageToken: A pagination token returned from a previous call to
  457. // ListProducts
  458. // that indicates where the listing should continue from.
  459. // This field is optional.
  460. NextPageToken string `json:"nextPageToken,omitempty"`
  461. // Versions: The `VersiVersionon` returned from the list call.
  462. Versions []*GoogleCloudPrivatecatalogproducerV1beta1Version `json:"versions,omitempty"`
  463. // ServerResponse contains the HTTP response code and headers from the
  464. // server.
  465. googleapi.ServerResponse `json:"-"`
  466. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  467. // unconditionally include in API requests. By default, fields with
  468. // empty values are omitted from API requests. However, any non-pointer,
  469. // non-interface field appearing in ForceSendFields will be sent to the
  470. // server regardless of whether the field is empty or not. This may be
  471. // used to include empty fields in Patch requests.
  472. ForceSendFields []string `json:"-"`
  473. // NullFields is a list of field names (e.g. "NextPageToken") to include
  474. // in API requests with the JSON null value. By default, fields with
  475. // empty values are omitted from API requests. However, any field with
  476. // an empty value appearing in NullFields will be sent to the server as
  477. // null. It is an error if a field in this list has a non-empty value.
  478. // This may be used to include null fields in Patch requests.
  479. NullFields []string `json:"-"`
  480. }
  481. func (s *GoogleCloudPrivatecatalogproducerV1beta1ListVersionsResponse) MarshalJSON() ([]byte, error) {
  482. type NoMethod GoogleCloudPrivatecatalogproducerV1beta1ListVersionsResponse
  483. raw := NoMethod(*s)
  484. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  485. }
  486. // GoogleCloudPrivatecatalogproducerV1beta1Product: The producer
  487. // representation of a product which is a child resource of
  488. // `Catalog` with display metadata and a list of `Version` resources.
  489. type GoogleCloudPrivatecatalogproducerV1beta1Product struct {
  490. // AssetType: Required. The type of the product asset, which cannot be
  491. // changed after the
  492. // product is created. It supports the
  493. // values
  494. // `google.deploymentmanager.Template`
  495. // and
  496. // `google.cloudprivatecatalog.ListingOnly`. Other values will
  497. // be
  498. // rejected by the server. Read only after creation.
  499. //
  500. // The following fields or resource types have different validation
  501. // rules
  502. // under each `asset_type` values:
  503. //
  504. // * Product.display_metadata has different validation schema for
  505. // each
  506. // asset type value. See its comment for details.
  507. // * Version resource isn't allowed to be added under
  508. // the
  509. // `google.cloudprivatecatalog.ListingOnly` type.
  510. AssetType string `json:"assetType,omitempty"`
  511. // CreateTime: Output only. The time when the product was created.
  512. CreateTime string `json:"createTime,omitempty"`
  513. // DisplayMetadata: The user-supplied display metadata to describe the
  514. // product.
  515. // The JSON schema of the metadata differs by Product.asset_type.
  516. // When the type is `google.deploymentmanager.Template`, the schema is
  517. // as
  518. // follows:
  519. //
  520. // ```
  521. // "$schema": http://json-schema.org/draft-04/schema#
  522. // type: object
  523. // properties:
  524. // name:
  525. // type: string
  526. // minLength: 1
  527. // maxLength: 64
  528. // description:
  529. // type: string
  530. // minLength: 1
  531. // maxLength: 2048
  532. // tagline:
  533. // type: string
  534. // minLength: 1
  535. // maxLength: 100
  536. // support_info:
  537. // type: string
  538. // minLength: 1
  539. // maxLength: 2048
  540. // creator:
  541. // type: string
  542. // minLength: 1
  543. // maxLength: 100
  544. // documentation:
  545. // type: array
  546. // items:
  547. // type: object
  548. // properties:
  549. // url:
  550. // type: string
  551. // pattern:
  552. //
  553. // "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
  554. // title:
  555. // type: string
  556. // minLength: 1
  557. // maxLength: 64
  558. // description:
  559. // type: string
  560. // minLength: 1
  561. // maxLength: 2048
  562. // required:
  563. // - name
  564. // - description
  565. // additionalProperties: false
  566. //
  567. // ```
  568. //
  569. // When the asset type is `google.cloudprivatecatalog.ListingOnly`, the
  570. // schema
  571. // is as follows:
  572. //
  573. // ```
  574. // "$schema": http://json-schema.org/draft-04/schema#
  575. // type: object
  576. // properties:
  577. // name:
  578. // type: string
  579. // minLength: 1
  580. // maxLength: 64
  581. // description:
  582. // type: string
  583. // minLength: 1
  584. // maxLength: 2048
  585. // tagline:
  586. // type: string
  587. // minLength: 1
  588. // maxLength: 100
  589. // support_info:
  590. // type: string
  591. // minLength: 1
  592. // maxLength: 2048
  593. // creator:
  594. // type: string
  595. // minLength: 1
  596. // maxLength: 100
  597. // documentation:
  598. // type: array
  599. // items:
  600. // type: object
  601. // properties:
  602. // url:
  603. // type: string
  604. // pattern:
  605. //
  606. // "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
  607. // title:
  608. // type: string
  609. // minLength: 1
  610. // maxLength: 64
  611. // description:
  612. // type: string
  613. // minLength: 1
  614. // maxLength: 2048
  615. // signup_url:
  616. // type: string
  617. // pattern:
  618. //
  619. // "^(https?)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]"
  620. // requ
  621. // ired:
  622. // - name
  623. // - description
  624. // - signup_url
  625. // additionalProperties: false
  626. // ```
  627. DisplayMetadata googleapi.RawMessage `json:"displayMetadata,omitempty"`
  628. // IconUri: Output only. The public accessible URI of the icon uploaded
  629. // by
  630. // PrivateCatalogProducer.UploadIcon.
  631. //
  632. // If no icon is uploaded, it will be the default icon's URI.
  633. IconUri string `json:"iconUri,omitempty"`
  634. // Name: Required. The resource name of the product in the
  635. // format
  636. // `catalogs/{catalog_id}/products/a-z*[a-z0-9]'.
  637. //
  638. // A unique identifier for the product under a catalog, which cannot
  639. // be changed after the product is created. The final
  640. // segment of the name must between 1 and 256 characters in length.
  641. Name string `json:"name,omitempty"`
  642. // UpdateTime: Output only. The time when the product was last updated.
  643. UpdateTime string `json:"updateTime,omitempty"`
  644. // ServerResponse contains the HTTP response code and headers from the
  645. // server.
  646. googleapi.ServerResponse `json:"-"`
  647. // ForceSendFields is a list of field names (e.g. "AssetType") to
  648. // unconditionally include in API requests. By default, fields with
  649. // empty values are omitted from API requests. However, any non-pointer,
  650. // non-interface field appearing in ForceSendFields will be sent to the
  651. // server regardless of whether the field is empty or not. This may be
  652. // used to include empty fields in Patch requests.
  653. ForceSendFields []string `json:"-"`
  654. // NullFields is a list of field names (e.g. "AssetType") to include in
  655. // API requests with the JSON null value. By default, fields with empty
  656. // values are omitted from API requests. However, any field with an
  657. // empty value appearing in NullFields will be sent to the server as
  658. // null. It is an error if a field in this list has a non-empty value.
  659. // This may be used to include null fields in Patch requests.
  660. NullFields []string `json:"-"`
  661. }
  662. func (s *GoogleCloudPrivatecatalogproducerV1beta1Product) MarshalJSON() ([]byte, error) {
  663. type NoMethod GoogleCloudPrivatecatalogproducerV1beta1Product
  664. raw := NoMethod(*s)
  665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  666. }
  667. type GoogleCloudPrivatecatalogproducerV1beta1UndeleteCatalogRequest struct {
  668. }
  669. type GoogleCloudPrivatecatalogproducerV1beta1UploadIconRequest struct {
  670. // Icon: The raw icon bytes user-supplied to be uploaded to the product.
  671. // The format
  672. // of the icon can only be PNG or JPEG. The minimum allowed dimensions
  673. // are
  674. // 130x130 pixels and the maximum dimensions are 10000x10000
  675. // pixels.
  676. // Required.
  677. Icon string `json:"icon,omitempty"`
  678. // ForceSendFields is a list of field names (e.g. "Icon") to
  679. // unconditionally include in API requests. By default, fields with
  680. // empty values are omitted from API requests. However, any non-pointer,
  681. // non-interface field appearing in ForceSendFields will be sent to the
  682. // server regardless of whether the field is empty or not. This may be
  683. // used to include empty fields in Patch requests.
  684. ForceSendFields []string `json:"-"`
  685. // NullFields is a list of field names (e.g. "Icon") to include in API
  686. // requests with the JSON null value. By default, fields with empty
  687. // values are omitted from API requests. However, any field with an
  688. // empty value appearing in NullFields will be sent to the server as
  689. // null. It is an error if a field in this list has a non-empty value.
  690. // This may be used to include null fields in Patch requests.
  691. NullFields []string `json:"-"`
  692. }
  693. func (s *GoogleCloudPrivatecatalogproducerV1beta1UploadIconRequest) MarshalJSON() ([]byte, error) {
  694. type NoMethod GoogleCloudPrivatecatalogproducerV1beta1UploadIconRequest
  695. raw := NoMethod(*s)
  696. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  697. }
  698. // GoogleCloudPrivatecatalogproducerV1beta1Version: The producer
  699. // representation of a version, which is a child resource under
  700. // a
  701. // `Product` with asset data.
  702. type GoogleCloudPrivatecatalogproducerV1beta1Version struct {
  703. // Asset: Output only. The asset which has been validated and is ready
  704. // to be
  705. // provisioned. See Version.original_asset for the schema.
  706. Asset googleapi.RawMessage `json:"asset,omitempty"`
  707. // CreateTime: Output only. The time when the version was created.
  708. CreateTime string `json:"createTime,omitempty"`
  709. // Description: The user-supplied description of the version. Maximum of
  710. // 256 characters.
  711. Description string `json:"description,omitempty"`
  712. // Name: Required. The resource name of the version, in the
  713. // format
  714. // `catalogs/{catalog_id}/products/{product_id}/versions/a-z*[a-z0
  715. // -9]'.
  716. //
  717. // A unique identifier for the version under a product, which can't
  718. // be changed after the version is created. The final segment of the
  719. // name must
  720. // between 1 and 63 characters in length.
  721. Name string `json:"name,omitempty"`
  722. // OriginalAsset: The user-supplied asset payload. The maximum size of
  723. // the payload is 2MB.
  724. // The JSON schema of the payload is defined as:
  725. //
  726. // ```
  727. // type: object
  728. // properties:
  729. // mainTemplate:
  730. // type: string
  731. // description: The file name of the main template and name prefix
  732. // of
  733. // schema file. The content of the main template should be set in
  734. // the
  735. // imports list. The schema file name is expected to be
  736. // <mainTemplate>.schema in the imports list. required: true
  737. // imports:
  738. // type: array
  739. // description: Import template and schema file contents. Required
  740. // to have
  741. // both <mainTemplate> and <mainTemplate>.schema files. required:
  742. // true
  743. // minItems: 2
  744. // items:
  745. // type: object
  746. // properties:
  747. // name:
  748. // type: string
  749. // content:
  750. // type: string
  751. // ```
  752. OriginalAsset googleapi.RawMessage `json:"originalAsset,omitempty"`
  753. // UpdateTime: Output only. The time when the version was last updated.
  754. UpdateTime string `json:"updateTime,omitempty"`
  755. // ServerResponse contains the HTTP response code and headers from the
  756. // server.
  757. googleapi.ServerResponse `json:"-"`
  758. // ForceSendFields is a list of field names (e.g. "Asset") to
  759. // unconditionally include in API requests. By default, fields with
  760. // empty values are omitted from API requests. However, any non-pointer,
  761. // non-interface field appearing in ForceSendFields will be sent to the
  762. // server regardless of whether the field is empty or not. This may be
  763. // used to include empty fields in Patch requests.
  764. ForceSendFields []string `json:"-"`
  765. // NullFields is a list of field names (e.g. "Asset") to include in API
  766. // requests with the JSON null value. By default, fields with empty
  767. // values are omitted from API requests. However, any field with an
  768. // empty value appearing in NullFields will be sent to the server as
  769. // null. It is an error if a field in this list has a non-empty value.
  770. // This may be used to include null fields in Patch requests.
  771. NullFields []string `json:"-"`
  772. }
  773. func (s *GoogleCloudPrivatecatalogproducerV1beta1Version) MarshalJSON() ([]byte, error) {
  774. type NoMethod GoogleCloudPrivatecatalogproducerV1beta1Version
  775. raw := NoMethod(*s)
  776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  777. }
  778. // GoogleIamV1AuditConfig: Specifies the audit configuration for a
  779. // service.
  780. // The configuration determines which permission types are logged, and
  781. // what
  782. // identities, if any, are exempted from logging.
  783. // An AuditConfig must have one or more AuditLogConfigs.
  784. //
  785. // If there are AuditConfigs for both `allServices` and a specific
  786. // service,
  787. // the union of the two AuditConfigs is used for that service: the
  788. // log_types
  789. // specified in each AuditConfig are enabled, and the exempted_members
  790. // in each
  791. // AuditLogConfig are exempted.
  792. //
  793. // Example Policy with multiple AuditConfigs:
  794. //
  795. // {
  796. // "audit_configs": [
  797. // {
  798. // "service": "allServices"
  799. // "audit_log_configs": [
  800. // {
  801. // "log_type": "DATA_READ",
  802. // "exempted_members": [
  803. // "user:foo@gmail.com"
  804. // ]
  805. // },
  806. // {
  807. // "log_type": "DATA_WRITE",
  808. // },
  809. // {
  810. // "log_type": "ADMIN_READ",
  811. // }
  812. // ]
  813. // },
  814. // {
  815. // "service": "fooservice.googleapis.com"
  816. // "audit_log_configs": [
  817. // {
  818. // "log_type": "DATA_READ",
  819. // },
  820. // {
  821. // "log_type": "DATA_WRITE",
  822. // "exempted_members": [
  823. // "user:bar@gmail.com"
  824. // ]
  825. // }
  826. // ]
  827. // }
  828. // ]
  829. // }
  830. //
  831. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  832. // ADMIN_READ
  833. // logging. It also exempts foo@gmail.com from DATA_READ logging,
  834. // and
  835. // bar@gmail.com from DATA_WRITE logging.
  836. type GoogleIamV1AuditConfig struct {
  837. // AuditLogConfigs: The configuration for logging of each type of
  838. // permission.
  839. AuditLogConfigs []*GoogleIamV1AuditLogConfig `json:"auditLogConfigs,omitempty"`
  840. // Service: Specifies a service that will be enabled for audit
  841. // logging.
  842. // For example, `storage.googleapis.com`,
  843. // `cloudsql.googleapis.com`.
  844. // `allServices` is a special value that covers all services.
  845. Service string `json:"service,omitempty"`
  846. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  847. // unconditionally include in API requests. By default, fields with
  848. // empty values are omitted from API requests. However, any non-pointer,
  849. // non-interface field appearing in ForceSendFields will be sent to the
  850. // server regardless of whether the field is empty or not. This may be
  851. // used to include empty fields in Patch requests.
  852. ForceSendFields []string `json:"-"`
  853. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  854. // include in API requests with the JSON null value. By default, fields
  855. // with empty values are omitted from API requests. However, any field
  856. // with an empty value appearing in NullFields will be sent to the
  857. // server as null. It is an error if a field in this list has a
  858. // non-empty value. This may be used to include null fields in Patch
  859. // requests.
  860. NullFields []string `json:"-"`
  861. }
  862. func (s *GoogleIamV1AuditConfig) MarshalJSON() ([]byte, error) {
  863. type NoMethod GoogleIamV1AuditConfig
  864. raw := NoMethod(*s)
  865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  866. }
  867. // GoogleIamV1AuditLogConfig: Provides the configuration for logging a
  868. // type of permissions.
  869. // Example:
  870. //
  871. // {
  872. // "audit_log_configs": [
  873. // {
  874. // "log_type": "DATA_READ",
  875. // "exempted_members": [
  876. // "user:foo@gmail.com"
  877. // ]
  878. // },
  879. // {
  880. // "log_type": "DATA_WRITE",
  881. // }
  882. // ]
  883. // }
  884. //
  885. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while
  886. // exempting
  887. // foo@gmail.com from DATA_READ logging.
  888. type GoogleIamV1AuditLogConfig struct {
  889. // ExemptedMembers: Specifies the identities that do not cause logging
  890. // for this type of
  891. // permission.
  892. // Follows the same format of Binding.members.
  893. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  894. // LogType: The log type that this config enables.
  895. //
  896. // Possible values:
  897. // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
  898. // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
  899. // "DATA_WRITE" - Data writes. Example: CloudSQL Users create
  900. // "DATA_READ" - Data reads. Example: CloudSQL Users list
  901. LogType string `json:"logType,omitempty"`
  902. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  903. // unconditionally include in API requests. By default, fields with
  904. // empty values are omitted from API requests. However, any non-pointer,
  905. // non-interface field appearing in ForceSendFields will be sent to the
  906. // server regardless of whether the field is empty or not. This may be
  907. // used to include empty fields in Patch requests.
  908. ForceSendFields []string `json:"-"`
  909. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  910. // include in API requests with the JSON null value. By default, fields
  911. // with empty values are omitted from API requests. However, any field
  912. // with an empty value appearing in NullFields will be sent to the
  913. // server as null. It is an error if a field in this list has a
  914. // non-empty value. This may be used to include null fields in Patch
  915. // requests.
  916. NullFields []string `json:"-"`
  917. }
  918. func (s *GoogleIamV1AuditLogConfig) MarshalJSON() ([]byte, error) {
  919. type NoMethod GoogleIamV1AuditLogConfig
  920. raw := NoMethod(*s)
  921. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  922. }
  923. // GoogleIamV1Binding: Associates `members` with a `role`.
  924. type GoogleIamV1Binding struct {
  925. // Condition: Unimplemented. The condition that is associated with this
  926. // binding.
  927. // NOTE: an unsatisfied condition will not allow user access via
  928. // current
  929. // binding. Different bindings, including their conditions, are
  930. // examined
  931. // independently.
  932. Condition *GoogleTypeExpr `json:"condition,omitempty"`
  933. // Members: Specifies the identities requesting access for a Cloud
  934. // Platform resource.
  935. // `members` can have the following values:
  936. //
  937. // * `allUsers`: A special identifier that represents anyone who is
  938. // on the internet; with or without a Google account.
  939. //
  940. // * `allAuthenticatedUsers`: A special identifier that represents
  941. // anyone
  942. // who is authenticated with a Google account or a service
  943. // account.
  944. //
  945. // * `user:{emailid}`: An email address that represents a specific
  946. // Google
  947. // account. For example, `alice@gmail.com` .
  948. //
  949. //
  950. // * `serviceAccount:{emailid}`: An email address that represents a
  951. // service
  952. // account. For example,
  953. // `my-other-app@appspot.gserviceaccount.com`.
  954. //
  955. // * `group:{emailid}`: An email address that represents a Google
  956. // group.
  957. // For example, `admins@example.com`.
  958. //
  959. //
  960. // * `domain:{domain}`: The G Suite domain (primary) that represents all
  961. // the
  962. // users of that domain. For example, `google.com` or
  963. // `example.com`.
  964. //
  965. //
  966. Members []string `json:"members,omitempty"`
  967. // Role: Role that is assigned to `members`.
  968. // For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
  969. Role string `json:"role,omitempty"`
  970. // ForceSendFields is a list of field names (e.g. "Condition") to
  971. // unconditionally include in API requests. By default, fields with
  972. // empty values are omitted from API requests. However, any non-pointer,
  973. // non-interface field appearing in ForceSendFields will be sent to the
  974. // server regardless of whether the field is empty or not. This may be
  975. // used to include empty fields in Patch requests.
  976. ForceSendFields []string `json:"-"`
  977. // NullFields is a list of field names (e.g. "Condition") to include in
  978. // API requests with the JSON null value. By default, fields with empty
  979. // values are omitted from API requests. However, any field with an
  980. // empty value appearing in NullFields will be sent to the server as
  981. // null. It is an error if a field in this list has a non-empty value.
  982. // This may be used to include null fields in Patch requests.
  983. NullFields []string `json:"-"`
  984. }
  985. func (s *GoogleIamV1Binding) MarshalJSON() ([]byte, error) {
  986. type NoMethod GoogleIamV1Binding
  987. raw := NoMethod(*s)
  988. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  989. }
  990. // GoogleIamV1Policy: Defines an Identity and Access Management (IAM)
  991. // policy. It is used to
  992. // specify access control policies for Cloud Platform resources.
  993. //
  994. //
  995. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  996. // of
  997. // `members` to a `role`, where the members can be user accounts, Google
  998. // groups,
  999. // Google domains, and service accounts. A `role` is a named list of
  1000. // permissions
  1001. // defined by IAM.
  1002. //
  1003. // **JSON Example**
  1004. //
  1005. // {
  1006. // "bindings": [
  1007. // {
  1008. // "role": "roles/owner",
  1009. // "members": [
  1010. // "user:mike@example.com",
  1011. // "group:admins@example.com",
  1012. // "domain:google.com",
  1013. //
  1014. // "serviceAccount:my-other-app@appspot.gserviceaccount.com"
  1015. // ]
  1016. // },
  1017. // {
  1018. // "role": "roles/viewer",
  1019. // "members": ["user:sean@example.com"]
  1020. // }
  1021. // ]
  1022. // }
  1023. //
  1024. // **YAML Example**
  1025. //
  1026. // bindings:
  1027. // - members:
  1028. // - user:mike@example.com
  1029. // - group:admins@example.com
  1030. // - domain:google.com
  1031. // - serviceAccount:my-other-app@appspot.gserviceaccount.com
  1032. // role: roles/owner
  1033. // - members:
  1034. // - user:sean@example.com
  1035. // role: roles/viewer
  1036. //
  1037. //
  1038. // For a description of IAM and its features, see the
  1039. // [IAM developer's guide](https://cloud.google.com/iam/docs).
  1040. type GoogleIamV1Policy struct {
  1041. // AuditConfigs: Specifies cloud audit logging configuration for this
  1042. // policy.
  1043. AuditConfigs []*GoogleIamV1AuditConfig `json:"auditConfigs,omitempty"`
  1044. // Bindings: Associates a list of `members` to a `role`.
  1045. // `bindings` with no members will result in an error.
  1046. Bindings []*GoogleIamV1Binding `json:"bindings,omitempty"`
  1047. // Etag: `etag` is used for optimistic concurrency control as a way to
  1048. // help
  1049. // prevent simultaneous updates of a policy from overwriting each
  1050. // other.
  1051. // It is strongly suggested that systems make use of the `etag` in
  1052. // the
  1053. // read-modify-write cycle to perform policy updates in order to avoid
  1054. // race
  1055. // conditions: An `etag` is returned in the response to `getIamPolicy`,
  1056. // and
  1057. // systems are expected to put that etag in the request to
  1058. // `setIamPolicy` to
  1059. // ensure that their change will be applied to the same version of the
  1060. // policy.
  1061. //
  1062. // If no `etag` is provided in the call to `setIamPolicy`, then the
  1063. // existing
  1064. // policy is overwritten blindly.
  1065. Etag string `json:"etag,omitempty"`
  1066. // Version: Deprecated.
  1067. Version int64 `json:"version,omitempty"`
  1068. // ServerResponse contains the HTTP response code and headers from the
  1069. // server.
  1070. googleapi.ServerResponse `json:"-"`
  1071. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  1072. // unconditionally include in API requests. By default, fields with
  1073. // empty values are omitted from API requests. However, any non-pointer,
  1074. // non-interface field appearing in ForceSendFields will be sent to the
  1075. // server regardless of whether the field is empty or not. This may be
  1076. // used to include empty fields in Patch requests.
  1077. ForceSendFields []string `json:"-"`
  1078. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  1079. // in API requests with the JSON null value. By default, fields with
  1080. // empty values are omitted from API requests. However, any field with
  1081. // an empty value appearing in NullFields will be sent to the server as
  1082. // null. It is an error if a field in this list has a non-empty value.
  1083. // This may be used to include null fields in Patch requests.
  1084. NullFields []string `json:"-"`
  1085. }
  1086. func (s *GoogleIamV1Policy) MarshalJSON() ([]byte, error) {
  1087. type NoMethod GoogleIamV1Policy
  1088. raw := NoMethod(*s)
  1089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1090. }
  1091. // GoogleIamV1SetIamPolicyRequest: Request message for `SetIamPolicy`
  1092. // method.
  1093. type GoogleIamV1SetIamPolicyRequest struct {
  1094. // Policy: REQUIRED: The complete policy to be applied to the
  1095. // `resource`. The size of
  1096. // the policy is limited to a few 10s of KB. An empty policy is a
  1097. // valid policy but certain Cloud Platform services (such as
  1098. // Projects)
  1099. // might reject them.
  1100. Policy *GoogleIamV1Policy `json:"policy,omitempty"`
  1101. // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the
  1102. // policy to modify. Only
  1103. // the fields in the mask will be modified. If no mask is provided,
  1104. // the
  1105. // following default mask is used:
  1106. // paths: "bindings, etag"
  1107. // This field is only used by Cloud IAM.
  1108. UpdateMask string `json:"updateMask,omitempty"`
  1109. // ForceSendFields is a list of field names (e.g. "Policy") to
  1110. // unconditionally include in API requests. By default, fields with
  1111. // empty values are omitted from API requests. However, any non-pointer,
  1112. // non-interface field appearing in ForceSendFields will be sent to the
  1113. // server regardless of whether the field is empty or not. This may be
  1114. // used to include empty fields in Patch requests.
  1115. ForceSendFields []string `json:"-"`
  1116. // NullFields is a list of field names (e.g. "Policy") to include in API
  1117. // requests with the JSON null value. By default, fields with empty
  1118. // values are omitted from API requests. However, any field with an
  1119. // empty value appearing in NullFields will be sent to the server as
  1120. // null. It is an error if a field in this list has a non-empty value.
  1121. // This may be used to include null fields in Patch requests.
  1122. NullFields []string `json:"-"`
  1123. }
  1124. func (s *GoogleIamV1SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  1125. type NoMethod GoogleIamV1SetIamPolicyRequest
  1126. raw := NoMethod(*s)
  1127. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1128. }
  1129. // GoogleIamV1TestIamPermissionsRequest: Request message for
  1130. // `TestIamPermissions` method.
  1131. type GoogleIamV1TestIamPermissionsRequest struct {
  1132. // Permissions: The set of permissions to check for the `resource`.
  1133. // Permissions with
  1134. // wildcards (such as '*' or 'storage.*') are not allowed. For
  1135. // more
  1136. // information see
  1137. // [IAM
  1138. // Overview](https://cloud.google.com/iam/docs/overview#permissions).
  1139. Permissions []string `json:"permissions,omitempty"`
  1140. // ForceSendFields is a list of field names (e.g. "Permissions") to
  1141. // unconditionally include in API requests. By default, fields with
  1142. // empty values are omitted from API requests. However, any non-pointer,
  1143. // non-interface field appearing in ForceSendFields will be sent to the
  1144. // server regardless of whether the field is empty or not. This may be
  1145. // used to include empty fields in Patch requests.
  1146. ForceSendFields []string `json:"-"`
  1147. // NullFields is a list of field names (e.g. "Permissions") to include
  1148. // in API requests with the JSON null value. By default, fields with
  1149. // empty values are omitted from API requests. However, any field with
  1150. // an empty value appearing in NullFields will be sent to the server as
  1151. // null. It is an error if a field in this list has a non-empty value.
  1152. // This may be used to include null fields in Patch requests.
  1153. NullFields []string `json:"-"`
  1154. }
  1155. func (s *GoogleIamV1TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  1156. type NoMethod GoogleIamV1TestIamPermissionsRequest
  1157. raw := NoMethod(*s)
  1158. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1159. }
  1160. // GoogleIamV1TestIamPermissionsResponse: Response message for
  1161. // `TestIamPermissions` method.
  1162. type GoogleIamV1TestIamPermissionsResponse struct {
  1163. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  1164. // the caller is
  1165. // allowed.
  1166. Permissions []string `json:"permissions,omitempty"`
  1167. // ServerResponse contains the HTTP response code and headers from the
  1168. // server.
  1169. googleapi.ServerResponse `json:"-"`
  1170. // ForceSendFields is a list of field names (e.g. "Permissions") to
  1171. // unconditionally include in API requests. By default, fields with
  1172. // empty values are omitted from API requests. However, any non-pointer,
  1173. // non-interface field appearing in ForceSendFields will be sent to the
  1174. // server regardless of whether the field is empty or not. This may be
  1175. // used to include empty fields in Patch requests.
  1176. ForceSendFields []string `json:"-"`
  1177. // NullFields is a list of field names (e.g. "Permissions") to include
  1178. // in API requests with the JSON null value. By default, fields with
  1179. // empty values are omitted from API requests. However, any field with
  1180. // an empty value appearing in NullFields will be sent to the server as
  1181. // null. It is an error if a field in this list has a non-empty value.
  1182. // This may be used to include null fields in Patch requests.
  1183. NullFields []string `json:"-"`
  1184. }
  1185. func (s *GoogleIamV1TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  1186. type NoMethod GoogleIamV1TestIamPermissionsResponse
  1187. raw := NoMethod(*s)
  1188. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1189. }
  1190. // GoogleLongrunningCancelOperationRequest: The request message for
  1191. // Operations.CancelOperation.
  1192. type GoogleLongrunningCancelOperationRequest struct {
  1193. }
  1194. // GoogleLongrunningListOperationsResponse: The response message for
  1195. // Operations.ListOperations.
  1196. type GoogleLongrunningListOperationsResponse struct {
  1197. // NextPageToken: The standard List next-page token.
  1198. NextPageToken string `json:"nextPageToken,omitempty"`
  1199. // Operations: A list of operations that matches the specified filter in
  1200. // the request.
  1201. Operations []*GoogleLongrunningOperation `json:"operations,omitempty"`
  1202. // ServerResponse contains the HTTP response code and headers from the
  1203. // server.
  1204. googleapi.ServerResponse `json:"-"`
  1205. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1206. // unconditionally include in API requests. By default, fields with
  1207. // empty values are omitted from API requests. However, any non-pointer,
  1208. // non-interface field appearing in ForceSendFields will be sent to the
  1209. // server regardless of whether the field is empty or not. This may be
  1210. // used to include empty fields in Patch requests.
  1211. ForceSendFields []string `json:"-"`
  1212. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1213. // in API requests with the JSON null value. By default, fields with
  1214. // empty values are omitted from API requests. However, any field with
  1215. // an empty value appearing in NullFields will be sent to the server as
  1216. // null. It is an error if a field in this list has a non-empty value.
  1217. // This may be used to include null fields in Patch requests.
  1218. NullFields []string `json:"-"`
  1219. }
  1220. func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) {
  1221. type NoMethod GoogleLongrunningListOperationsResponse
  1222. raw := NoMethod(*s)
  1223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1224. }
  1225. // GoogleLongrunningOperation: This resource represents a long-running
  1226. // operation that is the result of a
  1227. // network API call.
  1228. type GoogleLongrunningOperation struct {
  1229. // Done: If the value is `false`, it means the operation is still in
  1230. // progress.
  1231. // If `true`, the operation is completed, and either `error` or
  1232. // `response` is
  1233. // available.
  1234. Done bool `json:"done,omitempty"`
  1235. // Error: The error result of the operation in case of failure or
  1236. // cancellation.
  1237. Error *GoogleRpcStatus `json:"error,omitempty"`
  1238. // Metadata: Service-specific metadata associated with the operation.
  1239. // It typically
  1240. // contains progress information and common metadata such as create
  1241. // time.
  1242. // Some services might not provide such metadata. Any method that
  1243. // returns a
  1244. // long-running operation should document the metadata type, if any.
  1245. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  1246. // Name: The server-assigned name, which is only unique within the same
  1247. // service that
  1248. // originally returns it. If you use the default HTTP mapping,
  1249. // the
  1250. // `name` should have the format of `operations/some/unique/name`.
  1251. Name string `json:"name,omitempty"`
  1252. // Response: The normal response of the operation in case of success.
  1253. // If the original
  1254. // method returns no data on success, such as `Delete`, the response
  1255. // is
  1256. // `google.protobuf.Empty`. If the original method is
  1257. // standard
  1258. // `Get`/`Create`/`Update`, the response should be the resource. For
  1259. // other
  1260. // methods, the response should have the type `XxxResponse`, where
  1261. // `Xxx`
  1262. // is the original method name. For example, if the original method
  1263. // name
  1264. // is `TakeSnapshot()`, the inferred response type
  1265. // is
  1266. // `TakeSnapshotResponse`.
  1267. Response googleapi.RawMessage `json:"response,omitempty"`
  1268. // ServerResponse contains the HTTP response code and headers from the
  1269. // server.
  1270. googleapi.ServerResponse `json:"-"`
  1271. // ForceSendFields is a list of field names (e.g. "Done") to
  1272. // unconditionally include in API requests. By default, fields with
  1273. // empty values are omitted from API requests. However, any non-pointer,
  1274. // non-interface field appearing in ForceSendFields will be sent to the
  1275. // server regardless of whether the field is empty or not. This may be
  1276. // used to include empty fields in Patch requests.
  1277. ForceSendFields []string `json:"-"`
  1278. // NullFields is a list of field names (e.g. "Done") to include in API
  1279. // requests with the JSON null value. By default, fields with empty
  1280. // values are omitted from API requests. However, any field with an
  1281. // empty value appearing in NullFields will be sent to the server as
  1282. // null. It is an error if a field in this list has a non-empty value.
  1283. // This may be used to include null fields in Patch requests.
  1284. NullFields []string `json:"-"`
  1285. }
  1286. func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
  1287. type NoMethod GoogleLongrunningOperation
  1288. raw := NoMethod(*s)
  1289. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1290. }
  1291. // GoogleProtobufEmpty: A generic empty message that you can re-use to
  1292. // avoid defining duplicated
  1293. // empty messages in your APIs. A typical example is to use it as the
  1294. // request
  1295. // or the response type of an API method. For instance:
  1296. //
  1297. // service Foo {
  1298. // rpc Bar(google.protobuf.Empty) returns
  1299. // (google.protobuf.Empty);
  1300. // }
  1301. //
  1302. // The JSON representation for `Empty` is empty JSON object `{}`.
  1303. type GoogleProtobufEmpty struct {
  1304. // ServerResponse contains the HTTP response code and headers from the
  1305. // server.
  1306. googleapi.ServerResponse `json:"-"`
  1307. }
  1308. // GoogleRpcStatus: The `Status` type defines a logical error model that
  1309. // is suitable for
  1310. // different programming environments, including REST APIs and RPC APIs.
  1311. // It is
  1312. // used by [gRPC](https://github.com/grpc). The error model is designed
  1313. // to be:
  1314. //
  1315. // - Simple to use and understand for most users
  1316. // - Flexible enough to meet unexpected needs
  1317. //
  1318. // # Overview
  1319. //
  1320. // The `Status` message contains three pieces of data: error code,
  1321. // error
  1322. // message, and error details. The error code should be an enum value
  1323. // of
  1324. // google.rpc.Code, but it may accept additional error codes if needed.
  1325. // The
  1326. // error message should be a developer-facing English message that
  1327. // helps
  1328. // developers *understand* and *resolve* the error. If a localized
  1329. // user-facing
  1330. // error message is needed, put the localized message in the error
  1331. // details or
  1332. // localize it in the client. The optional error details may contain
  1333. // arbitrary
  1334. // information about the error. There is a predefined set of error
  1335. // detail types
  1336. // in the package `google.rpc` that can be used for common error
  1337. // conditions.
  1338. //
  1339. // # Language mapping
  1340. //
  1341. // The `Status` message is the logical representation of the error
  1342. // model, but it
  1343. // is not necessarily the actual wire format. When the `Status` message
  1344. // is
  1345. // exposed in different client libraries and different wire protocols,
  1346. // it can be
  1347. // mapped differently. For example, it will likely be mapped to some
  1348. // exceptions
  1349. // in Java, but more likely mapped to some error codes in C.
  1350. //
  1351. // # Other uses
  1352. //
  1353. // The error model and the `Status` message can be used in a variety
  1354. // of
  1355. // environments, either with or without APIs, to provide a
  1356. // consistent developer experience across different
  1357. // environments.
  1358. //
  1359. // Example uses of this error model include:
  1360. //
  1361. // - Partial errors. If a service needs to return partial errors to the
  1362. // client,
  1363. // it may embed the `Status` in the normal response to indicate the
  1364. // partial
  1365. // errors.
  1366. //
  1367. // - Workflow errors. A typical workflow has multiple steps. Each step
  1368. // may
  1369. // have a `Status` message for error reporting.
  1370. //
  1371. // - Batch operations. If a client uses batch request and batch
  1372. // response, the
  1373. // `Status` message should be used directly inside batch response,
  1374. // one for
  1375. // each error sub-response.
  1376. //
  1377. // - Asynchronous operations. If an API call embeds asynchronous
  1378. // operation
  1379. // results in its response, the status of those operations should
  1380. // be
  1381. // represented directly using the `Status` message.
  1382. //
  1383. // - Logging. If some API errors are stored in logs, the message
  1384. // `Status` could
  1385. // be used directly after any stripping needed for security/privacy
  1386. // reasons.
  1387. type GoogleRpcStatus struct {
  1388. // Code: The status code, which should be an enum value of
  1389. // google.rpc.Code.
  1390. Code int64 `json:"code,omitempty"`
  1391. // Details: A list of messages that carry the error details. There is a
  1392. // common set of
  1393. // message types for APIs to use.
  1394. Details []googleapi.RawMessage `json:"details,omitempty"`
  1395. // Message: A developer-facing error message, which should be in
  1396. // English. Any
  1397. // user-facing error message should be localized and sent in
  1398. // the
  1399. // google.rpc.Status.details field, or localized by the client.
  1400. Message string `json:"message,omitempty"`
  1401. // ForceSendFields is a list of field names (e.g. "Code") to
  1402. // unconditionally include in API requests. By default, fields with
  1403. // empty values are omitted from API requests. However, any non-pointer,
  1404. // non-interface field appearing in ForceSendFields will be sent to the
  1405. // server regardless of whether the field is empty or not. This may be
  1406. // used to include empty fields in Patch requests.
  1407. ForceSendFields []string `json:"-"`
  1408. // NullFields is a list of field names (e.g. "Code") to include in API
  1409. // requests with the JSON null value. By default, fields with empty
  1410. // values are omitted from API requests. However, any field with an
  1411. // empty value appearing in NullFields will be sent to the server as
  1412. // null. It is an error if a field in this list has a non-empty value.
  1413. // This may be used to include null fields in Patch requests.
  1414. NullFields []string `json:"-"`
  1415. }
  1416. func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) {
  1417. type NoMethod GoogleRpcStatus
  1418. raw := NoMethod(*s)
  1419. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1420. }
  1421. // GoogleTypeExpr: Represents an expression text. Example:
  1422. //
  1423. // title: "User account presence"
  1424. // description: "Determines whether the request has a user account"
  1425. // expression: "size(request.user) > 0"
  1426. type GoogleTypeExpr struct {
  1427. // Description: An optional description of the expression. This is a
  1428. // longer text which
  1429. // describes the expression, e.g. when hovered over it in a UI.
  1430. Description string `json:"description,omitempty"`
  1431. // Expression: Textual representation of an expression in
  1432. // Common Expression Language syntax.
  1433. //
  1434. // The application context of the containing message determines
  1435. // which
  1436. // well-known feature set of CEL is supported.
  1437. Expression string `json:"expression,omitempty"`
  1438. // Location: An optional string indicating the location of the
  1439. // expression for error
  1440. // reporting, e.g. a file name and a position in the file.
  1441. Location string `json:"location,omitempty"`
  1442. // Title: An optional title for the expression, i.e. a short string
  1443. // describing
  1444. // its purpose. This can be used e.g. in UIs which allow to enter
  1445. // the
  1446. // expression.
  1447. Title string `json:"title,omitempty"`
  1448. // ForceSendFields is a list of field names (e.g. "Description") to
  1449. // unconditionally include in API requests. By default, fields with
  1450. // empty values are omitted from API requests. However, any non-pointer,
  1451. // non-interface field appearing in ForceSendFields will be sent to the
  1452. // server regardless of whether the field is empty or not. This may be
  1453. // used to include empty fields in Patch requests.
  1454. ForceSendFields []string `json:"-"`
  1455. // NullFields is a list of field names (e.g. "Description") to include
  1456. // in API requests with the JSON null value. By default, fields with
  1457. // empty values are omitted from API requests. However, any field with
  1458. // an empty value appearing in NullFields will be sent to the server as
  1459. // null. It is an error if a field in this list has a non-empty value.
  1460. // This may be used to include null fields in Patch requests.
  1461. NullFields []string `json:"-"`
  1462. }
  1463. func (s *GoogleTypeExpr) MarshalJSON() ([]byte, error) {
  1464. type NoMethod GoogleTypeExpr
  1465. raw := NoMethod(*s)
  1466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1467. }
  1468. // method id "cloudprivatecatalogproducer.catalogs.create":
  1469. type CatalogsCreateCall struct {
  1470. s *Service
  1471. googlecloudprivatecatalogproducerv1beta1catalog *GoogleCloudPrivatecatalogproducerV1beta1Catalog
  1472. urlParams_ gensupport.URLParams
  1473. ctx_ context.Context
  1474. header_ http.Header
  1475. }
  1476. // Create: Creates a new Catalog resource.
  1477. func (r *CatalogsService) Create(googlecloudprivatecatalogproducerv1beta1catalog *GoogleCloudPrivatecatalogproducerV1beta1Catalog) *CatalogsCreateCall {
  1478. c := &CatalogsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1479. c.googlecloudprivatecatalogproducerv1beta1catalog = googlecloudprivatecatalogproducerv1beta1catalog
  1480. return c
  1481. }
  1482. // Fields allows partial responses to be retrieved. See
  1483. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1484. // for more information.
  1485. func (c *CatalogsCreateCall) Fields(s ...googleapi.Field) *CatalogsCreateCall {
  1486. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1487. return c
  1488. }
  1489. // Context sets the context to be used in this call's Do method. Any
  1490. // pending HTTP request will be aborted if the provided context is
  1491. // canceled.
  1492. func (c *CatalogsCreateCall) Context(ctx context.Context) *CatalogsCreateCall {
  1493. c.ctx_ = ctx
  1494. return c
  1495. }
  1496. // Header returns an http.Header that can be modified by the caller to
  1497. // add HTTP headers to the request.
  1498. func (c *CatalogsCreateCall) Header() http.Header {
  1499. if c.header_ == nil {
  1500. c.header_ = make(http.Header)
  1501. }
  1502. return c.header_
  1503. }
  1504. func (c *CatalogsCreateCall) doRequest(alt string) (*http.Response, error) {
  1505. reqHeaders := make(http.Header)
  1506. for k, v := range c.header_ {
  1507. reqHeaders[k] = v
  1508. }
  1509. reqHeaders.Set("User-Agent", c.s.userAgent())
  1510. var body io.Reader = nil
  1511. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudprivatecatalogproducerv1beta1catalog)
  1512. if err != nil {
  1513. return nil, err
  1514. }
  1515. reqHeaders.Set("Content-Type", "application/json")
  1516. c.urlParams_.Set("alt", alt)
  1517. c.urlParams_.Set("prettyPrint", "false")
  1518. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/catalogs")
  1519. urls += "?" + c.urlParams_.Encode()
  1520. req, err := http.NewRequest("POST", urls, body)
  1521. if err != nil {
  1522. return nil, err
  1523. }
  1524. req.Header = reqHeaders
  1525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1526. }
  1527. // Do executes the "cloudprivatecatalogproducer.catalogs.create" call.
  1528. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  1529. // Any non-2xx status code is an error. Response headers are in either
  1530. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  1531. // was returned at all) in error.(*googleapi.Error).Header. Use
  1532. // googleapi.IsNotModified to check whether the returned error was
  1533. // because http.StatusNotModified was returned.
  1534. func (c *CatalogsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  1535. gensupport.SetOptions(c.urlParams_, opts...)
  1536. res, err := c.doRequest("json")
  1537. if res != nil && res.StatusCode == http.StatusNotModified {
  1538. if res.Body != nil {
  1539. res.Body.Close()
  1540. }
  1541. return nil, &googleapi.Error{
  1542. Code: res.StatusCode,
  1543. Header: res.Header,
  1544. }
  1545. }
  1546. if err != nil {
  1547. return nil, err
  1548. }
  1549. defer googleapi.CloseBody(res)
  1550. if err := googleapi.CheckResponse(res); err != nil {
  1551. return nil, err
  1552. }
  1553. ret := &GoogleLongrunningOperation{
  1554. ServerResponse: googleapi.ServerResponse{
  1555. Header: res.Header,
  1556. HTTPStatusCode: res.StatusCode,
  1557. },
  1558. }
  1559. target := &ret
  1560. if err := gensupport.DecodeResponse(target, res); err != nil {
  1561. return nil, err
  1562. }
  1563. return ret, nil
  1564. // {
  1565. // "description": "Creates a new Catalog resource.",
  1566. // "flatPath": "v1beta1/catalogs",
  1567. // "httpMethod": "POST",
  1568. // "id": "cloudprivatecatalogproducer.catalogs.create",
  1569. // "parameterOrder": [],
  1570. // "parameters": {},
  1571. // "path": "v1beta1/catalogs",
  1572. // "request": {
  1573. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Catalog"
  1574. // },
  1575. // "response": {
  1576. // "$ref": "GoogleLongrunningOperation"
  1577. // },
  1578. // "scopes": [
  1579. // "https://www.googleapis.com/auth/cloud-platform"
  1580. // ]
  1581. // }
  1582. }
  1583. // method id "cloudprivatecatalogproducer.catalogs.delete":
  1584. type CatalogsDeleteCall struct {
  1585. s *Service
  1586. name string
  1587. urlParams_ gensupport.URLParams
  1588. ctx_ context.Context
  1589. header_ http.Header
  1590. }
  1591. // Delete: Soft deletes an existing Catalog and all resources under
  1592. // it.
  1593. // The catalog can only be deleted if there is no associations under it
  1594. // or
  1595. // DeleteCatalogRequest.force is true. The delete operation
  1596. // can be recovered by the
  1597. // PrivateCatalogProducer.UndeleteCatalog
  1598. // method.
  1599. func (r *CatalogsService) Delete(name string) *CatalogsDeleteCall {
  1600. c := &CatalogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1601. c.name = name
  1602. return c
  1603. }
  1604. // Force sets the optional parameter "force": Forces deletion of the
  1605. // `Catalog` and its `Association` resources.
  1606. // If the `Catalog` is still associated with other resources and
  1607. // force is not set to true, then the operation fails.
  1608. func (c *CatalogsDeleteCall) Force(force bool) *CatalogsDeleteCall {
  1609. c.urlParams_.Set("force", fmt.Sprint(force))
  1610. return c
  1611. }
  1612. // Fields allows partial responses to be retrieved. See
  1613. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1614. // for more information.
  1615. func (c *CatalogsDeleteCall) Fields(s ...googleapi.Field) *CatalogsDeleteCall {
  1616. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1617. return c
  1618. }
  1619. // Context sets the context to be used in this call's Do method. Any
  1620. // pending HTTP request will be aborted if the provided context is
  1621. // canceled.
  1622. func (c *CatalogsDeleteCall) Context(ctx context.Context) *CatalogsDeleteCall {
  1623. c.ctx_ = ctx
  1624. return c
  1625. }
  1626. // Header returns an http.Header that can be modified by the caller to
  1627. // add HTTP headers to the request.
  1628. func (c *CatalogsDeleteCall) Header() http.Header {
  1629. if c.header_ == nil {
  1630. c.header_ = make(http.Header)
  1631. }
  1632. return c.header_
  1633. }
  1634. func (c *CatalogsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1635. reqHeaders := make(http.Header)
  1636. for k, v := range c.header_ {
  1637. reqHeaders[k] = v
  1638. }
  1639. reqHeaders.Set("User-Agent", c.s.userAgent())
  1640. var body io.Reader = nil
  1641. c.urlParams_.Set("alt", alt)
  1642. c.urlParams_.Set("prettyPrint", "false")
  1643. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1644. urls += "?" + c.urlParams_.Encode()
  1645. req, err := http.NewRequest("DELETE", urls, body)
  1646. if err != nil {
  1647. return nil, err
  1648. }
  1649. req.Header = reqHeaders
  1650. googleapi.Expand(req.URL, map[string]string{
  1651. "name": c.name,
  1652. })
  1653. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1654. }
  1655. // Do executes the "cloudprivatecatalogproducer.catalogs.delete" call.
  1656. // Exactly one of *GoogleCloudPrivatecatalogproducerV1beta1Catalog or
  1657. // error will be non-nil. Any non-2xx status code is an error. Response
  1658. // headers are in either
  1659. // *GoogleCloudPrivatecatalogproducerV1beta1Catalog.ServerResponse.Header
  1660. // or (if a response was returned at all) in
  1661. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1662. // whether the returned error was because http.StatusNotModified was
  1663. // returned.
  1664. func (c *CatalogsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogproducerV1beta1Catalog, error) {
  1665. gensupport.SetOptions(c.urlParams_, opts...)
  1666. res, err := c.doRequest("json")
  1667. if res != nil && res.StatusCode == http.StatusNotModified {
  1668. if res.Body != nil {
  1669. res.Body.Close()
  1670. }
  1671. return nil, &googleapi.Error{
  1672. Code: res.StatusCode,
  1673. Header: res.Header,
  1674. }
  1675. }
  1676. if err != nil {
  1677. return nil, err
  1678. }
  1679. defer googleapi.CloseBody(res)
  1680. if err := googleapi.CheckResponse(res); err != nil {
  1681. return nil, err
  1682. }
  1683. ret := &GoogleCloudPrivatecatalogproducerV1beta1Catalog{
  1684. ServerResponse: googleapi.ServerResponse{
  1685. Header: res.Header,
  1686. HTTPStatusCode: res.StatusCode,
  1687. },
  1688. }
  1689. target := &ret
  1690. if err := gensupport.DecodeResponse(target, res); err != nil {
  1691. return nil, err
  1692. }
  1693. return ret, nil
  1694. // {
  1695. // "description": "Soft deletes an existing Catalog and all resources under it.\nThe catalog can only be deleted if there is no associations under it or\nDeleteCatalogRequest.force is true. The delete operation\ncan be recovered by the PrivateCatalogProducer.UndeleteCatalog\nmethod.",
  1696. // "flatPath": "v1beta1/catalogs/{catalogsId}",
  1697. // "httpMethod": "DELETE",
  1698. // "id": "cloudprivatecatalogproducer.catalogs.delete",
  1699. // "parameterOrder": [
  1700. // "name"
  1701. // ],
  1702. // "parameters": {
  1703. // "force": {
  1704. // "description": "Forces deletion of the `Catalog` and its `Association` resources.\nIf the `Catalog` is still associated with other resources and\nforce is not set to true, then the operation fails.",
  1705. // "location": "query",
  1706. // "type": "boolean"
  1707. // },
  1708. // "name": {
  1709. // "description": "The resource name of the catalog.",
  1710. // "location": "path",
  1711. // "pattern": "^catalogs/[^/]+$",
  1712. // "required": true,
  1713. // "type": "string"
  1714. // }
  1715. // },
  1716. // "path": "v1beta1/{+name}",
  1717. // "response": {
  1718. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Catalog"
  1719. // },
  1720. // "scopes": [
  1721. // "https://www.googleapis.com/auth/cloud-platform"
  1722. // ]
  1723. // }
  1724. }
  1725. // method id "cloudprivatecatalogproducer.catalogs.get":
  1726. type CatalogsGetCall struct {
  1727. s *Service
  1728. name string
  1729. urlParams_ gensupport.URLParams
  1730. ifNoneMatch_ string
  1731. ctx_ context.Context
  1732. header_ http.Header
  1733. }
  1734. // Get: Returns the requested Catalog resource.
  1735. func (r *CatalogsService) Get(name string) *CatalogsGetCall {
  1736. c := &CatalogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1737. c.name = name
  1738. return c
  1739. }
  1740. // Fields allows partial responses to be retrieved. See
  1741. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1742. // for more information.
  1743. func (c *CatalogsGetCall) Fields(s ...googleapi.Field) *CatalogsGetCall {
  1744. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1745. return c
  1746. }
  1747. // IfNoneMatch sets the optional parameter which makes the operation
  1748. // fail if the object's ETag matches the given value. This is useful for
  1749. // getting updates only after the object has changed since the last
  1750. // request. Use googleapi.IsNotModified to check whether the response
  1751. // error from Do is the result of In-None-Match.
  1752. func (c *CatalogsGetCall) IfNoneMatch(entityTag string) *CatalogsGetCall {
  1753. c.ifNoneMatch_ = entityTag
  1754. return c
  1755. }
  1756. // Context sets the context to be used in this call's Do method. Any
  1757. // pending HTTP request will be aborted if the provided context is
  1758. // canceled.
  1759. func (c *CatalogsGetCall) Context(ctx context.Context) *CatalogsGetCall {
  1760. c.ctx_ = ctx
  1761. return c
  1762. }
  1763. // Header returns an http.Header that can be modified by the caller to
  1764. // add HTTP headers to the request.
  1765. func (c *CatalogsGetCall) Header() http.Header {
  1766. if c.header_ == nil {
  1767. c.header_ = make(http.Header)
  1768. }
  1769. return c.header_
  1770. }
  1771. func (c *CatalogsGetCall) doRequest(alt string) (*http.Response, error) {
  1772. reqHeaders := make(http.Header)
  1773. for k, v := range c.header_ {
  1774. reqHeaders[k] = v
  1775. }
  1776. reqHeaders.Set("User-Agent", c.s.userAgent())
  1777. if c.ifNoneMatch_ != "" {
  1778. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1779. }
  1780. var body io.Reader = nil
  1781. c.urlParams_.Set("alt", alt)
  1782. c.urlParams_.Set("prettyPrint", "false")
  1783. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  1784. urls += "?" + c.urlParams_.Encode()
  1785. req, err := http.NewRequest("GET", urls, body)
  1786. if err != nil {
  1787. return nil, err
  1788. }
  1789. req.Header = reqHeaders
  1790. googleapi.Expand(req.URL, map[string]string{
  1791. "name": c.name,
  1792. })
  1793. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1794. }
  1795. // Do executes the "cloudprivatecatalogproducer.catalogs.get" call.
  1796. // Exactly one of *GoogleCloudPrivatecatalogproducerV1beta1Catalog or
  1797. // error will be non-nil. Any non-2xx status code is an error. Response
  1798. // headers are in either
  1799. // *GoogleCloudPrivatecatalogproducerV1beta1Catalog.ServerResponse.Header
  1800. // or (if a response was returned at all) in
  1801. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1802. // whether the returned error was because http.StatusNotModified was
  1803. // returned.
  1804. func (c *CatalogsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogproducerV1beta1Catalog, error) {
  1805. gensupport.SetOptions(c.urlParams_, opts...)
  1806. res, err := c.doRequest("json")
  1807. if res != nil && res.StatusCode == http.StatusNotModified {
  1808. if res.Body != nil {
  1809. res.Body.Close()
  1810. }
  1811. return nil, &googleapi.Error{
  1812. Code: res.StatusCode,
  1813. Header: res.Header,
  1814. }
  1815. }
  1816. if err != nil {
  1817. return nil, err
  1818. }
  1819. defer googleapi.CloseBody(res)
  1820. if err := googleapi.CheckResponse(res); err != nil {
  1821. return nil, err
  1822. }
  1823. ret := &GoogleCloudPrivatecatalogproducerV1beta1Catalog{
  1824. ServerResponse: googleapi.ServerResponse{
  1825. Header: res.Header,
  1826. HTTPStatusCode: res.StatusCode,
  1827. },
  1828. }
  1829. target := &ret
  1830. if err := gensupport.DecodeResponse(target, res); err != nil {
  1831. return nil, err
  1832. }
  1833. return ret, nil
  1834. // {
  1835. // "description": "Returns the requested Catalog resource.",
  1836. // "flatPath": "v1beta1/catalogs/{catalogsId}",
  1837. // "httpMethod": "GET",
  1838. // "id": "cloudprivatecatalogproducer.catalogs.get",
  1839. // "parameterOrder": [
  1840. // "name"
  1841. // ],
  1842. // "parameters": {
  1843. // "name": {
  1844. // "description": "The resource name of the catalog.",
  1845. // "location": "path",
  1846. // "pattern": "^catalogs/[^/]+$",
  1847. // "required": true,
  1848. // "type": "string"
  1849. // }
  1850. // },
  1851. // "path": "v1beta1/{+name}",
  1852. // "response": {
  1853. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Catalog"
  1854. // },
  1855. // "scopes": [
  1856. // "https://www.googleapis.com/auth/cloud-platform"
  1857. // ]
  1858. // }
  1859. }
  1860. // method id "cloudprivatecatalogproducer.catalogs.getIamPolicy":
  1861. type CatalogsGetIamPolicyCall struct {
  1862. s *Service
  1863. resource string
  1864. urlParams_ gensupport.URLParams
  1865. ifNoneMatch_ string
  1866. ctx_ context.Context
  1867. header_ http.Header
  1868. }
  1869. // GetIamPolicy: Gets IAM policy for the specified Catalog.
  1870. func (r *CatalogsService) GetIamPolicy(resource string) *CatalogsGetIamPolicyCall {
  1871. c := &CatalogsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1872. c.resource = resource
  1873. return c
  1874. }
  1875. // Fields allows partial responses to be retrieved. See
  1876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1877. // for more information.
  1878. func (c *CatalogsGetIamPolicyCall) Fields(s ...googleapi.Field) *CatalogsGetIamPolicyCall {
  1879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1880. return c
  1881. }
  1882. // IfNoneMatch sets the optional parameter which makes the operation
  1883. // fail if the object's ETag matches the given value. This is useful for
  1884. // getting updates only after the object has changed since the last
  1885. // request. Use googleapi.IsNotModified to check whether the response
  1886. // error from Do is the result of In-None-Match.
  1887. func (c *CatalogsGetIamPolicyCall) IfNoneMatch(entityTag string) *CatalogsGetIamPolicyCall {
  1888. c.ifNoneMatch_ = entityTag
  1889. return c
  1890. }
  1891. // Context sets the context to be used in this call's Do method. Any
  1892. // pending HTTP request will be aborted if the provided context is
  1893. // canceled.
  1894. func (c *CatalogsGetIamPolicyCall) Context(ctx context.Context) *CatalogsGetIamPolicyCall {
  1895. c.ctx_ = ctx
  1896. return c
  1897. }
  1898. // Header returns an http.Header that can be modified by the caller to
  1899. // add HTTP headers to the request.
  1900. func (c *CatalogsGetIamPolicyCall) Header() http.Header {
  1901. if c.header_ == nil {
  1902. c.header_ = make(http.Header)
  1903. }
  1904. return c.header_
  1905. }
  1906. func (c *CatalogsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  1907. reqHeaders := make(http.Header)
  1908. for k, v := range c.header_ {
  1909. reqHeaders[k] = v
  1910. }
  1911. reqHeaders.Set("User-Agent", c.s.userAgent())
  1912. if c.ifNoneMatch_ != "" {
  1913. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1914. }
  1915. var body io.Reader = nil
  1916. c.urlParams_.Set("alt", alt)
  1917. c.urlParams_.Set("prettyPrint", "false")
  1918. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:getIamPolicy")
  1919. urls += "?" + c.urlParams_.Encode()
  1920. req, err := http.NewRequest("GET", urls, body)
  1921. if err != nil {
  1922. return nil, err
  1923. }
  1924. req.Header = reqHeaders
  1925. googleapi.Expand(req.URL, map[string]string{
  1926. "resource": c.resource,
  1927. })
  1928. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1929. }
  1930. // Do executes the "cloudprivatecatalogproducer.catalogs.getIamPolicy" call.
  1931. // Exactly one of *GoogleIamV1Policy or error will be non-nil. Any
  1932. // non-2xx status code is an error. Response headers are in either
  1933. // *GoogleIamV1Policy.ServerResponse.Header or (if a response was
  1934. // returned at all) in error.(*googleapi.Error).Header. Use
  1935. // googleapi.IsNotModified to check whether the returned error was
  1936. // because http.StatusNotModified was returned.
  1937. func (c *CatalogsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*GoogleIamV1Policy, error) {
  1938. gensupport.SetOptions(c.urlParams_, opts...)
  1939. res, err := c.doRequest("json")
  1940. if res != nil && res.StatusCode == http.StatusNotModified {
  1941. if res.Body != nil {
  1942. res.Body.Close()
  1943. }
  1944. return nil, &googleapi.Error{
  1945. Code: res.StatusCode,
  1946. Header: res.Header,
  1947. }
  1948. }
  1949. if err != nil {
  1950. return nil, err
  1951. }
  1952. defer googleapi.CloseBody(res)
  1953. if err := googleapi.CheckResponse(res); err != nil {
  1954. return nil, err
  1955. }
  1956. ret := &GoogleIamV1Policy{
  1957. ServerResponse: googleapi.ServerResponse{
  1958. Header: res.Header,
  1959. HTTPStatusCode: res.StatusCode,
  1960. },
  1961. }
  1962. target := &ret
  1963. if err := gensupport.DecodeResponse(target, res); err != nil {
  1964. return nil, err
  1965. }
  1966. return ret, nil
  1967. // {
  1968. // "description": "Gets IAM policy for the specified Catalog.",
  1969. // "flatPath": "v1beta1/catalogs/{catalogsId}:getIamPolicy",
  1970. // "httpMethod": "GET",
  1971. // "id": "cloudprivatecatalogproducer.catalogs.getIamPolicy",
  1972. // "parameterOrder": [
  1973. // "resource"
  1974. // ],
  1975. // "parameters": {
  1976. // "resource": {
  1977. // "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.",
  1978. // "location": "path",
  1979. // "pattern": "^catalogs/[^/]+$",
  1980. // "required": true,
  1981. // "type": "string"
  1982. // }
  1983. // },
  1984. // "path": "v1beta1/{+resource}:getIamPolicy",
  1985. // "response": {
  1986. // "$ref": "GoogleIamV1Policy"
  1987. // },
  1988. // "scopes": [
  1989. // "https://www.googleapis.com/auth/cloud-platform"
  1990. // ]
  1991. // }
  1992. }
  1993. // method id "cloudprivatecatalogproducer.catalogs.list":
  1994. type CatalogsListCall struct {
  1995. s *Service
  1996. urlParams_ gensupport.URLParams
  1997. ifNoneMatch_ string
  1998. ctx_ context.Context
  1999. header_ http.Header
  2000. }
  2001. // List: Lists Catalog resources that the producer has access to, within
  2002. // the
  2003. // scope of the parent resource.
  2004. func (r *CatalogsService) List() *CatalogsListCall {
  2005. c := &CatalogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2006. return c
  2007. }
  2008. // PageSize sets the optional parameter "pageSize": The maximum number
  2009. // of catalogs to return.
  2010. func (c *CatalogsListCall) PageSize(pageSize int64) *CatalogsListCall {
  2011. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2012. return c
  2013. }
  2014. // PageToken sets the optional parameter "pageToken": A pagination token
  2015. // returned from a previous call to ListCatalogs
  2016. // that indicates where this listing should continue from.
  2017. // This field is optional.
  2018. func (c *CatalogsListCall) PageToken(pageToken string) *CatalogsListCall {
  2019. c.urlParams_.Set("pageToken", pageToken)
  2020. return c
  2021. }
  2022. // Parent sets the optional parameter "parent": The resource name of the
  2023. // parent resource.
  2024. func (c *CatalogsListCall) Parent(parent string) *CatalogsListCall {
  2025. c.urlParams_.Set("parent", parent)
  2026. return c
  2027. }
  2028. // Fields allows partial responses to be retrieved. See
  2029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2030. // for more information.
  2031. func (c *CatalogsListCall) Fields(s ...googleapi.Field) *CatalogsListCall {
  2032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2033. return c
  2034. }
  2035. // IfNoneMatch sets the optional parameter which makes the operation
  2036. // fail if the object's ETag matches the given value. This is useful for
  2037. // getting updates only after the object has changed since the last
  2038. // request. Use googleapi.IsNotModified to check whether the response
  2039. // error from Do is the result of In-None-Match.
  2040. func (c *CatalogsListCall) IfNoneMatch(entityTag string) *CatalogsListCall {
  2041. c.ifNoneMatch_ = entityTag
  2042. return c
  2043. }
  2044. // Context sets the context to be used in this call's Do method. Any
  2045. // pending HTTP request will be aborted if the provided context is
  2046. // canceled.
  2047. func (c *CatalogsListCall) Context(ctx context.Context) *CatalogsListCall {
  2048. c.ctx_ = ctx
  2049. return c
  2050. }
  2051. // Header returns an http.Header that can be modified by the caller to
  2052. // add HTTP headers to the request.
  2053. func (c *CatalogsListCall) Header() http.Header {
  2054. if c.header_ == nil {
  2055. c.header_ = make(http.Header)
  2056. }
  2057. return c.header_
  2058. }
  2059. func (c *CatalogsListCall) doRequest(alt string) (*http.Response, error) {
  2060. reqHeaders := make(http.Header)
  2061. for k, v := range c.header_ {
  2062. reqHeaders[k] = v
  2063. }
  2064. reqHeaders.Set("User-Agent", c.s.userAgent())
  2065. if c.ifNoneMatch_ != "" {
  2066. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2067. }
  2068. var body io.Reader = nil
  2069. c.urlParams_.Set("alt", alt)
  2070. c.urlParams_.Set("prettyPrint", "false")
  2071. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/catalogs")
  2072. urls += "?" + c.urlParams_.Encode()
  2073. req, err := http.NewRequest("GET", urls, body)
  2074. if err != nil {
  2075. return nil, err
  2076. }
  2077. req.Header = reqHeaders
  2078. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2079. }
  2080. // Do executes the "cloudprivatecatalogproducer.catalogs.list" call.
  2081. // Exactly one of
  2082. // *GoogleCloudPrivatecatalogproducerV1beta1ListCatalogsResponse or
  2083. // error will be non-nil. Any non-2xx status code is an error. Response
  2084. // headers are in either
  2085. // *GoogleCloudPrivatecatalogproducerV1beta1ListCatalogsResponse.ServerRe
  2086. // sponse.Header or (if a response was returned at all) in
  2087. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2088. // whether the returned error was because http.StatusNotModified was
  2089. // returned.
  2090. func (c *CatalogsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogproducerV1beta1ListCatalogsResponse, error) {
  2091. gensupport.SetOptions(c.urlParams_, opts...)
  2092. res, err := c.doRequest("json")
  2093. if res != nil && res.StatusCode == http.StatusNotModified {
  2094. if res.Body != nil {
  2095. res.Body.Close()
  2096. }
  2097. return nil, &googleapi.Error{
  2098. Code: res.StatusCode,
  2099. Header: res.Header,
  2100. }
  2101. }
  2102. if err != nil {
  2103. return nil, err
  2104. }
  2105. defer googleapi.CloseBody(res)
  2106. if err := googleapi.CheckResponse(res); err != nil {
  2107. return nil, err
  2108. }
  2109. ret := &GoogleCloudPrivatecatalogproducerV1beta1ListCatalogsResponse{
  2110. ServerResponse: googleapi.ServerResponse{
  2111. Header: res.Header,
  2112. HTTPStatusCode: res.StatusCode,
  2113. },
  2114. }
  2115. target := &ret
  2116. if err := gensupport.DecodeResponse(target, res); err != nil {
  2117. return nil, err
  2118. }
  2119. return ret, nil
  2120. // {
  2121. // "description": "Lists Catalog resources that the producer has access to, within the\nscope of the parent resource.",
  2122. // "flatPath": "v1beta1/catalogs",
  2123. // "httpMethod": "GET",
  2124. // "id": "cloudprivatecatalogproducer.catalogs.list",
  2125. // "parameterOrder": [],
  2126. // "parameters": {
  2127. // "pageSize": {
  2128. // "description": "The maximum number of catalogs to return.",
  2129. // "format": "int32",
  2130. // "location": "query",
  2131. // "type": "integer"
  2132. // },
  2133. // "pageToken": {
  2134. // "description": "A pagination token returned from a previous call to ListCatalogs\nthat indicates where this listing should continue from.\nThis field is optional.",
  2135. // "location": "query",
  2136. // "type": "string"
  2137. // },
  2138. // "parent": {
  2139. // "description": "The resource name of the parent resource.",
  2140. // "location": "query",
  2141. // "type": "string"
  2142. // }
  2143. // },
  2144. // "path": "v1beta1/catalogs",
  2145. // "response": {
  2146. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1ListCatalogsResponse"
  2147. // },
  2148. // "scopes": [
  2149. // "https://www.googleapis.com/auth/cloud-platform"
  2150. // ]
  2151. // }
  2152. }
  2153. // Pages invokes f for each page of results.
  2154. // A non-nil error returned from f will halt the iteration.
  2155. // The provided context supersedes any context provided to the Context method.
  2156. func (c *CatalogsListCall) Pages(ctx context.Context, f func(*GoogleCloudPrivatecatalogproducerV1beta1ListCatalogsResponse) error) error {
  2157. c.ctx_ = ctx
  2158. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2159. for {
  2160. x, err := c.Do()
  2161. if err != nil {
  2162. return err
  2163. }
  2164. if err := f(x); err != nil {
  2165. return err
  2166. }
  2167. if x.NextPageToken == "" {
  2168. return nil
  2169. }
  2170. c.PageToken(x.NextPageToken)
  2171. }
  2172. }
  2173. // method id "cloudprivatecatalogproducer.catalogs.patch":
  2174. type CatalogsPatchCall struct {
  2175. s *Service
  2176. nameid string
  2177. googlecloudprivatecatalogproducerv1beta1catalog *GoogleCloudPrivatecatalogproducerV1beta1Catalog
  2178. urlParams_ gensupport.URLParams
  2179. ctx_ context.Context
  2180. header_ http.Header
  2181. }
  2182. // Patch: Updates a specific Catalog resource.
  2183. func (r *CatalogsService) Patch(nameid string, googlecloudprivatecatalogproducerv1beta1catalog *GoogleCloudPrivatecatalogproducerV1beta1Catalog) *CatalogsPatchCall {
  2184. c := &CatalogsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2185. c.nameid = nameid
  2186. c.googlecloudprivatecatalogproducerv1beta1catalog = googlecloudprivatecatalogproducerv1beta1catalog
  2187. return c
  2188. }
  2189. // UpdateMask sets the optional parameter "updateMask": Field mask that
  2190. // controls which fields of the catalog should be updated.
  2191. func (c *CatalogsPatchCall) UpdateMask(updateMask string) *CatalogsPatchCall {
  2192. c.urlParams_.Set("updateMask", updateMask)
  2193. return c
  2194. }
  2195. // Fields allows partial responses to be retrieved. See
  2196. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2197. // for more information.
  2198. func (c *CatalogsPatchCall) Fields(s ...googleapi.Field) *CatalogsPatchCall {
  2199. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2200. return c
  2201. }
  2202. // Context sets the context to be used in this call's Do method. Any
  2203. // pending HTTP request will be aborted if the provided context is
  2204. // canceled.
  2205. func (c *CatalogsPatchCall) Context(ctx context.Context) *CatalogsPatchCall {
  2206. c.ctx_ = ctx
  2207. return c
  2208. }
  2209. // Header returns an http.Header that can be modified by the caller to
  2210. // add HTTP headers to the request.
  2211. func (c *CatalogsPatchCall) Header() http.Header {
  2212. if c.header_ == nil {
  2213. c.header_ = make(http.Header)
  2214. }
  2215. return c.header_
  2216. }
  2217. func (c *CatalogsPatchCall) doRequest(alt string) (*http.Response, error) {
  2218. reqHeaders := make(http.Header)
  2219. for k, v := range c.header_ {
  2220. reqHeaders[k] = v
  2221. }
  2222. reqHeaders.Set("User-Agent", c.s.userAgent())
  2223. var body io.Reader = nil
  2224. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudprivatecatalogproducerv1beta1catalog)
  2225. if err != nil {
  2226. return nil, err
  2227. }
  2228. reqHeaders.Set("Content-Type", "application/json")
  2229. c.urlParams_.Set("alt", alt)
  2230. c.urlParams_.Set("prettyPrint", "false")
  2231. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2232. urls += "?" + c.urlParams_.Encode()
  2233. req, err := http.NewRequest("PATCH", urls, body)
  2234. if err != nil {
  2235. return nil, err
  2236. }
  2237. req.Header = reqHeaders
  2238. googleapi.Expand(req.URL, map[string]string{
  2239. "name": c.nameid,
  2240. })
  2241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2242. }
  2243. // Do executes the "cloudprivatecatalogproducer.catalogs.patch" call.
  2244. // Exactly one of *GoogleCloudPrivatecatalogproducerV1beta1Catalog or
  2245. // error will be non-nil. Any non-2xx status code is an error. Response
  2246. // headers are in either
  2247. // *GoogleCloudPrivatecatalogproducerV1beta1Catalog.ServerResponse.Header
  2248. // or (if a response was returned at all) in
  2249. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2250. // whether the returned error was because http.StatusNotModified was
  2251. // returned.
  2252. func (c *CatalogsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogproducerV1beta1Catalog, error) {
  2253. gensupport.SetOptions(c.urlParams_, opts...)
  2254. res, err := c.doRequest("json")
  2255. if res != nil && res.StatusCode == http.StatusNotModified {
  2256. if res.Body != nil {
  2257. res.Body.Close()
  2258. }
  2259. return nil, &googleapi.Error{
  2260. Code: res.StatusCode,
  2261. Header: res.Header,
  2262. }
  2263. }
  2264. if err != nil {
  2265. return nil, err
  2266. }
  2267. defer googleapi.CloseBody(res)
  2268. if err := googleapi.CheckResponse(res); err != nil {
  2269. return nil, err
  2270. }
  2271. ret := &GoogleCloudPrivatecatalogproducerV1beta1Catalog{
  2272. ServerResponse: googleapi.ServerResponse{
  2273. Header: res.Header,
  2274. HTTPStatusCode: res.StatusCode,
  2275. },
  2276. }
  2277. target := &ret
  2278. if err := gensupport.DecodeResponse(target, res); err != nil {
  2279. return nil, err
  2280. }
  2281. return ret, nil
  2282. // {
  2283. // "description": "Updates a specific Catalog resource.",
  2284. // "flatPath": "v1beta1/catalogs/{catalogsId}",
  2285. // "httpMethod": "PATCH",
  2286. // "id": "cloudprivatecatalogproducer.catalogs.patch",
  2287. // "parameterOrder": [
  2288. // "name"
  2289. // ],
  2290. // "parameters": {
  2291. // "name": {
  2292. // "description": "Output only. The resource name of the catalog, in the format\n`catalogs/{catalog_id}'.\n\nA unique identifier for the catalog, which is generated\nby catalog service.",
  2293. // "location": "path",
  2294. // "pattern": "^catalogs/[^/]+$",
  2295. // "required": true,
  2296. // "type": "string"
  2297. // },
  2298. // "updateMask": {
  2299. // "description": "Field mask that controls which fields of the catalog should be updated.",
  2300. // "format": "google-fieldmask",
  2301. // "location": "query",
  2302. // "type": "string"
  2303. // }
  2304. // },
  2305. // "path": "v1beta1/{+name}",
  2306. // "request": {
  2307. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Catalog"
  2308. // },
  2309. // "response": {
  2310. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Catalog"
  2311. // },
  2312. // "scopes": [
  2313. // "https://www.googleapis.com/auth/cloud-platform"
  2314. // ]
  2315. // }
  2316. }
  2317. // method id "cloudprivatecatalogproducer.catalogs.setIamPolicy":
  2318. type CatalogsSetIamPolicyCall struct {
  2319. s *Service
  2320. resource string
  2321. googleiamv1setiampolicyrequest *GoogleIamV1SetIamPolicyRequest
  2322. urlParams_ gensupport.URLParams
  2323. ctx_ context.Context
  2324. header_ http.Header
  2325. }
  2326. // SetIamPolicy: Sets the IAM policy for the specified Catalog.
  2327. func (r *CatalogsService) SetIamPolicy(resource string, googleiamv1setiampolicyrequest *GoogleIamV1SetIamPolicyRequest) *CatalogsSetIamPolicyCall {
  2328. c := &CatalogsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2329. c.resource = resource
  2330. c.googleiamv1setiampolicyrequest = googleiamv1setiampolicyrequest
  2331. return c
  2332. }
  2333. // Fields allows partial responses to be retrieved. See
  2334. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2335. // for more information.
  2336. func (c *CatalogsSetIamPolicyCall) Fields(s ...googleapi.Field) *CatalogsSetIamPolicyCall {
  2337. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2338. return c
  2339. }
  2340. // Context sets the context to be used in this call's Do method. Any
  2341. // pending HTTP request will be aborted if the provided context is
  2342. // canceled.
  2343. func (c *CatalogsSetIamPolicyCall) Context(ctx context.Context) *CatalogsSetIamPolicyCall {
  2344. c.ctx_ = ctx
  2345. return c
  2346. }
  2347. // Header returns an http.Header that can be modified by the caller to
  2348. // add HTTP headers to the request.
  2349. func (c *CatalogsSetIamPolicyCall) Header() http.Header {
  2350. if c.header_ == nil {
  2351. c.header_ = make(http.Header)
  2352. }
  2353. return c.header_
  2354. }
  2355. func (c *CatalogsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2356. reqHeaders := make(http.Header)
  2357. for k, v := range c.header_ {
  2358. reqHeaders[k] = v
  2359. }
  2360. reqHeaders.Set("User-Agent", c.s.userAgent())
  2361. var body io.Reader = nil
  2362. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1setiampolicyrequest)
  2363. if err != nil {
  2364. return nil, err
  2365. }
  2366. reqHeaders.Set("Content-Type", "application/json")
  2367. c.urlParams_.Set("alt", alt)
  2368. c.urlParams_.Set("prettyPrint", "false")
  2369. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:setIamPolicy")
  2370. urls += "?" + c.urlParams_.Encode()
  2371. req, err := http.NewRequest("POST", urls, body)
  2372. if err != nil {
  2373. return nil, err
  2374. }
  2375. req.Header = reqHeaders
  2376. googleapi.Expand(req.URL, map[string]string{
  2377. "resource": c.resource,
  2378. })
  2379. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2380. }
  2381. // Do executes the "cloudprivatecatalogproducer.catalogs.setIamPolicy" call.
  2382. // Exactly one of *GoogleIamV1Policy or error will be non-nil. Any
  2383. // non-2xx status code is an error. Response headers are in either
  2384. // *GoogleIamV1Policy.ServerResponse.Header or (if a response was
  2385. // returned at all) in error.(*googleapi.Error).Header. Use
  2386. // googleapi.IsNotModified to check whether the returned error was
  2387. // because http.StatusNotModified was returned.
  2388. func (c *CatalogsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*GoogleIamV1Policy, error) {
  2389. gensupport.SetOptions(c.urlParams_, opts...)
  2390. res, err := c.doRequest("json")
  2391. if res != nil && res.StatusCode == http.StatusNotModified {
  2392. if res.Body != nil {
  2393. res.Body.Close()
  2394. }
  2395. return nil, &googleapi.Error{
  2396. Code: res.StatusCode,
  2397. Header: res.Header,
  2398. }
  2399. }
  2400. if err != nil {
  2401. return nil, err
  2402. }
  2403. defer googleapi.CloseBody(res)
  2404. if err := googleapi.CheckResponse(res); err != nil {
  2405. return nil, err
  2406. }
  2407. ret := &GoogleIamV1Policy{
  2408. ServerResponse: googleapi.ServerResponse{
  2409. Header: res.Header,
  2410. HTTPStatusCode: res.StatusCode,
  2411. },
  2412. }
  2413. target := &ret
  2414. if err := gensupport.DecodeResponse(target, res); err != nil {
  2415. return nil, err
  2416. }
  2417. return ret, nil
  2418. // {
  2419. // "description": "Sets the IAM policy for the specified Catalog.",
  2420. // "flatPath": "v1beta1/catalogs/{catalogsId}:setIamPolicy",
  2421. // "httpMethod": "POST",
  2422. // "id": "cloudprivatecatalogproducer.catalogs.setIamPolicy",
  2423. // "parameterOrder": [
  2424. // "resource"
  2425. // ],
  2426. // "parameters": {
  2427. // "resource": {
  2428. // "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.",
  2429. // "location": "path",
  2430. // "pattern": "^catalogs/[^/]+$",
  2431. // "required": true,
  2432. // "type": "string"
  2433. // }
  2434. // },
  2435. // "path": "v1beta1/{+resource}:setIamPolicy",
  2436. // "request": {
  2437. // "$ref": "GoogleIamV1SetIamPolicyRequest"
  2438. // },
  2439. // "response": {
  2440. // "$ref": "GoogleIamV1Policy"
  2441. // },
  2442. // "scopes": [
  2443. // "https://www.googleapis.com/auth/cloud-platform"
  2444. // ]
  2445. // }
  2446. }
  2447. // method id "cloudprivatecatalogproducer.catalogs.testIamPermissions":
  2448. type CatalogsTestIamPermissionsCall struct {
  2449. s *Service
  2450. resource string
  2451. googleiamv1testiampermissionsrequest *GoogleIamV1TestIamPermissionsRequest
  2452. urlParams_ gensupport.URLParams
  2453. ctx_ context.Context
  2454. header_ http.Header
  2455. }
  2456. // TestIamPermissions: Tests the IAM permissions for the specified
  2457. // Catalog.
  2458. func (r *CatalogsService) TestIamPermissions(resource string, googleiamv1testiampermissionsrequest *GoogleIamV1TestIamPermissionsRequest) *CatalogsTestIamPermissionsCall {
  2459. c := &CatalogsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2460. c.resource = resource
  2461. c.googleiamv1testiampermissionsrequest = googleiamv1testiampermissionsrequest
  2462. return c
  2463. }
  2464. // Fields allows partial responses to be retrieved. See
  2465. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2466. // for more information.
  2467. func (c *CatalogsTestIamPermissionsCall) Fields(s ...googleapi.Field) *CatalogsTestIamPermissionsCall {
  2468. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2469. return c
  2470. }
  2471. // Context sets the context to be used in this call's Do method. Any
  2472. // pending HTTP request will be aborted if the provided context is
  2473. // canceled.
  2474. func (c *CatalogsTestIamPermissionsCall) Context(ctx context.Context) *CatalogsTestIamPermissionsCall {
  2475. c.ctx_ = ctx
  2476. return c
  2477. }
  2478. // Header returns an http.Header that can be modified by the caller to
  2479. // add HTTP headers to the request.
  2480. func (c *CatalogsTestIamPermissionsCall) Header() http.Header {
  2481. if c.header_ == nil {
  2482. c.header_ = make(http.Header)
  2483. }
  2484. return c.header_
  2485. }
  2486. func (c *CatalogsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  2487. reqHeaders := make(http.Header)
  2488. for k, v := range c.header_ {
  2489. reqHeaders[k] = v
  2490. }
  2491. reqHeaders.Set("User-Agent", c.s.userAgent())
  2492. var body io.Reader = nil
  2493. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1testiampermissionsrequest)
  2494. if err != nil {
  2495. return nil, err
  2496. }
  2497. reqHeaders.Set("Content-Type", "application/json")
  2498. c.urlParams_.Set("alt", alt)
  2499. c.urlParams_.Set("prettyPrint", "false")
  2500. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+resource}:testIamPermissions")
  2501. urls += "?" + c.urlParams_.Encode()
  2502. req, err := http.NewRequest("POST", urls, body)
  2503. if err != nil {
  2504. return nil, err
  2505. }
  2506. req.Header = reqHeaders
  2507. googleapi.Expand(req.URL, map[string]string{
  2508. "resource": c.resource,
  2509. })
  2510. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2511. }
  2512. // Do executes the "cloudprivatecatalogproducer.catalogs.testIamPermissions" call.
  2513. // Exactly one of *GoogleIamV1TestIamPermissionsResponse or error will
  2514. // be non-nil. Any non-2xx status code is an error. Response headers are
  2515. // in either
  2516. // *GoogleIamV1TestIamPermissionsResponse.ServerResponse.Header or (if a
  2517. // response was returned at all) in error.(*googleapi.Error).Header. Use
  2518. // googleapi.IsNotModified to check whether the returned error was
  2519. // because http.StatusNotModified was returned.
  2520. func (c *CatalogsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*GoogleIamV1TestIamPermissionsResponse, error) {
  2521. gensupport.SetOptions(c.urlParams_, opts...)
  2522. res, err := c.doRequest("json")
  2523. if res != nil && res.StatusCode == http.StatusNotModified {
  2524. if res.Body != nil {
  2525. res.Body.Close()
  2526. }
  2527. return nil, &googleapi.Error{
  2528. Code: res.StatusCode,
  2529. Header: res.Header,
  2530. }
  2531. }
  2532. if err != nil {
  2533. return nil, err
  2534. }
  2535. defer googleapi.CloseBody(res)
  2536. if err := googleapi.CheckResponse(res); err != nil {
  2537. return nil, err
  2538. }
  2539. ret := &GoogleIamV1TestIamPermissionsResponse{
  2540. ServerResponse: googleapi.ServerResponse{
  2541. Header: res.Header,
  2542. HTTPStatusCode: res.StatusCode,
  2543. },
  2544. }
  2545. target := &ret
  2546. if err := gensupport.DecodeResponse(target, res); err != nil {
  2547. return nil, err
  2548. }
  2549. return ret, nil
  2550. // {
  2551. // "description": "Tests the IAM permissions for the specified Catalog.",
  2552. // "flatPath": "v1beta1/catalogs/{catalogsId}:testIamPermissions",
  2553. // "httpMethod": "POST",
  2554. // "id": "cloudprivatecatalogproducer.catalogs.testIamPermissions",
  2555. // "parameterOrder": [
  2556. // "resource"
  2557. // ],
  2558. // "parameters": {
  2559. // "resource": {
  2560. // "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
  2561. // "location": "path",
  2562. // "pattern": "^catalogs/[^/]+$",
  2563. // "required": true,
  2564. // "type": "string"
  2565. // }
  2566. // },
  2567. // "path": "v1beta1/{+resource}:testIamPermissions",
  2568. // "request": {
  2569. // "$ref": "GoogleIamV1TestIamPermissionsRequest"
  2570. // },
  2571. // "response": {
  2572. // "$ref": "GoogleIamV1TestIamPermissionsResponse"
  2573. // },
  2574. // "scopes": [
  2575. // "https://www.googleapis.com/auth/cloud-platform"
  2576. // ]
  2577. // }
  2578. }
  2579. // method id "cloudprivatecatalogproducer.catalogs.undelete":
  2580. type CatalogsUndeleteCall struct {
  2581. s *Service
  2582. name string
  2583. googlecloudprivatecatalogproducerv1beta1undeletecatalogrequest *GoogleCloudPrivatecatalogproducerV1beta1UndeleteCatalogRequest
  2584. urlParams_ gensupport.URLParams
  2585. ctx_ context.Context
  2586. header_ http.Header
  2587. }
  2588. // Undelete: Undeletes a deleted Catalog and all resources under it.
  2589. func (r *CatalogsService) Undelete(name string, googlecloudprivatecatalogproducerv1beta1undeletecatalogrequest *GoogleCloudPrivatecatalogproducerV1beta1UndeleteCatalogRequest) *CatalogsUndeleteCall {
  2590. c := &CatalogsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2591. c.name = name
  2592. c.googlecloudprivatecatalogproducerv1beta1undeletecatalogrequest = googlecloudprivatecatalogproducerv1beta1undeletecatalogrequest
  2593. return c
  2594. }
  2595. // Fields allows partial responses to be retrieved. See
  2596. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2597. // for more information.
  2598. func (c *CatalogsUndeleteCall) Fields(s ...googleapi.Field) *CatalogsUndeleteCall {
  2599. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2600. return c
  2601. }
  2602. // Context sets the context to be used in this call's Do method. Any
  2603. // pending HTTP request will be aborted if the provided context is
  2604. // canceled.
  2605. func (c *CatalogsUndeleteCall) Context(ctx context.Context) *CatalogsUndeleteCall {
  2606. c.ctx_ = ctx
  2607. return c
  2608. }
  2609. // Header returns an http.Header that can be modified by the caller to
  2610. // add HTTP headers to the request.
  2611. func (c *CatalogsUndeleteCall) Header() http.Header {
  2612. if c.header_ == nil {
  2613. c.header_ = make(http.Header)
  2614. }
  2615. return c.header_
  2616. }
  2617. func (c *CatalogsUndeleteCall) doRequest(alt string) (*http.Response, error) {
  2618. reqHeaders := make(http.Header)
  2619. for k, v := range c.header_ {
  2620. reqHeaders[k] = v
  2621. }
  2622. reqHeaders.Set("User-Agent", c.s.userAgent())
  2623. var body io.Reader = nil
  2624. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudprivatecatalogproducerv1beta1undeletecatalogrequest)
  2625. if err != nil {
  2626. return nil, err
  2627. }
  2628. reqHeaders.Set("Content-Type", "application/json")
  2629. c.urlParams_.Set("alt", alt)
  2630. c.urlParams_.Set("prettyPrint", "false")
  2631. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:undelete")
  2632. urls += "?" + c.urlParams_.Encode()
  2633. req, err := http.NewRequest("POST", urls, body)
  2634. if err != nil {
  2635. return nil, err
  2636. }
  2637. req.Header = reqHeaders
  2638. googleapi.Expand(req.URL, map[string]string{
  2639. "name": c.name,
  2640. })
  2641. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2642. }
  2643. // Do executes the "cloudprivatecatalogproducer.catalogs.undelete" call.
  2644. // Exactly one of *GoogleCloudPrivatecatalogproducerV1beta1Catalog or
  2645. // error will be non-nil. Any non-2xx status code is an error. Response
  2646. // headers are in either
  2647. // *GoogleCloudPrivatecatalogproducerV1beta1Catalog.ServerResponse.Header
  2648. // or (if a response was returned at all) in
  2649. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2650. // whether the returned error was because http.StatusNotModified was
  2651. // returned.
  2652. func (c *CatalogsUndeleteCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogproducerV1beta1Catalog, error) {
  2653. gensupport.SetOptions(c.urlParams_, opts...)
  2654. res, err := c.doRequest("json")
  2655. if res != nil && res.StatusCode == http.StatusNotModified {
  2656. if res.Body != nil {
  2657. res.Body.Close()
  2658. }
  2659. return nil, &googleapi.Error{
  2660. Code: res.StatusCode,
  2661. Header: res.Header,
  2662. }
  2663. }
  2664. if err != nil {
  2665. return nil, err
  2666. }
  2667. defer googleapi.CloseBody(res)
  2668. if err := googleapi.CheckResponse(res); err != nil {
  2669. return nil, err
  2670. }
  2671. ret := &GoogleCloudPrivatecatalogproducerV1beta1Catalog{
  2672. ServerResponse: googleapi.ServerResponse{
  2673. Header: res.Header,
  2674. HTTPStatusCode: res.StatusCode,
  2675. },
  2676. }
  2677. target := &ret
  2678. if err := gensupport.DecodeResponse(target, res); err != nil {
  2679. return nil, err
  2680. }
  2681. return ret, nil
  2682. // {
  2683. // "description": "Undeletes a deleted Catalog and all resources under it.",
  2684. // "flatPath": "v1beta1/catalogs/{catalogsId}:undelete",
  2685. // "httpMethod": "POST",
  2686. // "id": "cloudprivatecatalogproducer.catalogs.undelete",
  2687. // "parameterOrder": [
  2688. // "name"
  2689. // ],
  2690. // "parameters": {
  2691. // "name": {
  2692. // "description": "The resource name of the catalog.",
  2693. // "location": "path",
  2694. // "pattern": "^catalogs/[^/]+$",
  2695. // "required": true,
  2696. // "type": "string"
  2697. // }
  2698. // },
  2699. // "path": "v1beta1/{+name}:undelete",
  2700. // "request": {
  2701. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1UndeleteCatalogRequest"
  2702. // },
  2703. // "response": {
  2704. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Catalog"
  2705. // },
  2706. // "scopes": [
  2707. // "https://www.googleapis.com/auth/cloud-platform"
  2708. // ]
  2709. // }
  2710. }
  2711. // method id "cloudprivatecatalogproducer.catalogs.associations.create":
  2712. type CatalogsAssociationsCreateCall struct {
  2713. s *Service
  2714. parent string
  2715. googlecloudprivatecatalogproducerv1beta1createassociationrequest *GoogleCloudPrivatecatalogproducerV1beta1CreateAssociationRequest
  2716. urlParams_ gensupport.URLParams
  2717. ctx_ context.Context
  2718. header_ http.Header
  2719. }
  2720. // Create: Creates an Association instance under a given Catalog.
  2721. func (r *CatalogsAssociationsService) Create(parent string, googlecloudprivatecatalogproducerv1beta1createassociationrequest *GoogleCloudPrivatecatalogproducerV1beta1CreateAssociationRequest) *CatalogsAssociationsCreateCall {
  2722. c := &CatalogsAssociationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2723. c.parent = parent
  2724. c.googlecloudprivatecatalogproducerv1beta1createassociationrequest = googlecloudprivatecatalogproducerv1beta1createassociationrequest
  2725. return c
  2726. }
  2727. // Fields allows partial responses to be retrieved. See
  2728. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2729. // for more information.
  2730. func (c *CatalogsAssociationsCreateCall) Fields(s ...googleapi.Field) *CatalogsAssociationsCreateCall {
  2731. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2732. return c
  2733. }
  2734. // Context sets the context to be used in this call's Do method. Any
  2735. // pending HTTP request will be aborted if the provided context is
  2736. // canceled.
  2737. func (c *CatalogsAssociationsCreateCall) Context(ctx context.Context) *CatalogsAssociationsCreateCall {
  2738. c.ctx_ = ctx
  2739. return c
  2740. }
  2741. // Header returns an http.Header that can be modified by the caller to
  2742. // add HTTP headers to the request.
  2743. func (c *CatalogsAssociationsCreateCall) Header() http.Header {
  2744. if c.header_ == nil {
  2745. c.header_ = make(http.Header)
  2746. }
  2747. return c.header_
  2748. }
  2749. func (c *CatalogsAssociationsCreateCall) doRequest(alt string) (*http.Response, error) {
  2750. reqHeaders := make(http.Header)
  2751. for k, v := range c.header_ {
  2752. reqHeaders[k] = v
  2753. }
  2754. reqHeaders.Set("User-Agent", c.s.userAgent())
  2755. var body io.Reader = nil
  2756. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudprivatecatalogproducerv1beta1createassociationrequest)
  2757. if err != nil {
  2758. return nil, err
  2759. }
  2760. reqHeaders.Set("Content-Type", "application/json")
  2761. c.urlParams_.Set("alt", alt)
  2762. c.urlParams_.Set("prettyPrint", "false")
  2763. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/associations")
  2764. urls += "?" + c.urlParams_.Encode()
  2765. req, err := http.NewRequest("POST", urls, body)
  2766. if err != nil {
  2767. return nil, err
  2768. }
  2769. req.Header = reqHeaders
  2770. googleapi.Expand(req.URL, map[string]string{
  2771. "parent": c.parent,
  2772. })
  2773. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2774. }
  2775. // Do executes the "cloudprivatecatalogproducer.catalogs.associations.create" call.
  2776. // Exactly one of *GoogleCloudPrivatecatalogproducerV1beta1Association
  2777. // or error will be non-nil. Any non-2xx status code is an error.
  2778. // Response headers are in either
  2779. // *GoogleCloudPrivatecatalogproducerV1beta1Association.ServerResponse.He
  2780. // ader or (if a response was returned at all) in
  2781. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2782. // whether the returned error was because http.StatusNotModified was
  2783. // returned.
  2784. func (c *CatalogsAssociationsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogproducerV1beta1Association, error) {
  2785. gensupport.SetOptions(c.urlParams_, opts...)
  2786. res, err := c.doRequest("json")
  2787. if res != nil && res.StatusCode == http.StatusNotModified {
  2788. if res.Body != nil {
  2789. res.Body.Close()
  2790. }
  2791. return nil, &googleapi.Error{
  2792. Code: res.StatusCode,
  2793. Header: res.Header,
  2794. }
  2795. }
  2796. if err != nil {
  2797. return nil, err
  2798. }
  2799. defer googleapi.CloseBody(res)
  2800. if err := googleapi.CheckResponse(res); err != nil {
  2801. return nil, err
  2802. }
  2803. ret := &GoogleCloudPrivatecatalogproducerV1beta1Association{
  2804. ServerResponse: googleapi.ServerResponse{
  2805. Header: res.Header,
  2806. HTTPStatusCode: res.StatusCode,
  2807. },
  2808. }
  2809. target := &ret
  2810. if err := gensupport.DecodeResponse(target, res); err != nil {
  2811. return nil, err
  2812. }
  2813. return ret, nil
  2814. // {
  2815. // "description": "Creates an Association instance under a given Catalog.",
  2816. // "flatPath": "v1beta1/catalogs/{catalogsId}/associations",
  2817. // "httpMethod": "POST",
  2818. // "id": "cloudprivatecatalogproducer.catalogs.associations.create",
  2819. // "parameterOrder": [
  2820. // "parent"
  2821. // ],
  2822. // "parameters": {
  2823. // "parent": {
  2824. // "description": "The `Catalog` resource's name.",
  2825. // "location": "path",
  2826. // "pattern": "^catalogs/[^/]+$",
  2827. // "required": true,
  2828. // "type": "string"
  2829. // }
  2830. // },
  2831. // "path": "v1beta1/{+parent}/associations",
  2832. // "request": {
  2833. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1CreateAssociationRequest"
  2834. // },
  2835. // "response": {
  2836. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Association"
  2837. // },
  2838. // "scopes": [
  2839. // "https://www.googleapis.com/auth/cloud-platform"
  2840. // ]
  2841. // }
  2842. }
  2843. // method id "cloudprivatecatalogproducer.catalogs.associations.delete":
  2844. type CatalogsAssociationsDeleteCall struct {
  2845. s *Service
  2846. name string
  2847. urlParams_ gensupport.URLParams
  2848. ctx_ context.Context
  2849. header_ http.Header
  2850. }
  2851. // Delete: Deletes the given Association.
  2852. func (r *CatalogsAssociationsService) Delete(name string) *CatalogsAssociationsDeleteCall {
  2853. c := &CatalogsAssociationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2854. c.name = name
  2855. return c
  2856. }
  2857. // Fields allows partial responses to be retrieved. See
  2858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2859. // for more information.
  2860. func (c *CatalogsAssociationsDeleteCall) Fields(s ...googleapi.Field) *CatalogsAssociationsDeleteCall {
  2861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2862. return c
  2863. }
  2864. // Context sets the context to be used in this call's Do method. Any
  2865. // pending HTTP request will be aborted if the provided context is
  2866. // canceled.
  2867. func (c *CatalogsAssociationsDeleteCall) Context(ctx context.Context) *CatalogsAssociationsDeleteCall {
  2868. c.ctx_ = ctx
  2869. return c
  2870. }
  2871. // Header returns an http.Header that can be modified by the caller to
  2872. // add HTTP headers to the request.
  2873. func (c *CatalogsAssociationsDeleteCall) Header() http.Header {
  2874. if c.header_ == nil {
  2875. c.header_ = make(http.Header)
  2876. }
  2877. return c.header_
  2878. }
  2879. func (c *CatalogsAssociationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2880. reqHeaders := make(http.Header)
  2881. for k, v := range c.header_ {
  2882. reqHeaders[k] = v
  2883. }
  2884. reqHeaders.Set("User-Agent", c.s.userAgent())
  2885. var body io.Reader = nil
  2886. c.urlParams_.Set("alt", alt)
  2887. c.urlParams_.Set("prettyPrint", "false")
  2888. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  2889. urls += "?" + c.urlParams_.Encode()
  2890. req, err := http.NewRequest("DELETE", urls, body)
  2891. if err != nil {
  2892. return nil, err
  2893. }
  2894. req.Header = reqHeaders
  2895. googleapi.Expand(req.URL, map[string]string{
  2896. "name": c.name,
  2897. })
  2898. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2899. }
  2900. // Do executes the "cloudprivatecatalogproducer.catalogs.associations.delete" call.
  2901. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  2902. // non-2xx status code is an error. Response headers are in either
  2903. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  2904. // returned at all) in error.(*googleapi.Error).Header. Use
  2905. // googleapi.IsNotModified to check whether the returned error was
  2906. // because http.StatusNotModified was returned.
  2907. func (c *CatalogsAssociationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  2908. gensupport.SetOptions(c.urlParams_, opts...)
  2909. res, err := c.doRequest("json")
  2910. if res != nil && res.StatusCode == http.StatusNotModified {
  2911. if res.Body != nil {
  2912. res.Body.Close()
  2913. }
  2914. return nil, &googleapi.Error{
  2915. Code: res.StatusCode,
  2916. Header: res.Header,
  2917. }
  2918. }
  2919. if err != nil {
  2920. return nil, err
  2921. }
  2922. defer googleapi.CloseBody(res)
  2923. if err := googleapi.CheckResponse(res); err != nil {
  2924. return nil, err
  2925. }
  2926. ret := &GoogleProtobufEmpty{
  2927. ServerResponse: googleapi.ServerResponse{
  2928. Header: res.Header,
  2929. HTTPStatusCode: res.StatusCode,
  2930. },
  2931. }
  2932. target := &ret
  2933. if err := gensupport.DecodeResponse(target, res); err != nil {
  2934. return nil, err
  2935. }
  2936. return ret, nil
  2937. // {
  2938. // "description": "Deletes the given Association.",
  2939. // "flatPath": "v1beta1/catalogs/{catalogsId}/associations/{associationsId}",
  2940. // "httpMethod": "DELETE",
  2941. // "id": "cloudprivatecatalogproducer.catalogs.associations.delete",
  2942. // "parameterOrder": [
  2943. // "name"
  2944. // ],
  2945. // "parameters": {
  2946. // "name": {
  2947. // "description": "The resource name of the `Association` to delete.",
  2948. // "location": "path",
  2949. // "pattern": "^catalogs/[^/]+/associations/[^/]+$",
  2950. // "required": true,
  2951. // "type": "string"
  2952. // }
  2953. // },
  2954. // "path": "v1beta1/{+name}",
  2955. // "response": {
  2956. // "$ref": "GoogleProtobufEmpty"
  2957. // },
  2958. // "scopes": [
  2959. // "https://www.googleapis.com/auth/cloud-platform"
  2960. // ]
  2961. // }
  2962. }
  2963. // method id "cloudprivatecatalogproducer.catalogs.associations.get":
  2964. type CatalogsAssociationsGetCall struct {
  2965. s *Service
  2966. name string
  2967. urlParams_ gensupport.URLParams
  2968. ifNoneMatch_ string
  2969. ctx_ context.Context
  2970. header_ http.Header
  2971. }
  2972. // Get: Returns the requested Association resource.
  2973. func (r *CatalogsAssociationsService) Get(name string) *CatalogsAssociationsGetCall {
  2974. c := &CatalogsAssociationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2975. c.name = name
  2976. return c
  2977. }
  2978. // Fields allows partial responses to be retrieved. See
  2979. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2980. // for more information.
  2981. func (c *CatalogsAssociationsGetCall) Fields(s ...googleapi.Field) *CatalogsAssociationsGetCall {
  2982. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2983. return c
  2984. }
  2985. // IfNoneMatch sets the optional parameter which makes the operation
  2986. // fail if the object's ETag matches the given value. This is useful for
  2987. // getting updates only after the object has changed since the last
  2988. // request. Use googleapi.IsNotModified to check whether the response
  2989. // error from Do is the result of In-None-Match.
  2990. func (c *CatalogsAssociationsGetCall) IfNoneMatch(entityTag string) *CatalogsAssociationsGetCall {
  2991. c.ifNoneMatch_ = entityTag
  2992. return c
  2993. }
  2994. // Context sets the context to be used in this call's Do method. Any
  2995. // pending HTTP request will be aborted if the provided context is
  2996. // canceled.
  2997. func (c *CatalogsAssociationsGetCall) Context(ctx context.Context) *CatalogsAssociationsGetCall {
  2998. c.ctx_ = ctx
  2999. return c
  3000. }
  3001. // Header returns an http.Header that can be modified by the caller to
  3002. // add HTTP headers to the request.
  3003. func (c *CatalogsAssociationsGetCall) Header() http.Header {
  3004. if c.header_ == nil {
  3005. c.header_ = make(http.Header)
  3006. }
  3007. return c.header_
  3008. }
  3009. func (c *CatalogsAssociationsGetCall) doRequest(alt string) (*http.Response, error) {
  3010. reqHeaders := make(http.Header)
  3011. for k, v := range c.header_ {
  3012. reqHeaders[k] = v
  3013. }
  3014. reqHeaders.Set("User-Agent", c.s.userAgent())
  3015. if c.ifNoneMatch_ != "" {
  3016. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3017. }
  3018. var body io.Reader = nil
  3019. c.urlParams_.Set("alt", alt)
  3020. c.urlParams_.Set("prettyPrint", "false")
  3021. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3022. urls += "?" + c.urlParams_.Encode()
  3023. req, err := http.NewRequest("GET", urls, body)
  3024. if err != nil {
  3025. return nil, err
  3026. }
  3027. req.Header = reqHeaders
  3028. googleapi.Expand(req.URL, map[string]string{
  3029. "name": c.name,
  3030. })
  3031. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3032. }
  3033. // Do executes the "cloudprivatecatalogproducer.catalogs.associations.get" call.
  3034. // Exactly one of *GoogleCloudPrivatecatalogproducerV1beta1Association
  3035. // or error will be non-nil. Any non-2xx status code is an error.
  3036. // Response headers are in either
  3037. // *GoogleCloudPrivatecatalogproducerV1beta1Association.ServerResponse.He
  3038. // ader or (if a response was returned at all) in
  3039. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3040. // whether the returned error was because http.StatusNotModified was
  3041. // returned.
  3042. func (c *CatalogsAssociationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogproducerV1beta1Association, error) {
  3043. gensupport.SetOptions(c.urlParams_, opts...)
  3044. res, err := c.doRequest("json")
  3045. if res != nil && res.StatusCode == http.StatusNotModified {
  3046. if res.Body != nil {
  3047. res.Body.Close()
  3048. }
  3049. return nil, &googleapi.Error{
  3050. Code: res.StatusCode,
  3051. Header: res.Header,
  3052. }
  3053. }
  3054. if err != nil {
  3055. return nil, err
  3056. }
  3057. defer googleapi.CloseBody(res)
  3058. if err := googleapi.CheckResponse(res); err != nil {
  3059. return nil, err
  3060. }
  3061. ret := &GoogleCloudPrivatecatalogproducerV1beta1Association{
  3062. ServerResponse: googleapi.ServerResponse{
  3063. Header: res.Header,
  3064. HTTPStatusCode: res.StatusCode,
  3065. },
  3066. }
  3067. target := &ret
  3068. if err := gensupport.DecodeResponse(target, res); err != nil {
  3069. return nil, err
  3070. }
  3071. return ret, nil
  3072. // {
  3073. // "description": "Returns the requested Association resource.",
  3074. // "flatPath": "v1beta1/catalogs/{catalogsId}/associations/{associationsId}",
  3075. // "httpMethod": "GET",
  3076. // "id": "cloudprivatecatalogproducer.catalogs.associations.get",
  3077. // "parameterOrder": [
  3078. // "name"
  3079. // ],
  3080. // "parameters": {
  3081. // "name": {
  3082. // "description": "The resource name of the `Association` to retrieve.",
  3083. // "location": "path",
  3084. // "pattern": "^catalogs/[^/]+/associations/[^/]+$",
  3085. // "required": true,
  3086. // "type": "string"
  3087. // }
  3088. // },
  3089. // "path": "v1beta1/{+name}",
  3090. // "response": {
  3091. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Association"
  3092. // },
  3093. // "scopes": [
  3094. // "https://www.googleapis.com/auth/cloud-platform"
  3095. // ]
  3096. // }
  3097. }
  3098. // method id "cloudprivatecatalogproducer.catalogs.associations.list":
  3099. type CatalogsAssociationsListCall struct {
  3100. s *Service
  3101. parent string
  3102. urlParams_ gensupport.URLParams
  3103. ifNoneMatch_ string
  3104. ctx_ context.Context
  3105. header_ http.Header
  3106. }
  3107. // List: Lists all Association resources under a catalog.
  3108. func (r *CatalogsAssociationsService) List(parent string) *CatalogsAssociationsListCall {
  3109. c := &CatalogsAssociationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3110. c.parent = parent
  3111. return c
  3112. }
  3113. // PageSize sets the optional parameter "pageSize": The maximum number
  3114. // of catalog associations to return.
  3115. func (c *CatalogsAssociationsListCall) PageSize(pageSize int64) *CatalogsAssociationsListCall {
  3116. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3117. return c
  3118. }
  3119. // PageToken sets the optional parameter "pageToken": A pagination token
  3120. // returned from the previous call to
  3121. // `ListAssociations`.
  3122. func (c *CatalogsAssociationsListCall) PageToken(pageToken string) *CatalogsAssociationsListCall {
  3123. c.urlParams_.Set("pageToken", pageToken)
  3124. return c
  3125. }
  3126. // Fields allows partial responses to be retrieved. See
  3127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3128. // for more information.
  3129. func (c *CatalogsAssociationsListCall) Fields(s ...googleapi.Field) *CatalogsAssociationsListCall {
  3130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3131. return c
  3132. }
  3133. // IfNoneMatch sets the optional parameter which makes the operation
  3134. // fail if the object's ETag matches the given value. This is useful for
  3135. // getting updates only after the object has changed since the last
  3136. // request. Use googleapi.IsNotModified to check whether the response
  3137. // error from Do is the result of In-None-Match.
  3138. func (c *CatalogsAssociationsListCall) IfNoneMatch(entityTag string) *CatalogsAssociationsListCall {
  3139. c.ifNoneMatch_ = entityTag
  3140. return c
  3141. }
  3142. // Context sets the context to be used in this call's Do method. Any
  3143. // pending HTTP request will be aborted if the provided context is
  3144. // canceled.
  3145. func (c *CatalogsAssociationsListCall) Context(ctx context.Context) *CatalogsAssociationsListCall {
  3146. c.ctx_ = ctx
  3147. return c
  3148. }
  3149. // Header returns an http.Header that can be modified by the caller to
  3150. // add HTTP headers to the request.
  3151. func (c *CatalogsAssociationsListCall) Header() http.Header {
  3152. if c.header_ == nil {
  3153. c.header_ = make(http.Header)
  3154. }
  3155. return c.header_
  3156. }
  3157. func (c *CatalogsAssociationsListCall) doRequest(alt string) (*http.Response, error) {
  3158. reqHeaders := make(http.Header)
  3159. for k, v := range c.header_ {
  3160. reqHeaders[k] = v
  3161. }
  3162. reqHeaders.Set("User-Agent", c.s.userAgent())
  3163. if c.ifNoneMatch_ != "" {
  3164. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3165. }
  3166. var body io.Reader = nil
  3167. c.urlParams_.Set("alt", alt)
  3168. c.urlParams_.Set("prettyPrint", "false")
  3169. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/associations")
  3170. urls += "?" + c.urlParams_.Encode()
  3171. req, err := http.NewRequest("GET", urls, body)
  3172. if err != nil {
  3173. return nil, err
  3174. }
  3175. req.Header = reqHeaders
  3176. googleapi.Expand(req.URL, map[string]string{
  3177. "parent": c.parent,
  3178. })
  3179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3180. }
  3181. // Do executes the "cloudprivatecatalogproducer.catalogs.associations.list" call.
  3182. // Exactly one of
  3183. // *GoogleCloudPrivatecatalogproducerV1beta1ListAssociationsResponse or
  3184. // error will be non-nil. Any non-2xx status code is an error. Response
  3185. // headers are in either
  3186. // *GoogleCloudPrivatecatalogproducerV1beta1ListAssociationsResponse.Serv
  3187. // erResponse.Header or (if a response was returned at all) in
  3188. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3189. // whether the returned error was because http.StatusNotModified was
  3190. // returned.
  3191. func (c *CatalogsAssociationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogproducerV1beta1ListAssociationsResponse, error) {
  3192. gensupport.SetOptions(c.urlParams_, opts...)
  3193. res, err := c.doRequest("json")
  3194. if res != nil && res.StatusCode == http.StatusNotModified {
  3195. if res.Body != nil {
  3196. res.Body.Close()
  3197. }
  3198. return nil, &googleapi.Error{
  3199. Code: res.StatusCode,
  3200. Header: res.Header,
  3201. }
  3202. }
  3203. if err != nil {
  3204. return nil, err
  3205. }
  3206. defer googleapi.CloseBody(res)
  3207. if err := googleapi.CheckResponse(res); err != nil {
  3208. return nil, err
  3209. }
  3210. ret := &GoogleCloudPrivatecatalogproducerV1beta1ListAssociationsResponse{
  3211. ServerResponse: googleapi.ServerResponse{
  3212. Header: res.Header,
  3213. HTTPStatusCode: res.StatusCode,
  3214. },
  3215. }
  3216. target := &ret
  3217. if err := gensupport.DecodeResponse(target, res); err != nil {
  3218. return nil, err
  3219. }
  3220. return ret, nil
  3221. // {
  3222. // "description": "Lists all Association resources under a catalog.",
  3223. // "flatPath": "v1beta1/catalogs/{catalogsId}/associations",
  3224. // "httpMethod": "GET",
  3225. // "id": "cloudprivatecatalogproducer.catalogs.associations.list",
  3226. // "parameterOrder": [
  3227. // "parent"
  3228. // ],
  3229. // "parameters": {
  3230. // "pageSize": {
  3231. // "description": "The maximum number of catalog associations to return.",
  3232. // "format": "int32",
  3233. // "location": "query",
  3234. // "type": "integer"
  3235. // },
  3236. // "pageToken": {
  3237. // "description": "A pagination token returned from the previous call to\n`ListAssociations`.",
  3238. // "location": "query",
  3239. // "type": "string"
  3240. // },
  3241. // "parent": {
  3242. // "description": "The resource name of the `Catalog` whose `Associations` are\nbeing retrieved. In the format `catalogs/\u003ccatalog\u003e`.",
  3243. // "location": "path",
  3244. // "pattern": "^catalogs/[^/]+$",
  3245. // "required": true,
  3246. // "type": "string"
  3247. // }
  3248. // },
  3249. // "path": "v1beta1/{+parent}/associations",
  3250. // "response": {
  3251. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1ListAssociationsResponse"
  3252. // },
  3253. // "scopes": [
  3254. // "https://www.googleapis.com/auth/cloud-platform"
  3255. // ]
  3256. // }
  3257. }
  3258. // Pages invokes f for each page of results.
  3259. // A non-nil error returned from f will halt the iteration.
  3260. // The provided context supersedes any context provided to the Context method.
  3261. func (c *CatalogsAssociationsListCall) Pages(ctx context.Context, f func(*GoogleCloudPrivatecatalogproducerV1beta1ListAssociationsResponse) error) error {
  3262. c.ctx_ = ctx
  3263. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3264. for {
  3265. x, err := c.Do()
  3266. if err != nil {
  3267. return err
  3268. }
  3269. if err := f(x); err != nil {
  3270. return err
  3271. }
  3272. if x.NextPageToken == "" {
  3273. return nil
  3274. }
  3275. c.PageToken(x.NextPageToken)
  3276. }
  3277. }
  3278. // method id "cloudprivatecatalogproducer.catalogs.products.copy":
  3279. type CatalogsProductsCopyCall struct {
  3280. s *Service
  3281. name string
  3282. googlecloudprivatecatalogproducerv1beta1copyproductrequest *GoogleCloudPrivatecatalogproducerV1beta1CopyProductRequest
  3283. urlParams_ gensupport.URLParams
  3284. ctx_ context.Context
  3285. header_ http.Header
  3286. }
  3287. // Copy: Copies a Product under another Catalog.
  3288. func (r *CatalogsProductsService) Copy(name string, googlecloudprivatecatalogproducerv1beta1copyproductrequest *GoogleCloudPrivatecatalogproducerV1beta1CopyProductRequest) *CatalogsProductsCopyCall {
  3289. c := &CatalogsProductsCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3290. c.name = name
  3291. c.googlecloudprivatecatalogproducerv1beta1copyproductrequest = googlecloudprivatecatalogproducerv1beta1copyproductrequest
  3292. return c
  3293. }
  3294. // Fields allows partial responses to be retrieved. See
  3295. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3296. // for more information.
  3297. func (c *CatalogsProductsCopyCall) Fields(s ...googleapi.Field) *CatalogsProductsCopyCall {
  3298. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3299. return c
  3300. }
  3301. // Context sets the context to be used in this call's Do method. Any
  3302. // pending HTTP request will be aborted if the provided context is
  3303. // canceled.
  3304. func (c *CatalogsProductsCopyCall) Context(ctx context.Context) *CatalogsProductsCopyCall {
  3305. c.ctx_ = ctx
  3306. return c
  3307. }
  3308. // Header returns an http.Header that can be modified by the caller to
  3309. // add HTTP headers to the request.
  3310. func (c *CatalogsProductsCopyCall) Header() http.Header {
  3311. if c.header_ == nil {
  3312. c.header_ = make(http.Header)
  3313. }
  3314. return c.header_
  3315. }
  3316. func (c *CatalogsProductsCopyCall) doRequest(alt string) (*http.Response, error) {
  3317. reqHeaders := make(http.Header)
  3318. for k, v := range c.header_ {
  3319. reqHeaders[k] = v
  3320. }
  3321. reqHeaders.Set("User-Agent", c.s.userAgent())
  3322. var body io.Reader = nil
  3323. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudprivatecatalogproducerv1beta1copyproductrequest)
  3324. if err != nil {
  3325. return nil, err
  3326. }
  3327. reqHeaders.Set("Content-Type", "application/json")
  3328. c.urlParams_.Set("alt", alt)
  3329. c.urlParams_.Set("prettyPrint", "false")
  3330. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:copy")
  3331. urls += "?" + c.urlParams_.Encode()
  3332. req, err := http.NewRequest("POST", urls, body)
  3333. if err != nil {
  3334. return nil, err
  3335. }
  3336. req.Header = reqHeaders
  3337. googleapi.Expand(req.URL, map[string]string{
  3338. "name": c.name,
  3339. })
  3340. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3341. }
  3342. // Do executes the "cloudprivatecatalogproducer.catalogs.products.copy" call.
  3343. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  3344. // Any non-2xx status code is an error. Response headers are in either
  3345. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  3346. // was returned at all) in error.(*googleapi.Error).Header. Use
  3347. // googleapi.IsNotModified to check whether the returned error was
  3348. // because http.StatusNotModified was returned.
  3349. func (c *CatalogsProductsCopyCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  3350. gensupport.SetOptions(c.urlParams_, opts...)
  3351. res, err := c.doRequest("json")
  3352. if res != nil && res.StatusCode == http.StatusNotModified {
  3353. if res.Body != nil {
  3354. res.Body.Close()
  3355. }
  3356. return nil, &googleapi.Error{
  3357. Code: res.StatusCode,
  3358. Header: res.Header,
  3359. }
  3360. }
  3361. if err != nil {
  3362. return nil, err
  3363. }
  3364. defer googleapi.CloseBody(res)
  3365. if err := googleapi.CheckResponse(res); err != nil {
  3366. return nil, err
  3367. }
  3368. ret := &GoogleLongrunningOperation{
  3369. ServerResponse: googleapi.ServerResponse{
  3370. Header: res.Header,
  3371. HTTPStatusCode: res.StatusCode,
  3372. },
  3373. }
  3374. target := &ret
  3375. if err := gensupport.DecodeResponse(target, res); err != nil {
  3376. return nil, err
  3377. }
  3378. return ret, nil
  3379. // {
  3380. // "description": "Copies a Product under another Catalog.",
  3381. // "flatPath": "v1beta1/catalogs/{catalogsId}/products/{productsId}:copy",
  3382. // "httpMethod": "POST",
  3383. // "id": "cloudprivatecatalogproducer.catalogs.products.copy",
  3384. // "parameterOrder": [
  3385. // "name"
  3386. // ],
  3387. // "parameters": {
  3388. // "name": {
  3389. // "description": "The resource name of the current product that is copied from.",
  3390. // "location": "path",
  3391. // "pattern": "^catalogs/[^/]+/products/[^/]+$",
  3392. // "required": true,
  3393. // "type": "string"
  3394. // }
  3395. // },
  3396. // "path": "v1beta1/{+name}:copy",
  3397. // "request": {
  3398. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1CopyProductRequest"
  3399. // },
  3400. // "response": {
  3401. // "$ref": "GoogleLongrunningOperation"
  3402. // },
  3403. // "scopes": [
  3404. // "https://www.googleapis.com/auth/cloud-platform"
  3405. // ]
  3406. // }
  3407. }
  3408. // method id "cloudprivatecatalogproducer.catalogs.products.create":
  3409. type CatalogsProductsCreateCall struct {
  3410. s *Service
  3411. parent string
  3412. googlecloudprivatecatalogproducerv1beta1product *GoogleCloudPrivatecatalogproducerV1beta1Product
  3413. urlParams_ gensupport.URLParams
  3414. ctx_ context.Context
  3415. header_ http.Header
  3416. }
  3417. // Create: Creates a Product instance under a given Catalog.
  3418. func (r *CatalogsProductsService) Create(parent string, googlecloudprivatecatalogproducerv1beta1product *GoogleCloudPrivatecatalogproducerV1beta1Product) *CatalogsProductsCreateCall {
  3419. c := &CatalogsProductsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3420. c.parent = parent
  3421. c.googlecloudprivatecatalogproducerv1beta1product = googlecloudprivatecatalogproducerv1beta1product
  3422. return c
  3423. }
  3424. // Fields allows partial responses to be retrieved. See
  3425. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3426. // for more information.
  3427. func (c *CatalogsProductsCreateCall) Fields(s ...googleapi.Field) *CatalogsProductsCreateCall {
  3428. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3429. return c
  3430. }
  3431. // Context sets the context to be used in this call's Do method. Any
  3432. // pending HTTP request will be aborted if the provided context is
  3433. // canceled.
  3434. func (c *CatalogsProductsCreateCall) Context(ctx context.Context) *CatalogsProductsCreateCall {
  3435. c.ctx_ = ctx
  3436. return c
  3437. }
  3438. // Header returns an http.Header that can be modified by the caller to
  3439. // add HTTP headers to the request.
  3440. func (c *CatalogsProductsCreateCall) Header() http.Header {
  3441. if c.header_ == nil {
  3442. c.header_ = make(http.Header)
  3443. }
  3444. return c.header_
  3445. }
  3446. func (c *CatalogsProductsCreateCall) doRequest(alt string) (*http.Response, error) {
  3447. reqHeaders := make(http.Header)
  3448. for k, v := range c.header_ {
  3449. reqHeaders[k] = v
  3450. }
  3451. reqHeaders.Set("User-Agent", c.s.userAgent())
  3452. var body io.Reader = nil
  3453. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudprivatecatalogproducerv1beta1product)
  3454. if err != nil {
  3455. return nil, err
  3456. }
  3457. reqHeaders.Set("Content-Type", "application/json")
  3458. c.urlParams_.Set("alt", alt)
  3459. c.urlParams_.Set("prettyPrint", "false")
  3460. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/products")
  3461. urls += "?" + c.urlParams_.Encode()
  3462. req, err := http.NewRequest("POST", urls, body)
  3463. if err != nil {
  3464. return nil, err
  3465. }
  3466. req.Header = reqHeaders
  3467. googleapi.Expand(req.URL, map[string]string{
  3468. "parent": c.parent,
  3469. })
  3470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3471. }
  3472. // Do executes the "cloudprivatecatalogproducer.catalogs.products.create" call.
  3473. // Exactly one of *GoogleCloudPrivatecatalogproducerV1beta1Product or
  3474. // error will be non-nil. Any non-2xx status code is an error. Response
  3475. // headers are in either
  3476. // *GoogleCloudPrivatecatalogproducerV1beta1Product.ServerResponse.Header
  3477. // or (if a response was returned at all) in
  3478. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3479. // whether the returned error was because http.StatusNotModified was
  3480. // returned.
  3481. func (c *CatalogsProductsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogproducerV1beta1Product, error) {
  3482. gensupport.SetOptions(c.urlParams_, opts...)
  3483. res, err := c.doRequest("json")
  3484. if res != nil && res.StatusCode == http.StatusNotModified {
  3485. if res.Body != nil {
  3486. res.Body.Close()
  3487. }
  3488. return nil, &googleapi.Error{
  3489. Code: res.StatusCode,
  3490. Header: res.Header,
  3491. }
  3492. }
  3493. if err != nil {
  3494. return nil, err
  3495. }
  3496. defer googleapi.CloseBody(res)
  3497. if err := googleapi.CheckResponse(res); err != nil {
  3498. return nil, err
  3499. }
  3500. ret := &GoogleCloudPrivatecatalogproducerV1beta1Product{
  3501. ServerResponse: googleapi.ServerResponse{
  3502. Header: res.Header,
  3503. HTTPStatusCode: res.StatusCode,
  3504. },
  3505. }
  3506. target := &ret
  3507. if err := gensupport.DecodeResponse(target, res); err != nil {
  3508. return nil, err
  3509. }
  3510. return ret, nil
  3511. // {
  3512. // "description": "Creates a Product instance under a given Catalog.",
  3513. // "flatPath": "v1beta1/catalogs/{catalogsId}/products",
  3514. // "httpMethod": "POST",
  3515. // "id": "cloudprivatecatalogproducer.catalogs.products.create",
  3516. // "parameterOrder": [
  3517. // "parent"
  3518. // ],
  3519. // "parameters": {
  3520. // "parent": {
  3521. // "description": "The catalog name of the new product's parent.",
  3522. // "location": "path",
  3523. // "pattern": "^catalogs/[^/]+$",
  3524. // "required": true,
  3525. // "type": "string"
  3526. // }
  3527. // },
  3528. // "path": "v1beta1/{+parent}/products",
  3529. // "request": {
  3530. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Product"
  3531. // },
  3532. // "response": {
  3533. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Product"
  3534. // },
  3535. // "scopes": [
  3536. // "https://www.googleapis.com/auth/cloud-platform"
  3537. // ]
  3538. // }
  3539. }
  3540. // method id "cloudprivatecatalogproducer.catalogs.products.delete":
  3541. type CatalogsProductsDeleteCall struct {
  3542. s *Service
  3543. name string
  3544. urlParams_ gensupport.URLParams
  3545. ctx_ context.Context
  3546. header_ http.Header
  3547. }
  3548. // Delete: Hard deletes a Product.
  3549. func (r *CatalogsProductsService) Delete(name string) *CatalogsProductsDeleteCall {
  3550. c := &CatalogsProductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3551. c.name = name
  3552. return c
  3553. }
  3554. // Fields allows partial responses to be retrieved. See
  3555. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3556. // for more information.
  3557. func (c *CatalogsProductsDeleteCall) Fields(s ...googleapi.Field) *CatalogsProductsDeleteCall {
  3558. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3559. return c
  3560. }
  3561. // Context sets the context to be used in this call's Do method. Any
  3562. // pending HTTP request will be aborted if the provided context is
  3563. // canceled.
  3564. func (c *CatalogsProductsDeleteCall) Context(ctx context.Context) *CatalogsProductsDeleteCall {
  3565. c.ctx_ = ctx
  3566. return c
  3567. }
  3568. // Header returns an http.Header that can be modified by the caller to
  3569. // add HTTP headers to the request.
  3570. func (c *CatalogsProductsDeleteCall) Header() http.Header {
  3571. if c.header_ == nil {
  3572. c.header_ = make(http.Header)
  3573. }
  3574. return c.header_
  3575. }
  3576. func (c *CatalogsProductsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3577. reqHeaders := make(http.Header)
  3578. for k, v := range c.header_ {
  3579. reqHeaders[k] = v
  3580. }
  3581. reqHeaders.Set("User-Agent", c.s.userAgent())
  3582. var body io.Reader = nil
  3583. c.urlParams_.Set("alt", alt)
  3584. c.urlParams_.Set("prettyPrint", "false")
  3585. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3586. urls += "?" + c.urlParams_.Encode()
  3587. req, err := http.NewRequest("DELETE", urls, body)
  3588. if err != nil {
  3589. return nil, err
  3590. }
  3591. req.Header = reqHeaders
  3592. googleapi.Expand(req.URL, map[string]string{
  3593. "name": c.name,
  3594. })
  3595. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3596. }
  3597. // Do executes the "cloudprivatecatalogproducer.catalogs.products.delete" call.
  3598. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  3599. // non-2xx status code is an error. Response headers are in either
  3600. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  3601. // returned at all) in error.(*googleapi.Error).Header. Use
  3602. // googleapi.IsNotModified to check whether the returned error was
  3603. // because http.StatusNotModified was returned.
  3604. func (c *CatalogsProductsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  3605. gensupport.SetOptions(c.urlParams_, opts...)
  3606. res, err := c.doRequest("json")
  3607. if res != nil && res.StatusCode == http.StatusNotModified {
  3608. if res.Body != nil {
  3609. res.Body.Close()
  3610. }
  3611. return nil, &googleapi.Error{
  3612. Code: res.StatusCode,
  3613. Header: res.Header,
  3614. }
  3615. }
  3616. if err != nil {
  3617. return nil, err
  3618. }
  3619. defer googleapi.CloseBody(res)
  3620. if err := googleapi.CheckResponse(res); err != nil {
  3621. return nil, err
  3622. }
  3623. ret := &GoogleProtobufEmpty{
  3624. ServerResponse: googleapi.ServerResponse{
  3625. Header: res.Header,
  3626. HTTPStatusCode: res.StatusCode,
  3627. },
  3628. }
  3629. target := &ret
  3630. if err := gensupport.DecodeResponse(target, res); err != nil {
  3631. return nil, err
  3632. }
  3633. return ret, nil
  3634. // {
  3635. // "description": "Hard deletes a Product.",
  3636. // "flatPath": "v1beta1/catalogs/{catalogsId}/products/{productsId}",
  3637. // "httpMethod": "DELETE",
  3638. // "id": "cloudprivatecatalogproducer.catalogs.products.delete",
  3639. // "parameterOrder": [
  3640. // "name"
  3641. // ],
  3642. // "parameters": {
  3643. // "name": {
  3644. // "description": "The resource name of the product.",
  3645. // "location": "path",
  3646. // "pattern": "^catalogs/[^/]+/products/[^/]+$",
  3647. // "required": true,
  3648. // "type": "string"
  3649. // }
  3650. // },
  3651. // "path": "v1beta1/{+name}",
  3652. // "response": {
  3653. // "$ref": "GoogleProtobufEmpty"
  3654. // },
  3655. // "scopes": [
  3656. // "https://www.googleapis.com/auth/cloud-platform"
  3657. // ]
  3658. // }
  3659. }
  3660. // method id "cloudprivatecatalogproducer.catalogs.products.get":
  3661. type CatalogsProductsGetCall struct {
  3662. s *Service
  3663. name string
  3664. urlParams_ gensupport.URLParams
  3665. ifNoneMatch_ string
  3666. ctx_ context.Context
  3667. header_ http.Header
  3668. }
  3669. // Get: Returns the requested Product resource.
  3670. func (r *CatalogsProductsService) Get(name string) *CatalogsProductsGetCall {
  3671. c := &CatalogsProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3672. c.name = name
  3673. return c
  3674. }
  3675. // Fields allows partial responses to be retrieved. See
  3676. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3677. // for more information.
  3678. func (c *CatalogsProductsGetCall) Fields(s ...googleapi.Field) *CatalogsProductsGetCall {
  3679. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3680. return c
  3681. }
  3682. // IfNoneMatch sets the optional parameter which makes the operation
  3683. // fail if the object's ETag matches the given value. This is useful for
  3684. // getting updates only after the object has changed since the last
  3685. // request. Use googleapi.IsNotModified to check whether the response
  3686. // error from Do is the result of In-None-Match.
  3687. func (c *CatalogsProductsGetCall) IfNoneMatch(entityTag string) *CatalogsProductsGetCall {
  3688. c.ifNoneMatch_ = entityTag
  3689. return c
  3690. }
  3691. // Context sets the context to be used in this call's Do method. Any
  3692. // pending HTTP request will be aborted if the provided context is
  3693. // canceled.
  3694. func (c *CatalogsProductsGetCall) Context(ctx context.Context) *CatalogsProductsGetCall {
  3695. c.ctx_ = ctx
  3696. return c
  3697. }
  3698. // Header returns an http.Header that can be modified by the caller to
  3699. // add HTTP headers to the request.
  3700. func (c *CatalogsProductsGetCall) Header() http.Header {
  3701. if c.header_ == nil {
  3702. c.header_ = make(http.Header)
  3703. }
  3704. return c.header_
  3705. }
  3706. func (c *CatalogsProductsGetCall) doRequest(alt string) (*http.Response, error) {
  3707. reqHeaders := make(http.Header)
  3708. for k, v := range c.header_ {
  3709. reqHeaders[k] = v
  3710. }
  3711. reqHeaders.Set("User-Agent", c.s.userAgent())
  3712. if c.ifNoneMatch_ != "" {
  3713. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3714. }
  3715. var body io.Reader = nil
  3716. c.urlParams_.Set("alt", alt)
  3717. c.urlParams_.Set("prettyPrint", "false")
  3718. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  3719. urls += "?" + c.urlParams_.Encode()
  3720. req, err := http.NewRequest("GET", urls, body)
  3721. if err != nil {
  3722. return nil, err
  3723. }
  3724. req.Header = reqHeaders
  3725. googleapi.Expand(req.URL, map[string]string{
  3726. "name": c.name,
  3727. })
  3728. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3729. }
  3730. // Do executes the "cloudprivatecatalogproducer.catalogs.products.get" call.
  3731. // Exactly one of *GoogleCloudPrivatecatalogproducerV1beta1Product or
  3732. // error will be non-nil. Any non-2xx status code is an error. Response
  3733. // headers are in either
  3734. // *GoogleCloudPrivatecatalogproducerV1beta1Product.ServerResponse.Header
  3735. // or (if a response was returned at all) in
  3736. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3737. // whether the returned error was because http.StatusNotModified was
  3738. // returned.
  3739. func (c *CatalogsProductsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogproducerV1beta1Product, error) {
  3740. gensupport.SetOptions(c.urlParams_, opts...)
  3741. res, err := c.doRequest("json")
  3742. if res != nil && res.StatusCode == http.StatusNotModified {
  3743. if res.Body != nil {
  3744. res.Body.Close()
  3745. }
  3746. return nil, &googleapi.Error{
  3747. Code: res.StatusCode,
  3748. Header: res.Header,
  3749. }
  3750. }
  3751. if err != nil {
  3752. return nil, err
  3753. }
  3754. defer googleapi.CloseBody(res)
  3755. if err := googleapi.CheckResponse(res); err != nil {
  3756. return nil, err
  3757. }
  3758. ret := &GoogleCloudPrivatecatalogproducerV1beta1Product{
  3759. ServerResponse: googleapi.ServerResponse{
  3760. Header: res.Header,
  3761. HTTPStatusCode: res.StatusCode,
  3762. },
  3763. }
  3764. target := &ret
  3765. if err := gensupport.DecodeResponse(target, res); err != nil {
  3766. return nil, err
  3767. }
  3768. return ret, nil
  3769. // {
  3770. // "description": "Returns the requested Product resource.",
  3771. // "flatPath": "v1beta1/catalogs/{catalogsId}/products/{productsId}",
  3772. // "httpMethod": "GET",
  3773. // "id": "cloudprivatecatalogproducer.catalogs.products.get",
  3774. // "parameterOrder": [
  3775. // "name"
  3776. // ],
  3777. // "parameters": {
  3778. // "name": {
  3779. // "description": "The resource name of the product.",
  3780. // "location": "path",
  3781. // "pattern": "^catalogs/[^/]+/products/[^/]+$",
  3782. // "required": true,
  3783. // "type": "string"
  3784. // }
  3785. // },
  3786. // "path": "v1beta1/{+name}",
  3787. // "response": {
  3788. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Product"
  3789. // },
  3790. // "scopes": [
  3791. // "https://www.googleapis.com/auth/cloud-platform"
  3792. // ]
  3793. // }
  3794. }
  3795. // method id "cloudprivatecatalogproducer.catalogs.products.list":
  3796. type CatalogsProductsListCall struct {
  3797. s *Service
  3798. parent string
  3799. urlParams_ gensupport.URLParams
  3800. ifNoneMatch_ string
  3801. ctx_ context.Context
  3802. header_ http.Header
  3803. }
  3804. // List: Lists Product resources that the producer has access to, within
  3805. // the
  3806. // scope of the parent catalog.
  3807. func (r *CatalogsProductsService) List(parent string) *CatalogsProductsListCall {
  3808. c := &CatalogsProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3809. c.parent = parent
  3810. return c
  3811. }
  3812. // Filter sets the optional parameter "filter": A filter expression used
  3813. // to restrict the returned results based
  3814. // upon properties of the product.
  3815. func (c *CatalogsProductsListCall) Filter(filter string) *CatalogsProductsListCall {
  3816. c.urlParams_.Set("filter", filter)
  3817. return c
  3818. }
  3819. // PageSize sets the optional parameter "pageSize": The maximum number
  3820. // of products to return.
  3821. func (c *CatalogsProductsListCall) PageSize(pageSize int64) *CatalogsProductsListCall {
  3822. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3823. return c
  3824. }
  3825. // PageToken sets the optional parameter "pageToken": A pagination token
  3826. // returned from a previous call to ListProducts
  3827. // that indicates where this listing should continue from.
  3828. // This field is optional.
  3829. func (c *CatalogsProductsListCall) PageToken(pageToken string) *CatalogsProductsListCall {
  3830. c.urlParams_.Set("pageToken", pageToken)
  3831. return c
  3832. }
  3833. // Fields allows partial responses to be retrieved. See
  3834. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3835. // for more information.
  3836. func (c *CatalogsProductsListCall) Fields(s ...googleapi.Field) *CatalogsProductsListCall {
  3837. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3838. return c
  3839. }
  3840. // IfNoneMatch sets the optional parameter which makes the operation
  3841. // fail if the object's ETag matches the given value. This is useful for
  3842. // getting updates only after the object has changed since the last
  3843. // request. Use googleapi.IsNotModified to check whether the response
  3844. // error from Do is the result of In-None-Match.
  3845. func (c *CatalogsProductsListCall) IfNoneMatch(entityTag string) *CatalogsProductsListCall {
  3846. c.ifNoneMatch_ = entityTag
  3847. return c
  3848. }
  3849. // Context sets the context to be used in this call's Do method. Any
  3850. // pending HTTP request will be aborted if the provided context is
  3851. // canceled.
  3852. func (c *CatalogsProductsListCall) Context(ctx context.Context) *CatalogsProductsListCall {
  3853. c.ctx_ = ctx
  3854. return c
  3855. }
  3856. // Header returns an http.Header that can be modified by the caller to
  3857. // add HTTP headers to the request.
  3858. func (c *CatalogsProductsListCall) Header() http.Header {
  3859. if c.header_ == nil {
  3860. c.header_ = make(http.Header)
  3861. }
  3862. return c.header_
  3863. }
  3864. func (c *CatalogsProductsListCall) doRequest(alt string) (*http.Response, error) {
  3865. reqHeaders := make(http.Header)
  3866. for k, v := range c.header_ {
  3867. reqHeaders[k] = v
  3868. }
  3869. reqHeaders.Set("User-Agent", c.s.userAgent())
  3870. if c.ifNoneMatch_ != "" {
  3871. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3872. }
  3873. var body io.Reader = nil
  3874. c.urlParams_.Set("alt", alt)
  3875. c.urlParams_.Set("prettyPrint", "false")
  3876. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/products")
  3877. urls += "?" + c.urlParams_.Encode()
  3878. req, err := http.NewRequest("GET", urls, body)
  3879. if err != nil {
  3880. return nil, err
  3881. }
  3882. req.Header = reqHeaders
  3883. googleapi.Expand(req.URL, map[string]string{
  3884. "parent": c.parent,
  3885. })
  3886. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3887. }
  3888. // Do executes the "cloudprivatecatalogproducer.catalogs.products.list" call.
  3889. // Exactly one of
  3890. // *GoogleCloudPrivatecatalogproducerV1beta1ListProductsResponse or
  3891. // error will be non-nil. Any non-2xx status code is an error. Response
  3892. // headers are in either
  3893. // *GoogleCloudPrivatecatalogproducerV1beta1ListProductsResponse.ServerRe
  3894. // sponse.Header or (if a response was returned at all) in
  3895. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3896. // whether the returned error was because http.StatusNotModified was
  3897. // returned.
  3898. func (c *CatalogsProductsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogproducerV1beta1ListProductsResponse, error) {
  3899. gensupport.SetOptions(c.urlParams_, opts...)
  3900. res, err := c.doRequest("json")
  3901. if res != nil && res.StatusCode == http.StatusNotModified {
  3902. if res.Body != nil {
  3903. res.Body.Close()
  3904. }
  3905. return nil, &googleapi.Error{
  3906. Code: res.StatusCode,
  3907. Header: res.Header,
  3908. }
  3909. }
  3910. if err != nil {
  3911. return nil, err
  3912. }
  3913. defer googleapi.CloseBody(res)
  3914. if err := googleapi.CheckResponse(res); err != nil {
  3915. return nil, err
  3916. }
  3917. ret := &GoogleCloudPrivatecatalogproducerV1beta1ListProductsResponse{
  3918. ServerResponse: googleapi.ServerResponse{
  3919. Header: res.Header,
  3920. HTTPStatusCode: res.StatusCode,
  3921. },
  3922. }
  3923. target := &ret
  3924. if err := gensupport.DecodeResponse(target, res); err != nil {
  3925. return nil, err
  3926. }
  3927. return ret, nil
  3928. // {
  3929. // "description": "Lists Product resources that the producer has access to, within the\nscope of the parent catalog.",
  3930. // "flatPath": "v1beta1/catalogs/{catalogsId}/products",
  3931. // "httpMethod": "GET",
  3932. // "id": "cloudprivatecatalogproducer.catalogs.products.list",
  3933. // "parameterOrder": [
  3934. // "parent"
  3935. // ],
  3936. // "parameters": {
  3937. // "filter": {
  3938. // "description": "A filter expression used to restrict the returned results based\nupon properties of the product.",
  3939. // "location": "query",
  3940. // "type": "string"
  3941. // },
  3942. // "pageSize": {
  3943. // "description": "The maximum number of products to return.",
  3944. // "format": "int32",
  3945. // "location": "query",
  3946. // "type": "integer"
  3947. // },
  3948. // "pageToken": {
  3949. // "description": "A pagination token returned from a previous call to ListProducts\nthat indicates where this listing should continue from.\nThis field is optional.",
  3950. // "location": "query",
  3951. // "type": "string"
  3952. // },
  3953. // "parent": {
  3954. // "description": "The resource name of the parent resource.",
  3955. // "location": "path",
  3956. // "pattern": "^catalogs/[^/]+$",
  3957. // "required": true,
  3958. // "type": "string"
  3959. // }
  3960. // },
  3961. // "path": "v1beta1/{+parent}/products",
  3962. // "response": {
  3963. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1ListProductsResponse"
  3964. // },
  3965. // "scopes": [
  3966. // "https://www.googleapis.com/auth/cloud-platform"
  3967. // ]
  3968. // }
  3969. }
  3970. // Pages invokes f for each page of results.
  3971. // A non-nil error returned from f will halt the iteration.
  3972. // The provided context supersedes any context provided to the Context method.
  3973. func (c *CatalogsProductsListCall) Pages(ctx context.Context, f func(*GoogleCloudPrivatecatalogproducerV1beta1ListProductsResponse) error) error {
  3974. c.ctx_ = ctx
  3975. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3976. for {
  3977. x, err := c.Do()
  3978. if err != nil {
  3979. return err
  3980. }
  3981. if err := f(x); err != nil {
  3982. return err
  3983. }
  3984. if x.NextPageToken == "" {
  3985. return nil
  3986. }
  3987. c.PageToken(x.NextPageToken)
  3988. }
  3989. }
  3990. // method id "cloudprivatecatalogproducer.catalogs.products.patch":
  3991. type CatalogsProductsPatchCall struct {
  3992. s *Service
  3993. nameid string
  3994. googlecloudprivatecatalogproducerv1beta1product *GoogleCloudPrivatecatalogproducerV1beta1Product
  3995. urlParams_ gensupport.URLParams
  3996. ctx_ context.Context
  3997. header_ http.Header
  3998. }
  3999. // Patch: Updates a specific Product resource.
  4000. func (r *CatalogsProductsService) Patch(nameid string, googlecloudprivatecatalogproducerv1beta1product *GoogleCloudPrivatecatalogproducerV1beta1Product) *CatalogsProductsPatchCall {
  4001. c := &CatalogsProductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4002. c.nameid = nameid
  4003. c.googlecloudprivatecatalogproducerv1beta1product = googlecloudprivatecatalogproducerv1beta1product
  4004. return c
  4005. }
  4006. // UpdateMask sets the optional parameter "updateMask": Field mask that
  4007. // controls which fields of the product should be updated.
  4008. func (c *CatalogsProductsPatchCall) UpdateMask(updateMask string) *CatalogsProductsPatchCall {
  4009. c.urlParams_.Set("updateMask", updateMask)
  4010. return c
  4011. }
  4012. // Fields allows partial responses to be retrieved. See
  4013. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4014. // for more information.
  4015. func (c *CatalogsProductsPatchCall) Fields(s ...googleapi.Field) *CatalogsProductsPatchCall {
  4016. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4017. return c
  4018. }
  4019. // Context sets the context to be used in this call's Do method. Any
  4020. // pending HTTP request will be aborted if the provided context is
  4021. // canceled.
  4022. func (c *CatalogsProductsPatchCall) Context(ctx context.Context) *CatalogsProductsPatchCall {
  4023. c.ctx_ = ctx
  4024. return c
  4025. }
  4026. // Header returns an http.Header that can be modified by the caller to
  4027. // add HTTP headers to the request.
  4028. func (c *CatalogsProductsPatchCall) Header() http.Header {
  4029. if c.header_ == nil {
  4030. c.header_ = make(http.Header)
  4031. }
  4032. return c.header_
  4033. }
  4034. func (c *CatalogsProductsPatchCall) doRequest(alt string) (*http.Response, error) {
  4035. reqHeaders := make(http.Header)
  4036. for k, v := range c.header_ {
  4037. reqHeaders[k] = v
  4038. }
  4039. reqHeaders.Set("User-Agent", c.s.userAgent())
  4040. var body io.Reader = nil
  4041. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudprivatecatalogproducerv1beta1product)
  4042. if err != nil {
  4043. return nil, err
  4044. }
  4045. reqHeaders.Set("Content-Type", "application/json")
  4046. c.urlParams_.Set("alt", alt)
  4047. c.urlParams_.Set("prettyPrint", "false")
  4048. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  4049. urls += "?" + c.urlParams_.Encode()
  4050. req, err := http.NewRequest("PATCH", urls, body)
  4051. if err != nil {
  4052. return nil, err
  4053. }
  4054. req.Header = reqHeaders
  4055. googleapi.Expand(req.URL, map[string]string{
  4056. "name": c.nameid,
  4057. })
  4058. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4059. }
  4060. // Do executes the "cloudprivatecatalogproducer.catalogs.products.patch" call.
  4061. // Exactly one of *GoogleCloudPrivatecatalogproducerV1beta1Product or
  4062. // error will be non-nil. Any non-2xx status code is an error. Response
  4063. // headers are in either
  4064. // *GoogleCloudPrivatecatalogproducerV1beta1Product.ServerResponse.Header
  4065. // or (if a response was returned at all) in
  4066. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4067. // whether the returned error was because http.StatusNotModified was
  4068. // returned.
  4069. func (c *CatalogsProductsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogproducerV1beta1Product, error) {
  4070. gensupport.SetOptions(c.urlParams_, opts...)
  4071. res, err := c.doRequest("json")
  4072. if res != nil && res.StatusCode == http.StatusNotModified {
  4073. if res.Body != nil {
  4074. res.Body.Close()
  4075. }
  4076. return nil, &googleapi.Error{
  4077. Code: res.StatusCode,
  4078. Header: res.Header,
  4079. }
  4080. }
  4081. if err != nil {
  4082. return nil, err
  4083. }
  4084. defer googleapi.CloseBody(res)
  4085. if err := googleapi.CheckResponse(res); err != nil {
  4086. return nil, err
  4087. }
  4088. ret := &GoogleCloudPrivatecatalogproducerV1beta1Product{
  4089. ServerResponse: googleapi.ServerResponse{
  4090. Header: res.Header,
  4091. HTTPStatusCode: res.StatusCode,
  4092. },
  4093. }
  4094. target := &ret
  4095. if err := gensupport.DecodeResponse(target, res); err != nil {
  4096. return nil, err
  4097. }
  4098. return ret, nil
  4099. // {
  4100. // "description": "Updates a specific Product resource.",
  4101. // "flatPath": "v1beta1/catalogs/{catalogsId}/products/{productsId}",
  4102. // "httpMethod": "PATCH",
  4103. // "id": "cloudprivatecatalogproducer.catalogs.products.patch",
  4104. // "parameterOrder": [
  4105. // "name"
  4106. // ],
  4107. // "parameters": {
  4108. // "name": {
  4109. // "description": "Required. The resource name of the product in the format\n`catalogs/{catalog_id}/products/a-z*[a-z0-9]'.\n\nA unique identifier for the product under a catalog, which cannot\nbe changed after the product is created. The final\nsegment of the name must between 1 and 256 characters in length.",
  4110. // "location": "path",
  4111. // "pattern": "^catalogs/[^/]+/products/[^/]+$",
  4112. // "required": true,
  4113. // "type": "string"
  4114. // },
  4115. // "updateMask": {
  4116. // "description": "Field mask that controls which fields of the product should be updated.",
  4117. // "format": "google-fieldmask",
  4118. // "location": "query",
  4119. // "type": "string"
  4120. // }
  4121. // },
  4122. // "path": "v1beta1/{+name}",
  4123. // "request": {
  4124. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Product"
  4125. // },
  4126. // "response": {
  4127. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Product"
  4128. // },
  4129. // "scopes": [
  4130. // "https://www.googleapis.com/auth/cloud-platform"
  4131. // ]
  4132. // }
  4133. }
  4134. // method id "cloudprivatecatalogproducer.catalogs.products.icons.upload":
  4135. type CatalogsProductsIconsUploadCall struct {
  4136. s *Service
  4137. product string
  4138. googlecloudprivatecatalogproducerv1beta1uploadiconrequest *GoogleCloudPrivatecatalogproducerV1beta1UploadIconRequest
  4139. urlParams_ gensupport.URLParams
  4140. ctx_ context.Context
  4141. header_ http.Header
  4142. }
  4143. // Upload: Creates an Icon instance under a given Product.
  4144. // If Product only has a default icon, a new Icon
  4145. // instance is created and associated with the given Product.
  4146. // If Product already has a non-default icon, the action creates
  4147. // a new Icon instance, associates the newly created
  4148. // Icon with the given Product and deletes the old icon.
  4149. func (r *CatalogsProductsIconsService) Upload(product string, googlecloudprivatecatalogproducerv1beta1uploadiconrequest *GoogleCloudPrivatecatalogproducerV1beta1UploadIconRequest) *CatalogsProductsIconsUploadCall {
  4150. c := &CatalogsProductsIconsUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4151. c.product = product
  4152. c.googlecloudprivatecatalogproducerv1beta1uploadiconrequest = googlecloudprivatecatalogproducerv1beta1uploadiconrequest
  4153. return c
  4154. }
  4155. // Fields allows partial responses to be retrieved. See
  4156. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4157. // for more information.
  4158. func (c *CatalogsProductsIconsUploadCall) Fields(s ...googleapi.Field) *CatalogsProductsIconsUploadCall {
  4159. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4160. return c
  4161. }
  4162. // Context sets the context to be used in this call's Do method. Any
  4163. // pending HTTP request will be aborted if the provided context is
  4164. // canceled.
  4165. func (c *CatalogsProductsIconsUploadCall) Context(ctx context.Context) *CatalogsProductsIconsUploadCall {
  4166. c.ctx_ = ctx
  4167. return c
  4168. }
  4169. // Header returns an http.Header that can be modified by the caller to
  4170. // add HTTP headers to the request.
  4171. func (c *CatalogsProductsIconsUploadCall) Header() http.Header {
  4172. if c.header_ == nil {
  4173. c.header_ = make(http.Header)
  4174. }
  4175. return c.header_
  4176. }
  4177. func (c *CatalogsProductsIconsUploadCall) doRequest(alt string) (*http.Response, error) {
  4178. reqHeaders := make(http.Header)
  4179. for k, v := range c.header_ {
  4180. reqHeaders[k] = v
  4181. }
  4182. reqHeaders.Set("User-Agent", c.s.userAgent())
  4183. var body io.Reader = nil
  4184. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudprivatecatalogproducerv1beta1uploadiconrequest)
  4185. if err != nil {
  4186. return nil, err
  4187. }
  4188. reqHeaders.Set("Content-Type", "application/json")
  4189. c.urlParams_.Set("alt", alt)
  4190. c.urlParams_.Set("prettyPrint", "false")
  4191. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+product}/icons:upload")
  4192. urls += "?" + c.urlParams_.Encode()
  4193. req, err := http.NewRequest("POST", urls, body)
  4194. if err != nil {
  4195. return nil, err
  4196. }
  4197. req.Header = reqHeaders
  4198. googleapi.Expand(req.URL, map[string]string{
  4199. "product": c.product,
  4200. })
  4201. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4202. }
  4203. // Do executes the "cloudprivatecatalogproducer.catalogs.products.icons.upload" call.
  4204. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  4205. // non-2xx status code is an error. Response headers are in either
  4206. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  4207. // returned at all) in error.(*googleapi.Error).Header. Use
  4208. // googleapi.IsNotModified to check whether the returned error was
  4209. // because http.StatusNotModified was returned.
  4210. func (c *CatalogsProductsIconsUploadCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  4211. gensupport.SetOptions(c.urlParams_, opts...)
  4212. res, err := c.doRequest("json")
  4213. if res != nil && res.StatusCode == http.StatusNotModified {
  4214. if res.Body != nil {
  4215. res.Body.Close()
  4216. }
  4217. return nil, &googleapi.Error{
  4218. Code: res.StatusCode,
  4219. Header: res.Header,
  4220. }
  4221. }
  4222. if err != nil {
  4223. return nil, err
  4224. }
  4225. defer googleapi.CloseBody(res)
  4226. if err := googleapi.CheckResponse(res); err != nil {
  4227. return nil, err
  4228. }
  4229. ret := &GoogleProtobufEmpty{
  4230. ServerResponse: googleapi.ServerResponse{
  4231. Header: res.Header,
  4232. HTTPStatusCode: res.StatusCode,
  4233. },
  4234. }
  4235. target := &ret
  4236. if err := gensupport.DecodeResponse(target, res); err != nil {
  4237. return nil, err
  4238. }
  4239. return ret, nil
  4240. // {
  4241. // "description": "Creates an Icon instance under a given Product.\nIf Product only has a default icon, a new Icon\ninstance is created and associated with the given Product.\nIf Product already has a non-default icon, the action creates\na new Icon instance, associates the newly created\nIcon with the given Product and deletes the old icon.",
  4242. // "flatPath": "v1beta1/catalogs/{catalogsId}/products/{productsId}/icons:upload",
  4243. // "httpMethod": "POST",
  4244. // "id": "cloudprivatecatalogproducer.catalogs.products.icons.upload",
  4245. // "parameterOrder": [
  4246. // "product"
  4247. // ],
  4248. // "parameters": {
  4249. // "product": {
  4250. // "description": "The resource name of the product.",
  4251. // "location": "path",
  4252. // "pattern": "^catalogs/[^/]+/products/[^/]+$",
  4253. // "required": true,
  4254. // "type": "string"
  4255. // }
  4256. // },
  4257. // "path": "v1beta1/{+product}/icons:upload",
  4258. // "request": {
  4259. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1UploadIconRequest"
  4260. // },
  4261. // "response": {
  4262. // "$ref": "GoogleProtobufEmpty"
  4263. // },
  4264. // "scopes": [
  4265. // "https://www.googleapis.com/auth/cloud-platform"
  4266. // ]
  4267. // }
  4268. }
  4269. // method id "cloudprivatecatalogproducer.catalogs.products.versions.create":
  4270. type CatalogsProductsVersionsCreateCall struct {
  4271. s *Service
  4272. parent string
  4273. googlecloudprivatecatalogproducerv1beta1version *GoogleCloudPrivatecatalogproducerV1beta1Version
  4274. urlParams_ gensupport.URLParams
  4275. ctx_ context.Context
  4276. header_ http.Header
  4277. }
  4278. // Create: Creates a Version instance under a given Product.
  4279. func (r *CatalogsProductsVersionsService) Create(parent string, googlecloudprivatecatalogproducerv1beta1version *GoogleCloudPrivatecatalogproducerV1beta1Version) *CatalogsProductsVersionsCreateCall {
  4280. c := &CatalogsProductsVersionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4281. c.parent = parent
  4282. c.googlecloudprivatecatalogproducerv1beta1version = googlecloudprivatecatalogproducerv1beta1version
  4283. return c
  4284. }
  4285. // Fields allows partial responses to be retrieved. See
  4286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4287. // for more information.
  4288. func (c *CatalogsProductsVersionsCreateCall) Fields(s ...googleapi.Field) *CatalogsProductsVersionsCreateCall {
  4289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4290. return c
  4291. }
  4292. // Context sets the context to be used in this call's Do method. Any
  4293. // pending HTTP request will be aborted if the provided context is
  4294. // canceled.
  4295. func (c *CatalogsProductsVersionsCreateCall) Context(ctx context.Context) *CatalogsProductsVersionsCreateCall {
  4296. c.ctx_ = ctx
  4297. return c
  4298. }
  4299. // Header returns an http.Header that can be modified by the caller to
  4300. // add HTTP headers to the request.
  4301. func (c *CatalogsProductsVersionsCreateCall) Header() http.Header {
  4302. if c.header_ == nil {
  4303. c.header_ = make(http.Header)
  4304. }
  4305. return c.header_
  4306. }
  4307. func (c *CatalogsProductsVersionsCreateCall) doRequest(alt string) (*http.Response, error) {
  4308. reqHeaders := make(http.Header)
  4309. for k, v := range c.header_ {
  4310. reqHeaders[k] = v
  4311. }
  4312. reqHeaders.Set("User-Agent", c.s.userAgent())
  4313. var body io.Reader = nil
  4314. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudprivatecatalogproducerv1beta1version)
  4315. if err != nil {
  4316. return nil, err
  4317. }
  4318. reqHeaders.Set("Content-Type", "application/json")
  4319. c.urlParams_.Set("alt", alt)
  4320. c.urlParams_.Set("prettyPrint", "false")
  4321. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/versions")
  4322. urls += "?" + c.urlParams_.Encode()
  4323. req, err := http.NewRequest("POST", urls, body)
  4324. if err != nil {
  4325. return nil, err
  4326. }
  4327. req.Header = reqHeaders
  4328. googleapi.Expand(req.URL, map[string]string{
  4329. "parent": c.parent,
  4330. })
  4331. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4332. }
  4333. // Do executes the "cloudprivatecatalogproducer.catalogs.products.versions.create" call.
  4334. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  4335. // Any non-2xx status code is an error. Response headers are in either
  4336. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  4337. // was returned at all) in error.(*googleapi.Error).Header. Use
  4338. // googleapi.IsNotModified to check whether the returned error was
  4339. // because http.StatusNotModified was returned.
  4340. func (c *CatalogsProductsVersionsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  4341. gensupport.SetOptions(c.urlParams_, opts...)
  4342. res, err := c.doRequest("json")
  4343. if res != nil && res.StatusCode == http.StatusNotModified {
  4344. if res.Body != nil {
  4345. res.Body.Close()
  4346. }
  4347. return nil, &googleapi.Error{
  4348. Code: res.StatusCode,
  4349. Header: res.Header,
  4350. }
  4351. }
  4352. if err != nil {
  4353. return nil, err
  4354. }
  4355. defer googleapi.CloseBody(res)
  4356. if err := googleapi.CheckResponse(res); err != nil {
  4357. return nil, err
  4358. }
  4359. ret := &GoogleLongrunningOperation{
  4360. ServerResponse: googleapi.ServerResponse{
  4361. Header: res.Header,
  4362. HTTPStatusCode: res.StatusCode,
  4363. },
  4364. }
  4365. target := &ret
  4366. if err := gensupport.DecodeResponse(target, res); err != nil {
  4367. return nil, err
  4368. }
  4369. return ret, nil
  4370. // {
  4371. // "description": "Creates a Version instance under a given Product.",
  4372. // "flatPath": "v1beta1/catalogs/{catalogsId}/products/{productsId}/versions",
  4373. // "httpMethod": "POST",
  4374. // "id": "cloudprivatecatalogproducer.catalogs.products.versions.create",
  4375. // "parameterOrder": [
  4376. // "parent"
  4377. // ],
  4378. // "parameters": {
  4379. // "parent": {
  4380. // "description": "The product name of the new version's parent.",
  4381. // "location": "path",
  4382. // "pattern": "^catalogs/[^/]+/products/[^/]+$",
  4383. // "required": true,
  4384. // "type": "string"
  4385. // }
  4386. // },
  4387. // "path": "v1beta1/{+parent}/versions",
  4388. // "request": {
  4389. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Version"
  4390. // },
  4391. // "response": {
  4392. // "$ref": "GoogleLongrunningOperation"
  4393. // },
  4394. // "scopes": [
  4395. // "https://www.googleapis.com/auth/cloud-platform"
  4396. // ]
  4397. // }
  4398. }
  4399. // method id "cloudprivatecatalogproducer.catalogs.products.versions.delete":
  4400. type CatalogsProductsVersionsDeleteCall struct {
  4401. s *Service
  4402. name string
  4403. urlParams_ gensupport.URLParams
  4404. ctx_ context.Context
  4405. header_ http.Header
  4406. }
  4407. // Delete: Hard deletes a Version.
  4408. func (r *CatalogsProductsVersionsService) Delete(name string) *CatalogsProductsVersionsDeleteCall {
  4409. c := &CatalogsProductsVersionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4410. c.name = name
  4411. return c
  4412. }
  4413. // Fields allows partial responses to be retrieved. See
  4414. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4415. // for more information.
  4416. func (c *CatalogsProductsVersionsDeleteCall) Fields(s ...googleapi.Field) *CatalogsProductsVersionsDeleteCall {
  4417. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4418. return c
  4419. }
  4420. // Context sets the context to be used in this call's Do method. Any
  4421. // pending HTTP request will be aborted if the provided context is
  4422. // canceled.
  4423. func (c *CatalogsProductsVersionsDeleteCall) Context(ctx context.Context) *CatalogsProductsVersionsDeleteCall {
  4424. c.ctx_ = ctx
  4425. return c
  4426. }
  4427. // Header returns an http.Header that can be modified by the caller to
  4428. // add HTTP headers to the request.
  4429. func (c *CatalogsProductsVersionsDeleteCall) Header() http.Header {
  4430. if c.header_ == nil {
  4431. c.header_ = make(http.Header)
  4432. }
  4433. return c.header_
  4434. }
  4435. func (c *CatalogsProductsVersionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4436. reqHeaders := make(http.Header)
  4437. for k, v := range c.header_ {
  4438. reqHeaders[k] = v
  4439. }
  4440. reqHeaders.Set("User-Agent", c.s.userAgent())
  4441. var body io.Reader = nil
  4442. c.urlParams_.Set("alt", alt)
  4443. c.urlParams_.Set("prettyPrint", "false")
  4444. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  4445. urls += "?" + c.urlParams_.Encode()
  4446. req, err := http.NewRequest("DELETE", urls, body)
  4447. if err != nil {
  4448. return nil, err
  4449. }
  4450. req.Header = reqHeaders
  4451. googleapi.Expand(req.URL, map[string]string{
  4452. "name": c.name,
  4453. })
  4454. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4455. }
  4456. // Do executes the "cloudprivatecatalogproducer.catalogs.products.versions.delete" call.
  4457. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  4458. // non-2xx status code is an error. Response headers are in either
  4459. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  4460. // returned at all) in error.(*googleapi.Error).Header. Use
  4461. // googleapi.IsNotModified to check whether the returned error was
  4462. // because http.StatusNotModified was returned.
  4463. func (c *CatalogsProductsVersionsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  4464. gensupport.SetOptions(c.urlParams_, opts...)
  4465. res, err := c.doRequest("json")
  4466. if res != nil && res.StatusCode == http.StatusNotModified {
  4467. if res.Body != nil {
  4468. res.Body.Close()
  4469. }
  4470. return nil, &googleapi.Error{
  4471. Code: res.StatusCode,
  4472. Header: res.Header,
  4473. }
  4474. }
  4475. if err != nil {
  4476. return nil, err
  4477. }
  4478. defer googleapi.CloseBody(res)
  4479. if err := googleapi.CheckResponse(res); err != nil {
  4480. return nil, err
  4481. }
  4482. ret := &GoogleProtobufEmpty{
  4483. ServerResponse: googleapi.ServerResponse{
  4484. Header: res.Header,
  4485. HTTPStatusCode: res.StatusCode,
  4486. },
  4487. }
  4488. target := &ret
  4489. if err := gensupport.DecodeResponse(target, res); err != nil {
  4490. return nil, err
  4491. }
  4492. return ret, nil
  4493. // {
  4494. // "description": "Hard deletes a Version.",
  4495. // "flatPath": "v1beta1/catalogs/{catalogsId}/products/{productsId}/versions/{versionsId}",
  4496. // "httpMethod": "DELETE",
  4497. // "id": "cloudprivatecatalogproducer.catalogs.products.versions.delete",
  4498. // "parameterOrder": [
  4499. // "name"
  4500. // ],
  4501. // "parameters": {
  4502. // "name": {
  4503. // "description": "The resource name of the version.",
  4504. // "location": "path",
  4505. // "pattern": "^catalogs/[^/]+/products/[^/]+/versions/[^/]+$",
  4506. // "required": true,
  4507. // "type": "string"
  4508. // }
  4509. // },
  4510. // "path": "v1beta1/{+name}",
  4511. // "response": {
  4512. // "$ref": "GoogleProtobufEmpty"
  4513. // },
  4514. // "scopes": [
  4515. // "https://www.googleapis.com/auth/cloud-platform"
  4516. // ]
  4517. // }
  4518. }
  4519. // method id "cloudprivatecatalogproducer.catalogs.products.versions.get":
  4520. type CatalogsProductsVersionsGetCall struct {
  4521. s *Service
  4522. name string
  4523. urlParams_ gensupport.URLParams
  4524. ifNoneMatch_ string
  4525. ctx_ context.Context
  4526. header_ http.Header
  4527. }
  4528. // Get: Returns the requested Version resource.
  4529. func (r *CatalogsProductsVersionsService) Get(name string) *CatalogsProductsVersionsGetCall {
  4530. c := &CatalogsProductsVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4531. c.name = name
  4532. return c
  4533. }
  4534. // Fields allows partial responses to be retrieved. See
  4535. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4536. // for more information.
  4537. func (c *CatalogsProductsVersionsGetCall) Fields(s ...googleapi.Field) *CatalogsProductsVersionsGetCall {
  4538. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4539. return c
  4540. }
  4541. // IfNoneMatch sets the optional parameter which makes the operation
  4542. // fail if the object's ETag matches the given value. This is useful for
  4543. // getting updates only after the object has changed since the last
  4544. // request. Use googleapi.IsNotModified to check whether the response
  4545. // error from Do is the result of In-None-Match.
  4546. func (c *CatalogsProductsVersionsGetCall) IfNoneMatch(entityTag string) *CatalogsProductsVersionsGetCall {
  4547. c.ifNoneMatch_ = entityTag
  4548. return c
  4549. }
  4550. // Context sets the context to be used in this call's Do method. Any
  4551. // pending HTTP request will be aborted if the provided context is
  4552. // canceled.
  4553. func (c *CatalogsProductsVersionsGetCall) Context(ctx context.Context) *CatalogsProductsVersionsGetCall {
  4554. c.ctx_ = ctx
  4555. return c
  4556. }
  4557. // Header returns an http.Header that can be modified by the caller to
  4558. // add HTTP headers to the request.
  4559. func (c *CatalogsProductsVersionsGetCall) Header() http.Header {
  4560. if c.header_ == nil {
  4561. c.header_ = make(http.Header)
  4562. }
  4563. return c.header_
  4564. }
  4565. func (c *CatalogsProductsVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  4566. reqHeaders := make(http.Header)
  4567. for k, v := range c.header_ {
  4568. reqHeaders[k] = v
  4569. }
  4570. reqHeaders.Set("User-Agent", c.s.userAgent())
  4571. if c.ifNoneMatch_ != "" {
  4572. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4573. }
  4574. var body io.Reader = nil
  4575. c.urlParams_.Set("alt", alt)
  4576. c.urlParams_.Set("prettyPrint", "false")
  4577. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  4578. urls += "?" + c.urlParams_.Encode()
  4579. req, err := http.NewRequest("GET", urls, body)
  4580. if err != nil {
  4581. return nil, err
  4582. }
  4583. req.Header = reqHeaders
  4584. googleapi.Expand(req.URL, map[string]string{
  4585. "name": c.name,
  4586. })
  4587. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4588. }
  4589. // Do executes the "cloudprivatecatalogproducer.catalogs.products.versions.get" call.
  4590. // Exactly one of *GoogleCloudPrivatecatalogproducerV1beta1Version or
  4591. // error will be non-nil. Any non-2xx status code is an error. Response
  4592. // headers are in either
  4593. // *GoogleCloudPrivatecatalogproducerV1beta1Version.ServerResponse.Header
  4594. // or (if a response was returned at all) in
  4595. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4596. // whether the returned error was because http.StatusNotModified was
  4597. // returned.
  4598. func (c *CatalogsProductsVersionsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogproducerV1beta1Version, error) {
  4599. gensupport.SetOptions(c.urlParams_, opts...)
  4600. res, err := c.doRequest("json")
  4601. if res != nil && res.StatusCode == http.StatusNotModified {
  4602. if res.Body != nil {
  4603. res.Body.Close()
  4604. }
  4605. return nil, &googleapi.Error{
  4606. Code: res.StatusCode,
  4607. Header: res.Header,
  4608. }
  4609. }
  4610. if err != nil {
  4611. return nil, err
  4612. }
  4613. defer googleapi.CloseBody(res)
  4614. if err := googleapi.CheckResponse(res); err != nil {
  4615. return nil, err
  4616. }
  4617. ret := &GoogleCloudPrivatecatalogproducerV1beta1Version{
  4618. ServerResponse: googleapi.ServerResponse{
  4619. Header: res.Header,
  4620. HTTPStatusCode: res.StatusCode,
  4621. },
  4622. }
  4623. target := &ret
  4624. if err := gensupport.DecodeResponse(target, res); err != nil {
  4625. return nil, err
  4626. }
  4627. return ret, nil
  4628. // {
  4629. // "description": "Returns the requested Version resource.",
  4630. // "flatPath": "v1beta1/catalogs/{catalogsId}/products/{productsId}/versions/{versionsId}",
  4631. // "httpMethod": "GET",
  4632. // "id": "cloudprivatecatalogproducer.catalogs.products.versions.get",
  4633. // "parameterOrder": [
  4634. // "name"
  4635. // ],
  4636. // "parameters": {
  4637. // "name": {
  4638. // "description": "The resource name of the version.",
  4639. // "location": "path",
  4640. // "pattern": "^catalogs/[^/]+/products/[^/]+/versions/[^/]+$",
  4641. // "required": true,
  4642. // "type": "string"
  4643. // }
  4644. // },
  4645. // "path": "v1beta1/{+name}",
  4646. // "response": {
  4647. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Version"
  4648. // },
  4649. // "scopes": [
  4650. // "https://www.googleapis.com/auth/cloud-platform"
  4651. // ]
  4652. // }
  4653. }
  4654. // method id "cloudprivatecatalogproducer.catalogs.products.versions.list":
  4655. type CatalogsProductsVersionsListCall struct {
  4656. s *Service
  4657. parent string
  4658. urlParams_ gensupport.URLParams
  4659. ifNoneMatch_ string
  4660. ctx_ context.Context
  4661. header_ http.Header
  4662. }
  4663. // List: Lists Version resources that the producer has access to, within
  4664. // the
  4665. // scope of the parent Product.
  4666. func (r *CatalogsProductsVersionsService) List(parent string) *CatalogsProductsVersionsListCall {
  4667. c := &CatalogsProductsVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4668. c.parent = parent
  4669. return c
  4670. }
  4671. // PageSize sets the optional parameter "pageSize": The maximum number
  4672. // of versions to return.
  4673. func (c *CatalogsProductsVersionsListCall) PageSize(pageSize int64) *CatalogsProductsVersionsListCall {
  4674. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4675. return c
  4676. }
  4677. // PageToken sets the optional parameter "pageToken": A pagination token
  4678. // returned from a previous call to ListVersions
  4679. // that indicates where this listing should continue from.
  4680. // This field is optional.
  4681. func (c *CatalogsProductsVersionsListCall) PageToken(pageToken string) *CatalogsProductsVersionsListCall {
  4682. c.urlParams_.Set("pageToken", pageToken)
  4683. return c
  4684. }
  4685. // Fields allows partial responses to be retrieved. See
  4686. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4687. // for more information.
  4688. func (c *CatalogsProductsVersionsListCall) Fields(s ...googleapi.Field) *CatalogsProductsVersionsListCall {
  4689. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4690. return c
  4691. }
  4692. // IfNoneMatch sets the optional parameter which makes the operation
  4693. // fail if the object's ETag matches the given value. This is useful for
  4694. // getting updates only after the object has changed since the last
  4695. // request. Use googleapi.IsNotModified to check whether the response
  4696. // error from Do is the result of In-None-Match.
  4697. func (c *CatalogsProductsVersionsListCall) IfNoneMatch(entityTag string) *CatalogsProductsVersionsListCall {
  4698. c.ifNoneMatch_ = entityTag
  4699. return c
  4700. }
  4701. // Context sets the context to be used in this call's Do method. Any
  4702. // pending HTTP request will be aborted if the provided context is
  4703. // canceled.
  4704. func (c *CatalogsProductsVersionsListCall) Context(ctx context.Context) *CatalogsProductsVersionsListCall {
  4705. c.ctx_ = ctx
  4706. return c
  4707. }
  4708. // Header returns an http.Header that can be modified by the caller to
  4709. // add HTTP headers to the request.
  4710. func (c *CatalogsProductsVersionsListCall) Header() http.Header {
  4711. if c.header_ == nil {
  4712. c.header_ = make(http.Header)
  4713. }
  4714. return c.header_
  4715. }
  4716. func (c *CatalogsProductsVersionsListCall) doRequest(alt string) (*http.Response, error) {
  4717. reqHeaders := make(http.Header)
  4718. for k, v := range c.header_ {
  4719. reqHeaders[k] = v
  4720. }
  4721. reqHeaders.Set("User-Agent", c.s.userAgent())
  4722. if c.ifNoneMatch_ != "" {
  4723. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4724. }
  4725. var body io.Reader = nil
  4726. c.urlParams_.Set("alt", alt)
  4727. c.urlParams_.Set("prettyPrint", "false")
  4728. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/versions")
  4729. urls += "?" + c.urlParams_.Encode()
  4730. req, err := http.NewRequest("GET", urls, body)
  4731. if err != nil {
  4732. return nil, err
  4733. }
  4734. req.Header = reqHeaders
  4735. googleapi.Expand(req.URL, map[string]string{
  4736. "parent": c.parent,
  4737. })
  4738. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4739. }
  4740. // Do executes the "cloudprivatecatalogproducer.catalogs.products.versions.list" call.
  4741. // Exactly one of
  4742. // *GoogleCloudPrivatecatalogproducerV1beta1ListVersionsResponse or
  4743. // error will be non-nil. Any non-2xx status code is an error. Response
  4744. // headers are in either
  4745. // *GoogleCloudPrivatecatalogproducerV1beta1ListVersionsResponse.ServerRe
  4746. // sponse.Header or (if a response was returned at all) in
  4747. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4748. // whether the returned error was because http.StatusNotModified was
  4749. // returned.
  4750. func (c *CatalogsProductsVersionsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogproducerV1beta1ListVersionsResponse, error) {
  4751. gensupport.SetOptions(c.urlParams_, opts...)
  4752. res, err := c.doRequest("json")
  4753. if res != nil && res.StatusCode == http.StatusNotModified {
  4754. if res.Body != nil {
  4755. res.Body.Close()
  4756. }
  4757. return nil, &googleapi.Error{
  4758. Code: res.StatusCode,
  4759. Header: res.Header,
  4760. }
  4761. }
  4762. if err != nil {
  4763. return nil, err
  4764. }
  4765. defer googleapi.CloseBody(res)
  4766. if err := googleapi.CheckResponse(res); err != nil {
  4767. return nil, err
  4768. }
  4769. ret := &GoogleCloudPrivatecatalogproducerV1beta1ListVersionsResponse{
  4770. ServerResponse: googleapi.ServerResponse{
  4771. Header: res.Header,
  4772. HTTPStatusCode: res.StatusCode,
  4773. },
  4774. }
  4775. target := &ret
  4776. if err := gensupport.DecodeResponse(target, res); err != nil {
  4777. return nil, err
  4778. }
  4779. return ret, nil
  4780. // {
  4781. // "description": "Lists Version resources that the producer has access to, within the\nscope of the parent Product.",
  4782. // "flatPath": "v1beta1/catalogs/{catalogsId}/products/{productsId}/versions",
  4783. // "httpMethod": "GET",
  4784. // "id": "cloudprivatecatalogproducer.catalogs.products.versions.list",
  4785. // "parameterOrder": [
  4786. // "parent"
  4787. // ],
  4788. // "parameters": {
  4789. // "pageSize": {
  4790. // "description": "The maximum number of versions to return.",
  4791. // "format": "int32",
  4792. // "location": "query",
  4793. // "type": "integer"
  4794. // },
  4795. // "pageToken": {
  4796. // "description": "A pagination token returned from a previous call to ListVersions\nthat indicates where this listing should continue from.\nThis field is optional.",
  4797. // "location": "query",
  4798. // "type": "string"
  4799. // },
  4800. // "parent": {
  4801. // "description": "The resource name of the parent resource.",
  4802. // "location": "path",
  4803. // "pattern": "^catalogs/[^/]+/products/[^/]+$",
  4804. // "required": true,
  4805. // "type": "string"
  4806. // }
  4807. // },
  4808. // "path": "v1beta1/{+parent}/versions",
  4809. // "response": {
  4810. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1ListVersionsResponse"
  4811. // },
  4812. // "scopes": [
  4813. // "https://www.googleapis.com/auth/cloud-platform"
  4814. // ]
  4815. // }
  4816. }
  4817. // Pages invokes f for each page of results.
  4818. // A non-nil error returned from f will halt the iteration.
  4819. // The provided context supersedes any context provided to the Context method.
  4820. func (c *CatalogsProductsVersionsListCall) Pages(ctx context.Context, f func(*GoogleCloudPrivatecatalogproducerV1beta1ListVersionsResponse) error) error {
  4821. c.ctx_ = ctx
  4822. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4823. for {
  4824. x, err := c.Do()
  4825. if err != nil {
  4826. return err
  4827. }
  4828. if err := f(x); err != nil {
  4829. return err
  4830. }
  4831. if x.NextPageToken == "" {
  4832. return nil
  4833. }
  4834. c.PageToken(x.NextPageToken)
  4835. }
  4836. }
  4837. // method id "cloudprivatecatalogproducer.catalogs.products.versions.patch":
  4838. type CatalogsProductsVersionsPatchCall struct {
  4839. s *Service
  4840. nameid string
  4841. googlecloudprivatecatalogproducerv1beta1version *GoogleCloudPrivatecatalogproducerV1beta1Version
  4842. urlParams_ gensupport.URLParams
  4843. ctx_ context.Context
  4844. header_ http.Header
  4845. }
  4846. // Patch: Updates a specific Version resource.
  4847. func (r *CatalogsProductsVersionsService) Patch(nameid string, googlecloudprivatecatalogproducerv1beta1version *GoogleCloudPrivatecatalogproducerV1beta1Version) *CatalogsProductsVersionsPatchCall {
  4848. c := &CatalogsProductsVersionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4849. c.nameid = nameid
  4850. c.googlecloudprivatecatalogproducerv1beta1version = googlecloudprivatecatalogproducerv1beta1version
  4851. return c
  4852. }
  4853. // UpdateMask sets the optional parameter "updateMask": Field mask that
  4854. // controls which fields of the version should be updated.
  4855. func (c *CatalogsProductsVersionsPatchCall) UpdateMask(updateMask string) *CatalogsProductsVersionsPatchCall {
  4856. c.urlParams_.Set("updateMask", updateMask)
  4857. return c
  4858. }
  4859. // Fields allows partial responses to be retrieved. See
  4860. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4861. // for more information.
  4862. func (c *CatalogsProductsVersionsPatchCall) Fields(s ...googleapi.Field) *CatalogsProductsVersionsPatchCall {
  4863. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4864. return c
  4865. }
  4866. // Context sets the context to be used in this call's Do method. Any
  4867. // pending HTTP request will be aborted if the provided context is
  4868. // canceled.
  4869. func (c *CatalogsProductsVersionsPatchCall) Context(ctx context.Context) *CatalogsProductsVersionsPatchCall {
  4870. c.ctx_ = ctx
  4871. return c
  4872. }
  4873. // Header returns an http.Header that can be modified by the caller to
  4874. // add HTTP headers to the request.
  4875. func (c *CatalogsProductsVersionsPatchCall) Header() http.Header {
  4876. if c.header_ == nil {
  4877. c.header_ = make(http.Header)
  4878. }
  4879. return c.header_
  4880. }
  4881. func (c *CatalogsProductsVersionsPatchCall) doRequest(alt string) (*http.Response, error) {
  4882. reqHeaders := make(http.Header)
  4883. for k, v := range c.header_ {
  4884. reqHeaders[k] = v
  4885. }
  4886. reqHeaders.Set("User-Agent", c.s.userAgent())
  4887. var body io.Reader = nil
  4888. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudprivatecatalogproducerv1beta1version)
  4889. if err != nil {
  4890. return nil, err
  4891. }
  4892. reqHeaders.Set("Content-Type", "application/json")
  4893. c.urlParams_.Set("alt", alt)
  4894. c.urlParams_.Set("prettyPrint", "false")
  4895. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  4896. urls += "?" + c.urlParams_.Encode()
  4897. req, err := http.NewRequest("PATCH", urls, body)
  4898. if err != nil {
  4899. return nil, err
  4900. }
  4901. req.Header = reqHeaders
  4902. googleapi.Expand(req.URL, map[string]string{
  4903. "name": c.nameid,
  4904. })
  4905. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4906. }
  4907. // Do executes the "cloudprivatecatalogproducer.catalogs.products.versions.patch" call.
  4908. // Exactly one of *GoogleCloudPrivatecatalogproducerV1beta1Version or
  4909. // error will be non-nil. Any non-2xx status code is an error. Response
  4910. // headers are in either
  4911. // *GoogleCloudPrivatecatalogproducerV1beta1Version.ServerResponse.Header
  4912. // or (if a response was returned at all) in
  4913. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4914. // whether the returned error was because http.StatusNotModified was
  4915. // returned.
  4916. func (c *CatalogsProductsVersionsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPrivatecatalogproducerV1beta1Version, error) {
  4917. gensupport.SetOptions(c.urlParams_, opts...)
  4918. res, err := c.doRequest("json")
  4919. if res != nil && res.StatusCode == http.StatusNotModified {
  4920. if res.Body != nil {
  4921. res.Body.Close()
  4922. }
  4923. return nil, &googleapi.Error{
  4924. Code: res.StatusCode,
  4925. Header: res.Header,
  4926. }
  4927. }
  4928. if err != nil {
  4929. return nil, err
  4930. }
  4931. defer googleapi.CloseBody(res)
  4932. if err := googleapi.CheckResponse(res); err != nil {
  4933. return nil, err
  4934. }
  4935. ret := &GoogleCloudPrivatecatalogproducerV1beta1Version{
  4936. ServerResponse: googleapi.ServerResponse{
  4937. Header: res.Header,
  4938. HTTPStatusCode: res.StatusCode,
  4939. },
  4940. }
  4941. target := &ret
  4942. if err := gensupport.DecodeResponse(target, res); err != nil {
  4943. return nil, err
  4944. }
  4945. return ret, nil
  4946. // {
  4947. // "description": "Updates a specific Version resource.",
  4948. // "flatPath": "v1beta1/catalogs/{catalogsId}/products/{productsId}/versions/{versionsId}",
  4949. // "httpMethod": "PATCH",
  4950. // "id": "cloudprivatecatalogproducer.catalogs.products.versions.patch",
  4951. // "parameterOrder": [
  4952. // "name"
  4953. // ],
  4954. // "parameters": {
  4955. // "name": {
  4956. // "description": "Required. The resource name of the version, in the format\n`catalogs/{catalog_id}/products/{product_id}/versions/a-z*[a-z0-9]'.\n\nA unique identifier for the version under a product, which can't\nbe changed after the version is created. The final segment of the name must\nbetween 1 and 63 characters in length.",
  4957. // "location": "path",
  4958. // "pattern": "^catalogs/[^/]+/products/[^/]+/versions/[^/]+$",
  4959. // "required": true,
  4960. // "type": "string"
  4961. // },
  4962. // "updateMask": {
  4963. // "description": "Field mask that controls which fields of the version should be updated.",
  4964. // "format": "google-fieldmask",
  4965. // "location": "query",
  4966. // "type": "string"
  4967. // }
  4968. // },
  4969. // "path": "v1beta1/{+name}",
  4970. // "request": {
  4971. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Version"
  4972. // },
  4973. // "response": {
  4974. // "$ref": "GoogleCloudPrivatecatalogproducerV1beta1Version"
  4975. // },
  4976. // "scopes": [
  4977. // "https://www.googleapis.com/auth/cloud-platform"
  4978. // ]
  4979. // }
  4980. }
  4981. // method id "cloudprivatecatalogproducer.operations.cancel":
  4982. type OperationsCancelCall struct {
  4983. s *Service
  4984. name string
  4985. googlelongrunningcanceloperationrequest *GoogleLongrunningCancelOperationRequest
  4986. urlParams_ gensupport.URLParams
  4987. ctx_ context.Context
  4988. header_ http.Header
  4989. }
  4990. // Cancel: Starts asynchronous cancellation on a long-running operation.
  4991. // The server
  4992. // makes a best effort to cancel the operation, but success is
  4993. // not
  4994. // guaranteed. If the server doesn't support this method, it
  4995. // returns
  4996. // `google.rpc.Code.UNIMPLEMENTED`. Clients can
  4997. // use
  4998. // Operations.GetOperation or
  4999. // other methods to check whether the cancellation succeeded or whether
  5000. // the
  5001. // operation completed despite cancellation. On successful
  5002. // cancellation,
  5003. // the operation is not deleted; instead, it becomes an operation
  5004. // with
  5005. // an Operation.error value with a google.rpc.Status.code of
  5006. // 1,
  5007. // corresponding to `Code.CANCELLED`.
  5008. func (r *OperationsService) Cancel(name string, googlelongrunningcanceloperationrequest *GoogleLongrunningCancelOperationRequest) *OperationsCancelCall {
  5009. c := &OperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5010. c.name = name
  5011. c.googlelongrunningcanceloperationrequest = googlelongrunningcanceloperationrequest
  5012. return c
  5013. }
  5014. // Fields allows partial responses to be retrieved. See
  5015. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5016. // for more information.
  5017. func (c *OperationsCancelCall) Fields(s ...googleapi.Field) *OperationsCancelCall {
  5018. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5019. return c
  5020. }
  5021. // Context sets the context to be used in this call's Do method. Any
  5022. // pending HTTP request will be aborted if the provided context is
  5023. // canceled.
  5024. func (c *OperationsCancelCall) Context(ctx context.Context) *OperationsCancelCall {
  5025. c.ctx_ = ctx
  5026. return c
  5027. }
  5028. // Header returns an http.Header that can be modified by the caller to
  5029. // add HTTP headers to the request.
  5030. func (c *OperationsCancelCall) Header() http.Header {
  5031. if c.header_ == nil {
  5032. c.header_ = make(http.Header)
  5033. }
  5034. return c.header_
  5035. }
  5036. func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  5037. reqHeaders := make(http.Header)
  5038. for k, v := range c.header_ {
  5039. reqHeaders[k] = v
  5040. }
  5041. reqHeaders.Set("User-Agent", c.s.userAgent())
  5042. var body io.Reader = nil
  5043. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest)
  5044. if err != nil {
  5045. return nil, err
  5046. }
  5047. reqHeaders.Set("Content-Type", "application/json")
  5048. c.urlParams_.Set("alt", alt)
  5049. c.urlParams_.Set("prettyPrint", "false")
  5050. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel")
  5051. urls += "?" + c.urlParams_.Encode()
  5052. req, err := http.NewRequest("POST", urls, body)
  5053. if err != nil {
  5054. return nil, err
  5055. }
  5056. req.Header = reqHeaders
  5057. googleapi.Expand(req.URL, map[string]string{
  5058. "name": c.name,
  5059. })
  5060. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5061. }
  5062. // Do executes the "cloudprivatecatalogproducer.operations.cancel" call.
  5063. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  5064. // non-2xx status code is an error. Response headers are in either
  5065. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  5066. // returned at all) in error.(*googleapi.Error).Header. Use
  5067. // googleapi.IsNotModified to check whether the returned error was
  5068. // because http.StatusNotModified was returned.
  5069. func (c *OperationsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  5070. gensupport.SetOptions(c.urlParams_, opts...)
  5071. res, err := c.doRequest("json")
  5072. if res != nil && res.StatusCode == http.StatusNotModified {
  5073. if res.Body != nil {
  5074. res.Body.Close()
  5075. }
  5076. return nil, &googleapi.Error{
  5077. Code: res.StatusCode,
  5078. Header: res.Header,
  5079. }
  5080. }
  5081. if err != nil {
  5082. return nil, err
  5083. }
  5084. defer googleapi.CloseBody(res)
  5085. if err := googleapi.CheckResponse(res); err != nil {
  5086. return nil, err
  5087. }
  5088. ret := &GoogleProtobufEmpty{
  5089. ServerResponse: googleapi.ServerResponse{
  5090. Header: res.Header,
  5091. HTTPStatusCode: res.StatusCode,
  5092. },
  5093. }
  5094. target := &ret
  5095. if err := gensupport.DecodeResponse(target, res); err != nil {
  5096. return nil, err
  5097. }
  5098. return ret, nil
  5099. // {
  5100. // "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.",
  5101. // "flatPath": "v1beta1/operations/{operationsId}:cancel",
  5102. // "httpMethod": "POST",
  5103. // "id": "cloudprivatecatalogproducer.operations.cancel",
  5104. // "parameterOrder": [
  5105. // "name"
  5106. // ],
  5107. // "parameters": {
  5108. // "name": {
  5109. // "description": "The name of the operation resource to be cancelled.",
  5110. // "location": "path",
  5111. // "pattern": "^operations/[^/]+$",
  5112. // "required": true,
  5113. // "type": "string"
  5114. // }
  5115. // },
  5116. // "path": "v1beta1/{+name}:cancel",
  5117. // "request": {
  5118. // "$ref": "GoogleLongrunningCancelOperationRequest"
  5119. // },
  5120. // "response": {
  5121. // "$ref": "GoogleProtobufEmpty"
  5122. // },
  5123. // "scopes": [
  5124. // "https://www.googleapis.com/auth/cloud-platform"
  5125. // ]
  5126. // }
  5127. }
  5128. // method id "cloudprivatecatalogproducer.operations.delete":
  5129. type OperationsDeleteCall struct {
  5130. s *Service
  5131. name string
  5132. urlParams_ gensupport.URLParams
  5133. ctx_ context.Context
  5134. header_ http.Header
  5135. }
  5136. // Delete: Deletes a long-running operation. This method indicates that
  5137. // the client is
  5138. // no longer interested in the operation result. It does not cancel
  5139. // the
  5140. // operation. If the server doesn't support this method, it
  5141. // returns
  5142. // `google.rpc.Code.UNIMPLEMENTED`.
  5143. func (r *OperationsService) Delete(name string) *OperationsDeleteCall {
  5144. c := &OperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5145. c.name = name
  5146. return c
  5147. }
  5148. // Fields allows partial responses to be retrieved. See
  5149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5150. // for more information.
  5151. func (c *OperationsDeleteCall) Fields(s ...googleapi.Field) *OperationsDeleteCall {
  5152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5153. return c
  5154. }
  5155. // Context sets the context to be used in this call's Do method. Any
  5156. // pending HTTP request will be aborted if the provided context is
  5157. // canceled.
  5158. func (c *OperationsDeleteCall) Context(ctx context.Context) *OperationsDeleteCall {
  5159. c.ctx_ = ctx
  5160. return c
  5161. }
  5162. // Header returns an http.Header that can be modified by the caller to
  5163. // add HTTP headers to the request.
  5164. func (c *OperationsDeleteCall) Header() http.Header {
  5165. if c.header_ == nil {
  5166. c.header_ = make(http.Header)
  5167. }
  5168. return c.header_
  5169. }
  5170. func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  5171. reqHeaders := make(http.Header)
  5172. for k, v := range c.header_ {
  5173. reqHeaders[k] = v
  5174. }
  5175. reqHeaders.Set("User-Agent", c.s.userAgent())
  5176. var body io.Reader = nil
  5177. c.urlParams_.Set("alt", alt)
  5178. c.urlParams_.Set("prettyPrint", "false")
  5179. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  5180. urls += "?" + c.urlParams_.Encode()
  5181. req, err := http.NewRequest("DELETE", urls, body)
  5182. if err != nil {
  5183. return nil, err
  5184. }
  5185. req.Header = reqHeaders
  5186. googleapi.Expand(req.URL, map[string]string{
  5187. "name": c.name,
  5188. })
  5189. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5190. }
  5191. // Do executes the "cloudprivatecatalogproducer.operations.delete" call.
  5192. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  5193. // non-2xx status code is an error. Response headers are in either
  5194. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  5195. // returned at all) in error.(*googleapi.Error).Header. Use
  5196. // googleapi.IsNotModified to check whether the returned error was
  5197. // because http.StatusNotModified was returned.
  5198. func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  5199. gensupport.SetOptions(c.urlParams_, opts...)
  5200. res, err := c.doRequest("json")
  5201. if res != nil && res.StatusCode == http.StatusNotModified {
  5202. if res.Body != nil {
  5203. res.Body.Close()
  5204. }
  5205. return nil, &googleapi.Error{
  5206. Code: res.StatusCode,
  5207. Header: res.Header,
  5208. }
  5209. }
  5210. if err != nil {
  5211. return nil, err
  5212. }
  5213. defer googleapi.CloseBody(res)
  5214. if err := googleapi.CheckResponse(res); err != nil {
  5215. return nil, err
  5216. }
  5217. ret := &GoogleProtobufEmpty{
  5218. ServerResponse: googleapi.ServerResponse{
  5219. Header: res.Header,
  5220. HTTPStatusCode: res.StatusCode,
  5221. },
  5222. }
  5223. target := &ret
  5224. if err := gensupport.DecodeResponse(target, res); err != nil {
  5225. return nil, err
  5226. }
  5227. return ret, nil
  5228. // {
  5229. // "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.",
  5230. // "flatPath": "v1beta1/operations/{operationsId}",
  5231. // "httpMethod": "DELETE",
  5232. // "id": "cloudprivatecatalogproducer.operations.delete",
  5233. // "parameterOrder": [
  5234. // "name"
  5235. // ],
  5236. // "parameters": {
  5237. // "name": {
  5238. // "description": "The name of the operation resource to be deleted.",
  5239. // "location": "path",
  5240. // "pattern": "^operations/[^/]+$",
  5241. // "required": true,
  5242. // "type": "string"
  5243. // }
  5244. // },
  5245. // "path": "v1beta1/{+name}",
  5246. // "response": {
  5247. // "$ref": "GoogleProtobufEmpty"
  5248. // },
  5249. // "scopes": [
  5250. // "https://www.googleapis.com/auth/cloud-platform"
  5251. // ]
  5252. // }
  5253. }
  5254. // method id "cloudprivatecatalogproducer.operations.get":
  5255. type OperationsGetCall struct {
  5256. s *Service
  5257. name string
  5258. urlParams_ gensupport.URLParams
  5259. ifNoneMatch_ string
  5260. ctx_ context.Context
  5261. header_ http.Header
  5262. }
  5263. // Get: Gets the latest state of a long-running operation. Clients can
  5264. // use this
  5265. // method to poll the operation result at intervals as recommended by
  5266. // the API
  5267. // service.
  5268. func (r *OperationsService) Get(name string) *OperationsGetCall {
  5269. c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5270. c.name = name
  5271. return c
  5272. }
  5273. // Fields allows partial responses to be retrieved. See
  5274. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5275. // for more information.
  5276. func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
  5277. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5278. return c
  5279. }
  5280. // IfNoneMatch sets the optional parameter which makes the operation
  5281. // fail if the object's ETag matches the given value. This is useful for
  5282. // getting updates only after the object has changed since the last
  5283. // request. Use googleapi.IsNotModified to check whether the response
  5284. // error from Do is the result of In-None-Match.
  5285. func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
  5286. c.ifNoneMatch_ = entityTag
  5287. return c
  5288. }
  5289. // Context sets the context to be used in this call's Do method. Any
  5290. // pending HTTP request will be aborted if the provided context is
  5291. // canceled.
  5292. func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
  5293. c.ctx_ = ctx
  5294. return c
  5295. }
  5296. // Header returns an http.Header that can be modified by the caller to
  5297. // add HTTP headers to the request.
  5298. func (c *OperationsGetCall) Header() http.Header {
  5299. if c.header_ == nil {
  5300. c.header_ = make(http.Header)
  5301. }
  5302. return c.header_
  5303. }
  5304. func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
  5305. reqHeaders := make(http.Header)
  5306. for k, v := range c.header_ {
  5307. reqHeaders[k] = v
  5308. }
  5309. reqHeaders.Set("User-Agent", c.s.userAgent())
  5310. if c.ifNoneMatch_ != "" {
  5311. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5312. }
  5313. var body io.Reader = nil
  5314. c.urlParams_.Set("alt", alt)
  5315. c.urlParams_.Set("prettyPrint", "false")
  5316. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
  5317. urls += "?" + c.urlParams_.Encode()
  5318. req, err := http.NewRequest("GET", urls, body)
  5319. if err != nil {
  5320. return nil, err
  5321. }
  5322. req.Header = reqHeaders
  5323. googleapi.Expand(req.URL, map[string]string{
  5324. "name": c.name,
  5325. })
  5326. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5327. }
  5328. // Do executes the "cloudprivatecatalogproducer.operations.get" call.
  5329. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  5330. // Any non-2xx status code is an error. Response headers are in either
  5331. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  5332. // was returned at all) in error.(*googleapi.Error).Header. Use
  5333. // googleapi.IsNotModified to check whether the returned error was
  5334. // because http.StatusNotModified was returned.
  5335. func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  5336. gensupport.SetOptions(c.urlParams_, opts...)
  5337. res, err := c.doRequest("json")
  5338. if res != nil && res.StatusCode == http.StatusNotModified {
  5339. if res.Body != nil {
  5340. res.Body.Close()
  5341. }
  5342. return nil, &googleapi.Error{
  5343. Code: res.StatusCode,
  5344. Header: res.Header,
  5345. }
  5346. }
  5347. if err != nil {
  5348. return nil, err
  5349. }
  5350. defer googleapi.CloseBody(res)
  5351. if err := googleapi.CheckResponse(res); err != nil {
  5352. return nil, err
  5353. }
  5354. ret := &GoogleLongrunningOperation{
  5355. ServerResponse: googleapi.ServerResponse{
  5356. Header: res.Header,
  5357. HTTPStatusCode: res.StatusCode,
  5358. },
  5359. }
  5360. target := &ret
  5361. if err := gensupport.DecodeResponse(target, res); err != nil {
  5362. return nil, err
  5363. }
  5364. return ret, nil
  5365. // {
  5366. // "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.",
  5367. // "flatPath": "v1beta1/operations/{operationsId}",
  5368. // "httpMethod": "GET",
  5369. // "id": "cloudprivatecatalogproducer.operations.get",
  5370. // "parameterOrder": [
  5371. // "name"
  5372. // ],
  5373. // "parameters": {
  5374. // "name": {
  5375. // "description": "The name of the operation resource.",
  5376. // "location": "path",
  5377. // "pattern": "^operations/[^/]+$",
  5378. // "required": true,
  5379. // "type": "string"
  5380. // }
  5381. // },
  5382. // "path": "v1beta1/{+name}",
  5383. // "response": {
  5384. // "$ref": "GoogleLongrunningOperation"
  5385. // },
  5386. // "scopes": [
  5387. // "https://www.googleapis.com/auth/cloud-platform"
  5388. // ]
  5389. // }
  5390. }
  5391. // method id "cloudprivatecatalogproducer.operations.list":
  5392. type OperationsListCall struct {
  5393. s *Service
  5394. urlParams_ gensupport.URLParams
  5395. ifNoneMatch_ string
  5396. ctx_ context.Context
  5397. header_ http.Header
  5398. }
  5399. // List: Lists operations that match the specified filter in the
  5400. // request. If the
  5401. // server doesn't support this method, it returns
  5402. // `UNIMPLEMENTED`.
  5403. //
  5404. // NOTE: the `name` binding allows API services to override the
  5405. // binding
  5406. // to use different resource name schemes, such as `users/*/operations`.
  5407. // To
  5408. // override the binding, API services can add a binding such
  5409. // as
  5410. // "/v1/{name=users/*}/operations" to their service configuration.
  5411. // For backwards compatibility, the default name includes the
  5412. // operations
  5413. // collection id, however overriding users must ensure the name
  5414. // binding
  5415. // is the parent resource, without the operations collection id.
  5416. func (r *OperationsService) List() *OperationsListCall {
  5417. c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5418. return c
  5419. }
  5420. // Filter sets the optional parameter "filter": The standard list
  5421. // filter.
  5422. func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
  5423. c.urlParams_.Set("filter", filter)
  5424. return c
  5425. }
  5426. // Name sets the optional parameter "name": The name of the operation's
  5427. // parent resource.
  5428. func (c *OperationsListCall) Name(name string) *OperationsListCall {
  5429. c.urlParams_.Set("name", name)
  5430. return c
  5431. }
  5432. // PageSize sets the optional parameter "pageSize": The standard list
  5433. // page size.
  5434. func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall {
  5435. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5436. return c
  5437. }
  5438. // PageToken sets the optional parameter "pageToken": The standard list
  5439. // page token.
  5440. func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
  5441. c.urlParams_.Set("pageToken", pageToken)
  5442. return c
  5443. }
  5444. // Fields allows partial responses to be retrieved. See
  5445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5446. // for more information.
  5447. func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
  5448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5449. return c
  5450. }
  5451. // IfNoneMatch sets the optional parameter which makes the operation
  5452. // fail if the object's ETag matches the given value. This is useful for
  5453. // getting updates only after the object has changed since the last
  5454. // request. Use googleapi.IsNotModified to check whether the response
  5455. // error from Do is the result of In-None-Match.
  5456. func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
  5457. c.ifNoneMatch_ = entityTag
  5458. return c
  5459. }
  5460. // Context sets the context to be used in this call's Do method. Any
  5461. // pending HTTP request will be aborted if the provided context is
  5462. // canceled.
  5463. func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
  5464. c.ctx_ = ctx
  5465. return c
  5466. }
  5467. // Header returns an http.Header that can be modified by the caller to
  5468. // add HTTP headers to the request.
  5469. func (c *OperationsListCall) Header() http.Header {
  5470. if c.header_ == nil {
  5471. c.header_ = make(http.Header)
  5472. }
  5473. return c.header_
  5474. }
  5475. func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
  5476. reqHeaders := make(http.Header)
  5477. for k, v := range c.header_ {
  5478. reqHeaders[k] = v
  5479. }
  5480. reqHeaders.Set("User-Agent", c.s.userAgent())
  5481. if c.ifNoneMatch_ != "" {
  5482. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5483. }
  5484. var body io.Reader = nil
  5485. c.urlParams_.Set("alt", alt)
  5486. c.urlParams_.Set("prettyPrint", "false")
  5487. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/operations")
  5488. urls += "?" + c.urlParams_.Encode()
  5489. req, err := http.NewRequest("GET", urls, body)
  5490. if err != nil {
  5491. return nil, err
  5492. }
  5493. req.Header = reqHeaders
  5494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5495. }
  5496. // Do executes the "cloudprivatecatalogproducer.operations.list" call.
  5497. // Exactly one of *GoogleLongrunningListOperationsResponse or error will
  5498. // be non-nil. Any non-2xx status code is an error. Response headers are
  5499. // in either
  5500. // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if
  5501. // a response was returned at all) in error.(*googleapi.Error).Header.
  5502. // Use googleapi.IsNotModified to check whether the returned error was
  5503. // because http.StatusNotModified was returned.
  5504. func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
  5505. gensupport.SetOptions(c.urlParams_, opts...)
  5506. res, err := c.doRequest("json")
  5507. if res != nil && res.StatusCode == http.StatusNotModified {
  5508. if res.Body != nil {
  5509. res.Body.Close()
  5510. }
  5511. return nil, &googleapi.Error{
  5512. Code: res.StatusCode,
  5513. Header: res.Header,
  5514. }
  5515. }
  5516. if err != nil {
  5517. return nil, err
  5518. }
  5519. defer googleapi.CloseBody(res)
  5520. if err := googleapi.CheckResponse(res); err != nil {
  5521. return nil, err
  5522. }
  5523. ret := &GoogleLongrunningListOperationsResponse{
  5524. ServerResponse: googleapi.ServerResponse{
  5525. Header: res.Header,
  5526. HTTPStatusCode: res.StatusCode,
  5527. },
  5528. }
  5529. target := &ret
  5530. if err := gensupport.DecodeResponse(target, res); err != nil {
  5531. return nil, err
  5532. }
  5533. return ret, nil
  5534. // {
  5535. // "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.",
  5536. // "flatPath": "v1beta1/operations",
  5537. // "httpMethod": "GET",
  5538. // "id": "cloudprivatecatalogproducer.operations.list",
  5539. // "parameterOrder": [],
  5540. // "parameters": {
  5541. // "filter": {
  5542. // "description": "The standard list filter.",
  5543. // "location": "query",
  5544. // "type": "string"
  5545. // },
  5546. // "name": {
  5547. // "description": "The name of the operation's parent resource.",
  5548. // "location": "query",
  5549. // "type": "string"
  5550. // },
  5551. // "pageSize": {
  5552. // "description": "The standard list page size.",
  5553. // "format": "int32",
  5554. // "location": "query",
  5555. // "type": "integer"
  5556. // },
  5557. // "pageToken": {
  5558. // "description": "The standard list page token.",
  5559. // "location": "query",
  5560. // "type": "string"
  5561. // }
  5562. // },
  5563. // "path": "v1beta1/operations",
  5564. // "response": {
  5565. // "$ref": "GoogleLongrunningListOperationsResponse"
  5566. // },
  5567. // "scopes": [
  5568. // "https://www.googleapis.com/auth/cloud-platform"
  5569. // ]
  5570. // }
  5571. }
  5572. // Pages invokes f for each page of results.
  5573. // A non-nil error returned from f will halt the iteration.
  5574. // The provided context supersedes any context provided to the Context method.
  5575. func (c *OperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
  5576. c.ctx_ = ctx
  5577. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5578. for {
  5579. x, err := c.Do()
  5580. if err != nil {
  5581. return err
  5582. }
  5583. if err := f(x); err != nil {
  5584. return err
  5585. }
  5586. if x.NextPageToken == "" {
  5587. return nil
  5588. }
  5589. c.PageToken(x.NextPageToken)
  5590. }
  5591. }