Debian Codegraph @

cloudprivatecatalogproducer/v1beta1/cloudprivatecatalogproducer-gen.go

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