Debian Codegraph @

apigeeregistry/v1/apigeeregistry-gen.go

raw symbols SCIP
1 // Copyright 2026 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 apigeeregistry provides access to the Apigee Registry API.
8 //
9 // For product documentation, see: https://cloud.google.com/apigee/docs/api-hub/what-is-api-hub
10 //
11 // # Library status
12 //
13 // These client libraries are officially supported by Google. However, this
14 // library is considered complete and is in maintenance mode. This means
15 // that we will address critical bugs and security issues but will not add
16 // any new features.
17 //
18 // When possible, we recommend using our newer
19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
20 // that are still actively being worked and iterated on.
21 //
22 // # Creating a client
23 //
24 // Usage example:
25 //
26 // import "google.golang.org/api/apigeeregistry/v1"
27 // ...
28 // ctx := context.Background()
29 // apigeeregistryService, err := apigeeregistry.NewService(ctx)
30 //
31 // In this example, Google Application Default Credentials are used for
32 // authentication. For information on how to create and obtain Application
33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
34 //
35 // # Other authentication options
36 //
37 // To use an API key for authentication (note: some APIs do not support API
38 // keys), use [google.golang.org/api/option.WithAPIKey]:
39 //
40 // apigeeregistryService, err := apigeeregistry.NewService(ctx, option.WithAPIKey("AIza..."))
41 //
42 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
43 // flow, use [google.golang.org/api/option.WithTokenSource]:
44 //
45 // config := &oauth2.Config{...}
46 // // ...
47 // token, err := config.Exchange(ctx, ...)
48 // apigeeregistryService, err := apigeeregistry.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
49 //
50 // See [google.golang.org/api/option.ClientOption] for details on options.
51 package apigeeregistry // import "google.golang.org/api/apigeeregistry/v1"
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "log/slog"
61 "net/http"
62 "net/url"
63 "strconv"
64 "strings"
65
66 "github.com/googleapis/gax-go/v2/internallog"
67 googleapi "google.golang.org/api/googleapi"
68 internal "google.golang.org/api/internal"
69 gensupport "google.golang.org/api/internal/gensupport"
70 option "google.golang.org/api/option"
71 internaloption "google.golang.org/api/option/internaloption"
72 htransport "google.golang.org/api/transport/http"
73 )
74
75 // Always reference these packages, just in case the auto-generated code
76 // below doesn't.
77 var _ = bytes.NewBuffer
78 var _ = strconv.Itoa
79 var _ = fmt.Sprintf
80 var _ = json.NewDecoder
81 var _ = io.Copy
82 var _ = url.Parse
83 var _ = gensupport.MarshalJSON
84 var _ = googleapi.Version
85 var _ = errors.New
86 var _ = strings.Replace
87 var _ = context.Canceled
88 var _ = internaloption.WithDefaultEndpoint
89 var _ = internal.Version
90 var _ = internallog.New
91
92 const apiId = "apigeeregistry:v1"
93 const apiName = "apigeeregistry"
94 const apiVersion = "v1"
95 const basePath = "https://apigeeregistry.googleapis.com/"
96 const basePathTemplate = "https://apigeeregistry.UNIVERSE_DOMAIN/"
97 const mtlsBasePath = "https://apigeeregistry.mtls.googleapis.com/"
98
99 // OAuth2 scopes used by this API.
100 const (
101 // See, edit, configure, and delete your Google Cloud data and see the email
102 // address for your Google Account.
103 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
104 )
105
106 // NewService creates a new Service.
107 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
108 scopesOption := internaloption.WithDefaultScopes(
109 "https://www.googleapis.com/auth/cloud-platform",
110 )
111 // NOTE: prepend, so we don't override user-specified scopes.
112 opts = append([]option.ClientOption{scopesOption}, opts...)
113 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
114 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
115 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
116 opts = append(opts, internaloption.EnableNewAuthLibrary())
117 client, endpoint, err := htransport.NewClient(ctx, opts...)
118 if err != nil {
119 return nil, err
120 }
121 s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
122 s.Projects = NewProjectsService(s)
123 if endpoint != "" {
124 s.BasePath = endpoint
125 }
126 return s, nil
127 }
128
129 // New creates a new Service. It uses the provided http.Client for requests.
130 //
131 // Deprecated: please use NewService instead.
132 // To provide a custom HTTP client, use option.WithHTTPClient.
133 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
134 func New(client *http.Client) (*Service, error) {
135 if client == nil {
136 return nil, errors.New("client is nil")
137 }
138 return NewService(context.TODO(), option.WithHTTPClient(client))
139 }
140
141 type Service struct {
142 client *http.Client
143 logger *slog.Logger
144 BasePath string // API endpoint base URL
145 UserAgent string // optional additional User-Agent fragment
146
147 Projects *ProjectsService
148 }
149
150 func (s *Service) userAgent() string {
151 if s.UserAgent == "" {
152 return googleapi.UserAgent
153 }
154 return googleapi.UserAgent + " " + s.UserAgent
155 }
156
157 func NewProjectsService(s *Service) *ProjectsService {
158 rs := &ProjectsService{s: s}
159 rs.Locations = NewProjectsLocationsService(s)
160 return rs
161 }
162
163 type ProjectsService struct {
164 s *Service
165
166 Locations *ProjectsLocationsService
167 }
168
169 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
170 rs := &ProjectsLocationsService{s: s}
171 rs.Apis = NewProjectsLocationsApisService(s)
172 rs.Artifacts = NewProjectsLocationsArtifactsService(s)
173 rs.Documents = NewProjectsLocationsDocumentsService(s)
174 rs.Instances = NewProjectsLocationsInstancesService(s)
175 rs.Operations = NewProjectsLocationsOperationsService(s)
176 rs.Runtime = NewProjectsLocationsRuntimeService(s)
177 return rs
178 }
179
180 type ProjectsLocationsService struct {
181 s *Service
182
183 Apis *ProjectsLocationsApisService
184
185 Artifacts *ProjectsLocationsArtifactsService
186
187 Documents *ProjectsLocationsDocumentsService
188
189 Instances *ProjectsLocationsInstancesService
190
191 Operations *ProjectsLocationsOperationsService
192
193 Runtime *ProjectsLocationsRuntimeService
194 }
195
196 func NewProjectsLocationsApisService(s *Service) *ProjectsLocationsApisService {
197 rs := &ProjectsLocationsApisService{s: s}
198 rs.Artifacts = NewProjectsLocationsApisArtifactsService(s)
199 rs.Deployments = NewProjectsLocationsApisDeploymentsService(s)
200 rs.Versions = NewProjectsLocationsApisVersionsService(s)
201 return rs
202 }
203
204 type ProjectsLocationsApisService struct {
205 s *Service
206
207 Artifacts *ProjectsLocationsApisArtifactsService
208
209 Deployments *ProjectsLocationsApisDeploymentsService
210
211 Versions *ProjectsLocationsApisVersionsService
212 }
213
214 func NewProjectsLocationsApisArtifactsService(s *Service) *ProjectsLocationsApisArtifactsService {
215 rs := &ProjectsLocationsApisArtifactsService{s: s}
216 return rs
217 }
218
219 type ProjectsLocationsApisArtifactsService struct {
220 s *Service
221 }
222
223 func NewProjectsLocationsApisDeploymentsService(s *Service) *ProjectsLocationsApisDeploymentsService {
224 rs := &ProjectsLocationsApisDeploymentsService{s: s}
225 rs.Artifacts = NewProjectsLocationsApisDeploymentsArtifactsService(s)
226 return rs
227 }
228
229 type ProjectsLocationsApisDeploymentsService struct {
230 s *Service
231
232 Artifacts *ProjectsLocationsApisDeploymentsArtifactsService
233 }
234
235 func NewProjectsLocationsApisDeploymentsArtifactsService(s *Service) *ProjectsLocationsApisDeploymentsArtifactsService {
236 rs := &ProjectsLocationsApisDeploymentsArtifactsService{s: s}
237 return rs
238 }
239
240 type ProjectsLocationsApisDeploymentsArtifactsService struct {
241 s *Service
242 }
243
244 func NewProjectsLocationsApisVersionsService(s *Service) *ProjectsLocationsApisVersionsService {
245 rs := &ProjectsLocationsApisVersionsService{s: s}
246 rs.Artifacts = NewProjectsLocationsApisVersionsArtifactsService(s)
247 rs.Specs = NewProjectsLocationsApisVersionsSpecsService(s)
248 return rs
249 }
250
251 type ProjectsLocationsApisVersionsService struct {
252 s *Service
253
254 Artifacts *ProjectsLocationsApisVersionsArtifactsService
255
256 Specs *ProjectsLocationsApisVersionsSpecsService
257 }
258
259 func NewProjectsLocationsApisVersionsArtifactsService(s *Service) *ProjectsLocationsApisVersionsArtifactsService {
260 rs := &ProjectsLocationsApisVersionsArtifactsService{s: s}
261 return rs
262 }
263
264 type ProjectsLocationsApisVersionsArtifactsService struct {
265 s *Service
266 }
267
268 func NewProjectsLocationsApisVersionsSpecsService(s *Service) *ProjectsLocationsApisVersionsSpecsService {
269 rs := &ProjectsLocationsApisVersionsSpecsService{s: s}
270 rs.Artifacts = NewProjectsLocationsApisVersionsSpecsArtifactsService(s)
271 return rs
272 }
273
274 type ProjectsLocationsApisVersionsSpecsService struct {
275 s *Service
276
277 Artifacts *ProjectsLocationsApisVersionsSpecsArtifactsService
278 }
279
280 func NewProjectsLocationsApisVersionsSpecsArtifactsService(s *Service) *ProjectsLocationsApisVersionsSpecsArtifactsService {
281 rs := &ProjectsLocationsApisVersionsSpecsArtifactsService{s: s}
282 return rs
283 }
284
285 type ProjectsLocationsApisVersionsSpecsArtifactsService struct {
286 s *Service
287 }
288
289 func NewProjectsLocationsArtifactsService(s *Service) *ProjectsLocationsArtifactsService {
290 rs := &ProjectsLocationsArtifactsService{s: s}
291 return rs
292 }
293
294 type ProjectsLocationsArtifactsService struct {
295 s *Service
296 }
297
298 func NewProjectsLocationsDocumentsService(s *Service) *ProjectsLocationsDocumentsService {
299 rs := &ProjectsLocationsDocumentsService{s: s}
300 return rs
301 }
302
303 type ProjectsLocationsDocumentsService struct {
304 s *Service
305 }
306
307 func NewProjectsLocationsInstancesService(s *Service) *ProjectsLocationsInstancesService {
308 rs := &ProjectsLocationsInstancesService{s: s}
309 return rs
310 }
311
312 type ProjectsLocationsInstancesService struct {
313 s *Service
314 }
315
316 func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
317 rs := &ProjectsLocationsOperationsService{s: s}
318 return rs
319 }
320
321 type ProjectsLocationsOperationsService struct {
322 s *Service
323 }
324
325 func NewProjectsLocationsRuntimeService(s *Service) *ProjectsLocationsRuntimeService {
326 rs := &ProjectsLocationsRuntimeService{s: s}
327 return rs
328 }
329
330 type ProjectsLocationsRuntimeService struct {
331 s *Service
332 }
333
334 // Api: A top-level description of an API. Produced by producers and are
335 // commitments to provide services.
336 type Api struct {
337 // Annotations: Annotations attach non-identifying metadata to resources.
338 // Annotation keys and values are less restricted than those of labels, but
339 // should be generally used for small values of broad interest. Larger, topic-
340 // specific metadata should be stored in Artifacts.
341 Annotations map[string]string `json:"annotations,omitempty"`
342 // Availability: A user-definable description of the availability of this
343 // service. Format: free-form, but we expect single words that describe
344 // availability, e.g., "NONE", "TESTING", "PREVIEW", "GENERAL", "DEPRECATED",
345 // "SHUTDOWN".
346 Availability string `json:"availability,omitempty"`
347 // CreateTime: Output only. Creation timestamp.
348 CreateTime string `json:"createTime,omitempty"`
349 // Description: A detailed description.
350 Description string `json:"description,omitempty"`
351 // DisplayName: Human-meaningful name.
352 DisplayName string `json:"displayName,omitempty"`
353 // Labels: Labels attach identifying metadata to resources. Identifying
354 // metadata can be used to filter list operations. Label keys and values can be
355 // no longer than 64 characters (Unicode codepoints), can only contain
356 // lowercase letters, numeric characters, underscores, and dashes.
357 // International characters are allowed. No more than 64 user labels can be
358 // associated with one resource (System labels are excluded). See
359 // https://goo.gl/xmQnxf for more information and examples of labels. System
360 // reserved label keys are prefixed with `apigeeregistry.googleapis.com/` and
361 // cannot be changed.
362 Labels map[string]string `json:"labels,omitempty"`
363 // Name: Resource name.
364 Name string `json:"name,omitempty"`
365 // RecommendedDeployment: The recommended deployment of the API. Format:
366 // `projects/{project}/locations/{location}/apis/{api}/deployments/{deployment}`
367 RecommendedDeployment string `json:"recommendedDeployment,omitempty"`
368 // RecommendedVersion: The recommended version of the API. Format:
369 // `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
370 RecommendedVersion string `json:"recommendedVersion,omitempty"`
371 // UpdateTime: Output only. Last update timestamp.
372 UpdateTime string `json:"updateTime,omitempty"`
373
374 // ServerResponse contains the HTTP response code and headers from the server.
375 googleapi.ServerResponse `json:"-"`
376 // ForceSendFields is a list of field names (e.g. "Annotations") to
377 // unconditionally include in API requests. By default, fields with empty or
378 // default values are omitted from API requests. See
379 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
380 // details.
381 ForceSendFields []string `json:"-"`
382 // NullFields is a list of field names (e.g. "Annotations") to include in API
383 // requests with the JSON null value. By default, fields with empty values are
384 // omitted from API requests. See
385 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
386 NullFields []string `json:"-"`
387 }
388
389 func (s Api) MarshalJSON() ([]byte, error) {
390 type NoMethod Api
391 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
392 }
393
394 // ApiDeployment: Describes a service running at particular address that
395 // provides a particular version of an API. ApiDeployments have revisions which
396 // correspond to different configurations of a single deployment in time.
397 // Revision identifiers should be updated whenever the served API spec or
398 // endpoint address changes.
399 type ApiDeployment struct {
400 // AccessGuidance: Text briefly describing how to access the endpoint. Changes
401 // to this value will not affect the revision.
402 AccessGuidance string `json:"accessGuidance,omitempty"`
403 // Annotations: Annotations attach non-identifying metadata to resources.
404 // Annotation keys and values are less restricted than those of labels, but
405 // should be generally used for small values of broad interest. Larger, topic-
406 // specific metadata should be stored in Artifacts.
407 Annotations map[string]string `json:"annotations,omitempty"`
408 // ApiSpecRevision: The full resource name (including revision ID) of the spec
409 // of the API being served by the deployment. Changes to this value will update
410 // the revision. Format:
411 // `projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/
412 // {spec@revision}`
413 ApiSpecRevision string `json:"apiSpecRevision,omitempty"`
414 // CreateTime: Output only. Creation timestamp; when the deployment resource
415 // was created.
416 CreateTime string `json:"createTime,omitempty"`
417 // Description: A detailed description.
418 Description string `json:"description,omitempty"`
419 // DisplayName: Human-meaningful name.
420 DisplayName string `json:"displayName,omitempty"`
421 // EndpointUri: The address where the deployment is serving. Changes to this
422 // value will update the revision.
423 EndpointUri string `json:"endpointUri,omitempty"`
424 // ExternalChannelUri: The address of the external channel of the API (e.g.,
425 // the Developer Portal). Changes to this value will not affect the revision.
426 ExternalChannelUri string `json:"externalChannelUri,omitempty"`
427 // IntendedAudience: Text briefly identifying the intended audience of the API.
428 // Changes to this value will not affect the revision.
429 IntendedAudience string `json:"intendedAudience,omitempty"`
430 // Labels: Labels attach identifying metadata to resources. Identifying
431 // metadata can be used to filter list operations. Label keys and values can be
432 // no longer than 64 characters (Unicode codepoints), can only contain
433 // lowercase letters, numeric characters, underscores and dashes. International
434 // characters are allowed. No more than 64 user labels can be associated with
435 // one resource (System labels are excluded). See https://goo.gl/xmQnxf for
436 // more information and examples of labels. System reserved label keys are
437 // prefixed with `apigeeregistry.googleapis.com/` and cannot be changed.
438 Labels map[string]string `json:"labels,omitempty"`
439 // Name: Resource name.
440 Name string `json:"name,omitempty"`
441 // RevisionCreateTime: Output only. Revision creation timestamp; when the
442 // represented revision was created.
443 RevisionCreateTime string `json:"revisionCreateTime,omitempty"`
444 // RevisionId: Output only. Immutable. The revision ID of the deployment. A new
445 // revision is committed whenever the deployment contents are changed. The
446 // format is an 8-character hexadecimal string.
447 RevisionId string `json:"revisionId,omitempty"`
448 // RevisionUpdateTime: Output only. Last update timestamp: when the represented
449 // revision was last modified.
450 RevisionUpdateTime string `json:"revisionUpdateTime,omitempty"`
451
452 // ServerResponse contains the HTTP response code and headers from the server.
453 googleapi.ServerResponse `json:"-"`
454 // ForceSendFields is a list of field names (e.g. "AccessGuidance") to
455 // unconditionally include in API requests. By default, fields with empty or
456 // default values are omitted from API requests. See
457 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
458 // details.
459 ForceSendFields []string `json:"-"`
460 // NullFields is a list of field names (e.g. "AccessGuidance") to include in
461 // API requests with the JSON null value. By default, fields with empty values
462 // are omitted from API requests. See
463 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
464 NullFields []string `json:"-"`
465 }
466
467 func (s ApiDeployment) MarshalJSON() ([]byte, error) {
468 type NoMethod ApiDeployment
469 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
470 }
471
472 // ApiSpec: Describes a version of an API in a structured way. ApiSpecs provide
473 // formal descriptions that consumers can use to use a version. ApiSpec
474 // resources are intended to be fully-resolved descriptions of an ApiVersion.
475 // When specs consist of multiple files, these should be bundled together
476 // (e.g., in a zip archive) and stored as a unit. Multiple specs can exist to
477 // provide representations in different API description formats.
478 // Synchronization of these representations would be provided by tooling and
479 // background services.
480 type ApiSpec struct {
481 // Annotations: Annotations attach non-identifying metadata to resources.
482 // Annotation keys and values are less restricted than those of labels, but
483 // should be generally used for small values of broad interest. Larger, topic-
484 // specific metadata should be stored in Artifacts.
485 Annotations map[string]string `json:"annotations,omitempty"`
486 // Contents: Input only. The contents of the spec. Provided by API callers when
487 // specs are created or updated. To access the contents of a spec, use
488 // GetApiSpecContents.
489 Contents string `json:"contents,omitempty"`
490 // CreateTime: Output only. Creation timestamp; when the spec resource was
491 // created.
492 CreateTime string `json:"createTime,omitempty"`
493 // Description: A detailed description.
494 Description string `json:"description,omitempty"`
495 // Filename: A possibly-hierarchical name used to refer to the spec from other
496 // specs.
497 Filename string `json:"filename,omitempty"`
498 // Hash: Output only. A SHA-256 hash of the spec's contents. If the spec is
499 // gzipped, this is the hash of the uncompressed spec.
500 Hash string `json:"hash,omitempty"`
501 // Labels: Labels attach identifying metadata to resources. Identifying
502 // metadata can be used to filter list operations. Label keys and values can be
503 // no longer than 64 characters (Unicode codepoints), can only contain
504 // lowercase letters, numeric characters, underscores and dashes. International
505 // characters are allowed. No more than 64 user labels can be associated with
506 // one resource (System labels are excluded). See https://goo.gl/xmQnxf for
507 // more information and examples of labels. System reserved label keys are
508 // prefixed with `apigeeregistry.googleapis.com/` and cannot be changed.
509 Labels map[string]string `json:"labels,omitempty"`
510 // MimeType: A style (format) descriptor for this spec that is specified as a
511 // Media Type (https://en.wikipedia.org/wiki/Media_type). Possible values
512 // include `application/vnd.apigee.proto`, `application/vnd.apigee.openapi`,
513 // and `application/vnd.apigee.graphql`, with possible suffixes representing
514 // compression types. These hypothetical names are defined in the vendor tree
515 // defined in RFC6838 (https://tools.ietf.org/html/rfc6838) and are not final.
516 // Content types can specify compression. Currently only GZip compression is
517 // supported (indicated with "+gzip").
518 MimeType string `json:"mimeType,omitempty"`
519 // Name: Resource name.
520 Name string `json:"name,omitempty"`
521 // RevisionCreateTime: Output only. Revision creation timestamp; when the
522 // represented revision was created.
523 RevisionCreateTime string `json:"revisionCreateTime,omitempty"`
524 // RevisionId: Output only. Immutable. The revision ID of the spec. A new
525 // revision is committed whenever the spec contents are changed. The format is
526 // an 8-character hexadecimal string.
527 RevisionId string `json:"revisionId,omitempty"`
528 // RevisionUpdateTime: Output only. Last update timestamp: when the represented
529 // revision was last modified.
530 RevisionUpdateTime string `json:"revisionUpdateTime,omitempty"`
531 // SizeBytes: Output only. The size of the spec file in bytes. If the spec is
532 // gzipped, this is the size of the uncompressed spec.
533 SizeBytes int64 `json:"sizeBytes,omitempty"`
534 // SourceUri: The original source URI of the spec (if one exists). This is an
535 // external location that can be used for reference purposes but which may not
536 // be authoritative since this external resource may change after the spec is
537 // retrieved.
538 SourceUri string `json:"sourceUri,omitempty"`
539
540 // ServerResponse contains the HTTP response code and headers from the server.
541 googleapi.ServerResponse `json:"-"`
542 // ForceSendFields is a list of field names (e.g. "Annotations") to
543 // unconditionally include in API requests. By default, fields with empty or
544 // default values are omitted from API requests. See
545 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
546 // details.
547 ForceSendFields []string `json:"-"`
548 // NullFields is a list of field names (e.g. "Annotations") to include in API
549 // requests with the JSON null value. By default, fields with empty values are
550 // omitted from API requests. See
551 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
552 NullFields []string `json:"-"`
553 }
554
555 func (s ApiSpec) MarshalJSON() ([]byte, error) {
556 type NoMethod ApiSpec
557 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
558 }
559
560 // ApiVersion: Describes a particular version of an API. ApiVersions are what
561 // consumers actually use.
562 type ApiVersion struct {
563 // Annotations: Annotations attach non-identifying metadata to resources.
564 // Annotation keys and values are less restricted than those of labels, but
565 // should be generally used for small values of broad interest. Larger, topic-
566 // specific metadata should be stored in Artifacts.
567 Annotations map[string]string `json:"annotations,omitempty"`
568 // CreateTime: Output only. Creation timestamp.
569 CreateTime string `json:"createTime,omitempty"`
570 // Description: A detailed description.
571 Description string `json:"description,omitempty"`
572 // DisplayName: Human-meaningful name.
573 DisplayName string `json:"displayName,omitempty"`
574 // Labels: Labels attach identifying metadata to resources. Identifying
575 // metadata can be used to filter list operations. Label keys and values can be
576 // no longer than 64 characters (Unicode codepoints), can only contain
577 // lowercase letters, numeric characters, underscores and dashes. International
578 // characters are allowed. No more than 64 user labels can be associated with
579 // one resource (System labels are excluded). See https://goo.gl/xmQnxf for
580 // more information and examples of labels. System reserved label keys are
581 // prefixed with `apigeeregistry.googleapis.com/` and cannot be changed.
582 Labels map[string]string `json:"labels,omitempty"`
583 // Name: Resource name.
584 Name string `json:"name,omitempty"`
585 // PrimarySpec: The primary spec for this version. Format:
586 // projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{
587 // spec}
588 PrimarySpec string `json:"primarySpec,omitempty"`
589 // State: A user-definable description of the lifecycle phase of this API
590 // version. Format: free-form, but we expect single words that describe API
591 // maturity, e.g., "CONCEPT", "DESIGN", "DEVELOPMENT", "STAGING", "PRODUCTION",
592 // "DEPRECATED", "RETIRED".
593 State string `json:"state,omitempty"`
594 // UpdateTime: Output only. Last update timestamp.
595 UpdateTime string `json:"updateTime,omitempty"`
596
597 // ServerResponse contains the HTTP response code and headers from the server.
598 googleapi.ServerResponse `json:"-"`
599 // ForceSendFields is a list of field names (e.g. "Annotations") to
600 // unconditionally include in API requests. By default, fields with empty or
601 // default values are omitted from API requests. See
602 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
603 // details.
604 ForceSendFields []string `json:"-"`
605 // NullFields is a list of field names (e.g. "Annotations") to include in API
606 // requests with the JSON null value. By default, fields with empty values are
607 // omitted from API requests. See
608 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
609 NullFields []string `json:"-"`
610 }
611
612 func (s ApiVersion) MarshalJSON() ([]byte, error) {
613 type NoMethod ApiVersion
614 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
615 }
616
617 // Artifact: Artifacts of resources. Artifacts are unique (single-value) per
618 // resource and are used to store metadata that is too large or numerous to be
619 // stored directly on the resource. Since artifacts are stored separately from
620 // parent resources, they should generally be used for metadata that is needed
621 // infrequently, i.e., not for display in primary views of the resource but
622 // perhaps displayed or downloaded upon request. The `ListArtifacts` method
623 // allows artifacts to be quickly enumerated and checked for presence without
624 // downloading their (potentially-large) contents.
625 type Artifact struct {
626 // Annotations: Annotations attach non-identifying metadata to resources.
627 // Annotation keys and values are less restricted than those of labels, but
628 // should be generally used for small values of broad interest. Larger, topic-
629 // specific metadata should be stored in Artifacts.
630 Annotations map[string]string `json:"annotations,omitempty"`
631 // Contents: Input only. The contents of the artifact. Provided by API callers
632 // when artifacts are created or replaced. To access the contents of an
633 // artifact, use GetArtifactContents.
634 Contents string `json:"contents,omitempty"`
635 // CreateTime: Output only. Creation timestamp.
636 CreateTime string `json:"createTime,omitempty"`
637 // Hash: Output only. A SHA-256 hash of the artifact's contents. If the
638 // artifact is gzipped, this is the hash of the uncompressed artifact.
639 Hash string `json:"hash,omitempty"`
640 // Labels: Labels attach identifying metadata to resources. Identifying
641 // metadata can be used to filter list operations. Label keys and values can be
642 // no longer than 64 characters (Unicode codepoints), can only contain
643 // lowercase letters, numeric characters, underscores and dashes. International
644 // characters are allowed. No more than 64 user labels can be associated with
645 // one resource (System labels are excluded). See https://goo.gl/xmQnxf for
646 // more information and examples of labels. System reserved label keys are
647 // prefixed with "registry.googleapis.com/" and cannot be changed.
648 Labels map[string]string `json:"labels,omitempty"`
649 // MimeType: A content type specifier for the artifact. Content type specifiers
650 // are Media Types (https://en.wikipedia.org/wiki/Media_type) with a possible
651 // "schema" parameter that specifies a schema for the stored information.
652 // Content types can specify compression. Currently only GZip compression is
653 // supported (indicated with "+gzip").
654 MimeType string `json:"mimeType,omitempty"`
655 // Name: Resource name.
656 Name string `json:"name,omitempty"`
657 // SizeBytes: Output only. The size of the artifact in bytes. If the artifact
658 // is gzipped, this is the size of the uncompressed artifact.
659 SizeBytes int64 `json:"sizeBytes,omitempty"`
660 // UpdateTime: Output only. Last update timestamp.
661 UpdateTime string `json:"updateTime,omitempty"`
662
663 // ServerResponse contains the HTTP response code and headers from the server.
664 googleapi.ServerResponse `json:"-"`
665 // ForceSendFields is a list of field names (e.g. "Annotations") to
666 // unconditionally include in API requests. By default, fields with empty or
667 // default values are omitted from API requests. See
668 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
669 // details.
670 ForceSendFields []string `json:"-"`
671 // NullFields is a list of field names (e.g. "Annotations") to include in API
672 // requests with the JSON null value. By default, fields with empty values are
673 // omitted from API requests. See
674 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
675 NullFields []string `json:"-"`
676 }
677
678 func (s Artifact) MarshalJSON() ([]byte, error) {
679 type NoMethod Artifact
680 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
681 }
682
683 // Binding: Associates `members`, or principals, with a `role`.
684 type Binding struct {
685 // Condition: The condition that is associated with this binding. If the
686 // condition evaluates to `true`, then this binding applies to the current
687 // request. If the condition evaluates to `false`, then this binding does not
688 // apply to the current request. However, a different role binding might grant
689 // the same role to one or more of the principals in this binding. To learn
690 // which resources support conditions in their IAM policies, see the IAM
691 // documentation
692 // (https://cloud.google.com/iam/help/conditions/resource-policies).
693 Condition *Expr `json:"condition,omitempty"`
694 // Members: Specifies the principals requesting access for a Google Cloud
695 // resource. `members` can have the following values: * `allUsers`: A special
696 // identifier that represents anyone who is on the internet; with or without a
697 // Google account. * `allAuthenticatedUsers`: A special identifier that
698 // represents anyone who is authenticated with a Google account or a service
699 // account. Does not include identities that come from external identity
700 // providers (IdPs) through identity federation. * `user:{emailid}`: An email
701 // address that represents a specific Google account. For example,
702 // `[email protected]` . * `serviceAccount:{emailid}`: An email address that
703 // represents a Google service account. For example,
704 // `[email protected]`. *
705 // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
706 // identifier for a Kubernetes service account
707 // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
708 // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
709 // `group:{emailid}`: An email address that represents a Google group. For
710 // example, `[email protected]`. * `domain:{domain}`: The G Suite domain
711 // (primary) that represents all the users of that domain. For example,
712 // `google.com` or `example.com`. * `deleted:user:{emailid}?uid={uniqueid}`: An
713 // email address (plus unique identifier) representing a user that has been
714 // recently deleted. For example,
715 // `[email protected]?uid=123456789012345678901`. If the user is recovered,
716 // this value reverts to `user:{emailid}` and the recovered user retains the
717 // role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An
718 // email address (plus unique identifier) representing a service account that
719 // has been recently deleted. For example,
720 // `[email protected]?uid=123456789012345678901`. If the
721 // service account is undeleted, this value reverts to
722 // `serviceAccount:{emailid}` and the undeleted service account retains the
723 // role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
724 // address (plus unique identifier) representing a Google group that has been
725 // recently deleted. For example,
726 // `[email protected]?uid=123456789012345678901`. If the group is recovered,
727 // this value reverts to `group:{emailid}` and the recovered group retains the
728 // role in the binding.
729 Members []string `json:"members,omitempty"`
730 // Role: Role that is assigned to the list of `members`, or principals. For
731 // example, `roles/viewer`, `roles/editor`, or `roles/owner`.
732 Role string `json:"role,omitempty"`
733 // ForceSendFields is a list of field names (e.g. "Condition") to
734 // unconditionally include in API requests. By default, fields with empty or
735 // default values are omitted from API requests. See
736 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
737 // details.
738 ForceSendFields []string `json:"-"`
739 // NullFields is a list of field names (e.g. "Condition") to include in API
740 // requests with the JSON null value. By default, fields with empty values are
741 // omitted from API requests. See
742 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
743 NullFields []string `json:"-"`
744 }
745
746 func (s Binding) MarshalJSON() ([]byte, error) {
747 type NoMethod Binding
748 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
749 }
750
751 // Build: Build information of the Instance if it's in `ACTIVE` state.
752 type Build struct {
753 // CommitId: Output only. Commit ID of the latest commit in the build.
754 CommitId string `json:"commitId,omitempty"`
755 // CommitTime: Output only. Commit time of the latest commit in the build.
756 CommitTime string `json:"commitTime,omitempty"`
757 // Repo: Output only. Path of the open source repository:
758 // github.com/apigee/registry.
759 Repo string `json:"repo,omitempty"`
760 // ForceSendFields is a list of field names (e.g. "CommitId") to
761 // unconditionally include in API requests. By default, fields with empty or
762 // default values are omitted from API requests. See
763 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
764 // details.
765 ForceSendFields []string `json:"-"`
766 // NullFields is a list of field names (e.g. "CommitId") to include in API
767 // requests with the JSON null value. By default, fields with empty values are
768 // omitted from API requests. See
769 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
770 NullFields []string `json:"-"`
771 }
772
773 func (s Build) MarshalJSON() ([]byte, error) {
774 type NoMethod Build
775 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
776 }
777
778 // CancelOperationRequest: The request message for Operations.CancelOperation.
779 type CancelOperationRequest struct {
780 }
781
782 // Config: Available configurations to provision an Instance.
783 type Config struct {
784 // CmekKeyName: Required. The Customer Managed Encryption Key (CMEK) used for
785 // data encryption. The CMEK name should follow the format of
786 // `projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)`,
787 // where the `location` must match InstanceConfig.location.
788 CmekKeyName string `json:"cmekKeyName,omitempty"`
789 // Location: Output only. The GCP location where the Instance resides.
790 Location string `json:"location,omitempty"`
791 // ForceSendFields is a list of field names (e.g. "CmekKeyName") to
792 // unconditionally include in API requests. By default, fields with empty or
793 // default values are omitted from API requests. See
794 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
795 // details.
796 ForceSendFields []string `json:"-"`
797 // NullFields is a list of field names (e.g. "CmekKeyName") to include in API
798 // requests with the JSON null value. By default, fields with empty values are
799 // omitted from API requests. See
800 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
801 NullFields []string `json:"-"`
802 }
803
804 func (s Config) MarshalJSON() ([]byte, error) {
805 type NoMethod Config
806 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
807 }
808
809 // Empty: A generic empty message that you can re-use to avoid defining
810 // duplicated empty messages in your APIs. A typical example is to use it as
811 // the request or the response type of an API method. For instance: service Foo
812 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
813 type Empty struct {
814 // ServerResponse contains the HTTP response code and headers from the server.
815 googleapi.ServerResponse `json:"-"`
816 }
817
818 // Expr: Represents a textual expression in the Common Expression Language
819 // (CEL) syntax. CEL is a C-like expression language. The syntax and semantics
820 // of CEL are documented at https://github.com/google/cel-spec. Example
821 // (Comparison): title: "Summary size limit" description: "Determines if a
822 // summary is less than 100 chars" expression: "document.summary.size() < 100"
823 // Example (Equality): title: "Requestor is owner" description: "Determines if
824 // requestor is the document owner" expression: "document.owner ==
825 // request.auth.claims.email" Example (Logic): title: "Public documents"
826 // description: "Determine whether the document should be publicly visible"
827 // expression: "document.type != 'private' && document.type != 'internal'"
828 // Example (Data Manipulation): title: "Notification string" description:
829 // "Create a notification string with a timestamp." expression: "'New message
830 // received at ' + string(document.create_time)" The exact variables and
831 // functions that may be referenced within an expression are determined by the
832 // service that evaluates it. See the service documentation for additional
833 // information.
834 type Expr struct {
835 // Description: Optional. Description of the expression. This is a longer text
836 // which describes the expression, e.g. when hovered over it in a UI.
837 Description string `json:"description,omitempty"`
838 // Expression: Textual representation of an expression in Common Expression
839 // Language syntax.
840 Expression string `json:"expression,omitempty"`
841 // Location: Optional. String indicating the location of the expression for
842 // error reporting, e.g. a file name and a position in the file.
843 Location string `json:"location,omitempty"`
844 // Title: Optional. Title for the expression, i.e. a short string describing
845 // its purpose. This can be used e.g. in UIs which allow to enter the
846 // expression.
847 Title string `json:"title,omitempty"`
848 // ForceSendFields is a list of field names (e.g. "Description") to
849 // unconditionally include in API requests. By default, fields with empty or
850 // default values are omitted from API requests. See
851 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
852 // details.
853 ForceSendFields []string `json:"-"`
854 // NullFields is a list of field names (e.g. "Description") to include in API
855 // requests with the JSON null value. By default, fields with empty values are
856 // omitted from API requests. See
857 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
858 NullFields []string `json:"-"`
859 }
860
861 func (s Expr) MarshalJSON() ([]byte, error) {
862 type NoMethod Expr
863 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
864 }
865
866 // HttpBody: Message that represents an arbitrary HTTP body. It should only be
867 // used for payload formats that can't be represented as JSON, such as raw
868 // binary or an HTML page. This message can be used both in streaming and
869 // non-streaming API methods in the request as well as the response. It can be
870 // used as a top-level request field, which is convenient if one wants to
871 // extract parameters from either the URL or HTTP template into the request
872 // fields and also want access to the raw HTTP body. Example: message
873 // GetResourceRequest { // A unique request id. string request_id = 1; // The
874 // raw HTTP body is bound to this field. google.api.HttpBody http_body = 2; }
875 // service ResourceService { rpc GetResource(GetResourceRequest) returns
876 // (google.api.HttpBody); rpc UpdateResource(google.api.HttpBody) returns
877 // (google.protobuf.Empty); } Example with streaming methods: service
878 // CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns (stream
879 // google.api.HttpBody); rpc UpdateCalendar(stream google.api.HttpBody) returns
880 // (stream google.api.HttpBody); } Use of this type only changes how the
881 // request and response bodies are handled, all other features will continue to
882 // work unchanged.
883 type HttpBody struct {
884 // ContentType: The HTTP Content-Type header value specifying the content type
885 // of the body.
886 ContentType string `json:"contentType,omitempty"`
887 // Data: The HTTP request/response body as raw binary.
888 Data string `json:"data,omitempty"`
889 // Extensions: Application specific response metadata. Must be set in the first
890 // response for streaming APIs.
891 Extensions []googleapi.RawMessage `json:"extensions,omitempty"`
892
893 // ServerResponse contains the HTTP response code and headers from the server.
894 googleapi.ServerResponse `json:"-"`
895 // ForceSendFields is a list of field names (e.g. "ContentType") to
896 // unconditionally include in API requests. By default, fields with empty or
897 // default values are omitted from API requests. See
898 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
899 // details.
900 ForceSendFields []string `json:"-"`
901 // NullFields is a list of field names (e.g. "ContentType") to include in API
902 // requests with the JSON null value. By default, fields with empty values are
903 // omitted from API requests. See
904 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
905 NullFields []string `json:"-"`
906 }
907
908 func (s HttpBody) MarshalJSON() ([]byte, error) {
909 type NoMethod HttpBody
910 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
911 }
912
913 // Instance: An Instance represents the instance resources of the Registry.
914 // Currently, only one instance is allowed for each project.
915 type Instance struct {
916 // Build: Output only. Build info of the Instance if it's in `ACTIVE` state.
917 Build *Build `json:"build,omitempty"`
918 // Config: Required. Config of the Instance.
919 Config *Config `json:"config,omitempty"`
920 // CreateTime: Output only. Creation timestamp.
921 CreateTime string `json:"createTime,omitempty"`
922 // Name: Format: `projects/*/locations/*/instance`. Currently only
923 // `locations/global` is supported.
924 Name string `json:"name,omitempty"`
925 // State: Output only. The current state of the Instance.
926 //
927 // Possible values:
928 // "STATE_UNSPECIFIED" - The default value. This value is used if the state
929 // is omitted.
930 // "INACTIVE" - The Instance has not been initialized or has been deleted.
931 // "CREATING" - The Instance is being created.
932 // "ACTIVE" - The Instance has been created and is ready for use.
933 // "UPDATING" - The Instance is being updated.
934 // "DELETING" - The Instance is being deleted.
935 // "FAILED" - The Instance encountered an error during a state change.
936 State string `json:"state,omitempty"`
937 // StateMessage: Output only. Extra information of Instance.State if the state
938 // is `FAILED`.
939 StateMessage string `json:"stateMessage,omitempty"`
940 // UpdateTime: Output only. Last update timestamp.
941 UpdateTime string `json:"updateTime,omitempty"`
942
943 // ServerResponse contains the HTTP response code and headers from the server.
944 googleapi.ServerResponse `json:"-"`
945 // ForceSendFields is a list of field names (e.g. "Build") to unconditionally
946 // include in API requests. By default, fields with empty or default values are
947 // omitted from API requests. See
948 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
949 // details.
950 ForceSendFields []string `json:"-"`
951 // NullFields is a list of field names (e.g. "Build") to include in API
952 // requests with the JSON null value. By default, fields with empty values are
953 // omitted from API requests. See
954 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
955 NullFields []string `json:"-"`
956 }
957
958 func (s Instance) MarshalJSON() ([]byte, error) {
959 type NoMethod Instance
960 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
961 }
962
963 // ListApiDeploymentRevisionsResponse: Response message for
964 // ListApiDeploymentRevisionsResponse.
965 type ListApiDeploymentRevisionsResponse struct {
966 // ApiDeployments: The revisions of the deployment.
967 ApiDeployments []*ApiDeployment `json:"apiDeployments,omitempty"`
968 // NextPageToken: A token that can be sent as `page_token` to retrieve the next
969 // page. If this field is omitted, there are no subsequent pages.
970 NextPageToken string `json:"nextPageToken,omitempty"`
971
972 // ServerResponse contains the HTTP response code and headers from the server.
973 googleapi.ServerResponse `json:"-"`
974 // ForceSendFields is a list of field names (e.g. "ApiDeployments") to
975 // unconditionally include in API requests. By default, fields with empty or
976 // default values are omitted from API requests. See
977 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
978 // details.
979 ForceSendFields []string `json:"-"`
980 // NullFields is a list of field names (e.g. "ApiDeployments") to include in
981 // API requests with the JSON null value. By default, fields with empty values
982 // are omitted from API requests. See
983 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
984 NullFields []string `json:"-"`
985 }
986
987 func (s ListApiDeploymentRevisionsResponse) MarshalJSON() ([]byte, error) {
988 type NoMethod ListApiDeploymentRevisionsResponse
989 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
990 }
991
992 // ListApiDeploymentsResponse: Response message for ListApiDeployments.
993 type ListApiDeploymentsResponse struct {
994 // ApiDeployments: The deployments from the specified publisher.
995 ApiDeployments []*ApiDeployment `json:"apiDeployments,omitempty"`
996 // NextPageToken: A token, which can be sent as `page_token` to retrieve the
997 // next page. If this field is omitted, there are no subsequent pages.
998 NextPageToken string `json:"nextPageToken,omitempty"`
999
1000 // ServerResponse contains the HTTP response code and headers from the server.
1001 googleapi.ServerResponse `json:"-"`
1002 // ForceSendFields is a list of field names (e.g. "ApiDeployments") to
1003 // unconditionally include in API requests. By default, fields with empty or
1004 // default values are omitted from API requests. See
1005 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1006 // details.
1007 ForceSendFields []string `json:"-"`
1008 // NullFields is a list of field names (e.g. "ApiDeployments") to include in
1009 // API requests with the JSON null value. By default, fields with empty values
1010 // are omitted from API requests. See
1011 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1012 NullFields []string `json:"-"`
1013 }
1014
1015 func (s ListApiDeploymentsResponse) MarshalJSON() ([]byte, error) {
1016 type NoMethod ListApiDeploymentsResponse
1017 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1018 }
1019
1020 // ListApiSpecRevisionsResponse: Response message for
1021 // ListApiSpecRevisionsResponse.
1022 type ListApiSpecRevisionsResponse struct {
1023 // ApiSpecs: The revisions of the spec.
1024 ApiSpecs []*ApiSpec `json:"apiSpecs,omitempty"`
1025 // NextPageToken: A token that can be sent as `page_token` to retrieve the next
1026 // page. If this field is omitted, there are no subsequent pages.
1027 NextPageToken string `json:"nextPageToken,omitempty"`
1028
1029 // ServerResponse contains the HTTP response code and headers from the server.
1030 googleapi.ServerResponse `json:"-"`
1031 // ForceSendFields is a list of field names (e.g. "ApiSpecs") to
1032 // unconditionally include in API requests. By default, fields with empty or
1033 // default values are omitted from API requests. See
1034 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1035 // details.
1036 ForceSendFields []string `json:"-"`
1037 // NullFields is a list of field names (e.g. "ApiSpecs") to include in API
1038 // requests with the JSON null value. By default, fields with empty values are
1039 // omitted from API requests. See
1040 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1041 NullFields []string `json:"-"`
1042 }
1043
1044 func (s ListApiSpecRevisionsResponse) MarshalJSON() ([]byte, error) {
1045 type NoMethod ListApiSpecRevisionsResponse
1046 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1047 }
1048
1049 // ListApiSpecsResponse: Response message for ListApiSpecs.
1050 type ListApiSpecsResponse struct {
1051 // ApiSpecs: The specs from the specified publisher.
1052 ApiSpecs []*ApiSpec `json:"apiSpecs,omitempty"`
1053 // NextPageToken: A token, which can be sent as `page_token` to retrieve the
1054 // next page. If this field is omitted, there are no subsequent pages.
1055 NextPageToken string `json:"nextPageToken,omitempty"`
1056
1057 // ServerResponse contains the HTTP response code and headers from the server.
1058 googleapi.ServerResponse `json:"-"`
1059 // ForceSendFields is a list of field names (e.g. "ApiSpecs") to
1060 // unconditionally include in API requests. By default, fields with empty or
1061 // default values are omitted from API requests. See
1062 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1063 // details.
1064 ForceSendFields []string `json:"-"`
1065 // NullFields is a list of field names (e.g. "ApiSpecs") to include in API
1066 // requests with the JSON null value. By default, fields with empty values are
1067 // omitted from API requests. See
1068 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1069 NullFields []string `json:"-"`
1070 }
1071
1072 func (s ListApiSpecsResponse) MarshalJSON() ([]byte, error) {
1073 type NoMethod ListApiSpecsResponse
1074 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1075 }
1076
1077 // ListApiVersionsResponse: Response message for ListApiVersions.
1078 type ListApiVersionsResponse struct {
1079 // ApiVersions: The versions from the specified publisher.
1080 ApiVersions []*ApiVersion `json:"apiVersions,omitempty"`
1081 // NextPageToken: A token, which can be sent as `page_token` to retrieve the
1082 // next page. If this field is omitted, there are no subsequent pages.
1083 NextPageToken string `json:"nextPageToken,omitempty"`
1084
1085 // ServerResponse contains the HTTP response code and headers from the server.
1086 googleapi.ServerResponse `json:"-"`
1087 // ForceSendFields is a list of field names (e.g. "ApiVersions") to
1088 // unconditionally include in API requests. By default, fields with empty or
1089 // default values are omitted from API requests. See
1090 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1091 // details.
1092 ForceSendFields []string `json:"-"`
1093 // NullFields is a list of field names (e.g. "ApiVersions") to include in API
1094 // requests with the JSON null value. By default, fields with empty values are
1095 // omitted from API requests. See
1096 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1097 NullFields []string `json:"-"`
1098 }
1099
1100 func (s ListApiVersionsResponse) MarshalJSON() ([]byte, error) {
1101 type NoMethod ListApiVersionsResponse
1102 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1103 }
1104
1105 // ListApisResponse: Response message for ListApis.
1106 type ListApisResponse struct {
1107 // Apis: The APIs from the specified publisher.
1108 Apis []*Api `json:"apis,omitempty"`
1109 // NextPageToken: A token, which can be sent as `page_token` to retrieve the
1110 // next page. If this field is omitted, there are no subsequent pages.
1111 NextPageToken string `json:"nextPageToken,omitempty"`
1112
1113 // ServerResponse contains the HTTP response code and headers from the server.
1114 googleapi.ServerResponse `json:"-"`
1115 // ForceSendFields is a list of field names (e.g. "Apis") to unconditionally
1116 // include in API requests. By default, fields with empty or default values are
1117 // omitted from API requests. See
1118 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1119 // details.
1120 ForceSendFields []string `json:"-"`
1121 // NullFields is a list of field names (e.g. "Apis") to include in API requests
1122 // with the JSON null value. By default, fields with empty values are omitted
1123 // from API requests. See
1124 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1125 NullFields []string `json:"-"`
1126 }
1127
1128 func (s ListApisResponse) MarshalJSON() ([]byte, error) {
1129 type NoMethod ListApisResponse
1130 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1131 }
1132
1133 // ListArtifactsResponse: Response message for ListArtifacts.
1134 type ListArtifactsResponse struct {
1135 // Artifacts: The artifacts from the specified publisher.
1136 Artifacts []*Artifact `json:"artifacts,omitempty"`
1137 // NextPageToken: A token, which can be sent as `page_token` to retrieve the
1138 // next page. If this field is omitted, there are no subsequent pages.
1139 NextPageToken string `json:"nextPageToken,omitempty"`
1140
1141 // ServerResponse contains the HTTP response code and headers from the server.
1142 googleapi.ServerResponse `json:"-"`
1143 // ForceSendFields is a list of field names (e.g. "Artifacts") to
1144 // unconditionally include in API requests. By default, fields with empty or
1145 // default values are omitted from API requests. See
1146 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1147 // details.
1148 ForceSendFields []string `json:"-"`
1149 // NullFields is a list of field names (e.g. "Artifacts") to include in API
1150 // requests with the JSON null value. By default, fields with empty values are
1151 // omitted from API requests. See
1152 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1153 NullFields []string `json:"-"`
1154 }
1155
1156 func (s ListArtifactsResponse) MarshalJSON() ([]byte, error) {
1157 type NoMethod ListArtifactsResponse
1158 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1159 }
1160
1161 // ListLocationsResponse: The response message for Locations.ListLocations.
1162 type ListLocationsResponse struct {
1163 // Locations: A list of locations that matches the specified filter in the
1164 // request.
1165 Locations []*Location `json:"locations,omitempty"`
1166 // NextPageToken: The standard List next-page token.
1167 NextPageToken string `json:"nextPageToken,omitempty"`
1168
1169 // ServerResponse contains the HTTP response code and headers from the server.
1170 googleapi.ServerResponse `json:"-"`
1171 // ForceSendFields is a list of field names (e.g. "Locations") to
1172 // unconditionally include in API requests. By default, fields with empty or
1173 // default values are omitted from API requests. See
1174 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1175 // details.
1176 ForceSendFields []string `json:"-"`
1177 // NullFields is a list of field names (e.g. "Locations") to include in API
1178 // requests with the JSON null value. By default, fields with empty values are
1179 // omitted from API requests. See
1180 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1181 NullFields []string `json:"-"`
1182 }
1183
1184 func (s ListLocationsResponse) MarshalJSON() ([]byte, error) {
1185 type NoMethod ListLocationsResponse
1186 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1187 }
1188
1189 // ListOperationsResponse: The response message for Operations.ListOperations.
1190 type ListOperationsResponse struct {
1191 // NextPageToken: The standard List next-page token.
1192 NextPageToken string `json:"nextPageToken,omitempty"`
1193 // Operations: A list of operations that matches the specified filter in the
1194 // request.
1195 Operations []*Operation `json:"operations,omitempty"`
1196
1197 // ServerResponse contains the HTTP response code and headers from the server.
1198 googleapi.ServerResponse `json:"-"`
1199 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1200 // unconditionally include in API requests. By default, fields with empty or
1201 // default values are omitted from API requests. See
1202 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1203 // details.
1204 ForceSendFields []string `json:"-"`
1205 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1206 // requests with the JSON null value. By default, fields with empty values are
1207 // omitted from API requests. See
1208 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1209 NullFields []string `json:"-"`
1210 }
1211
1212 func (s ListOperationsResponse) MarshalJSON() ([]byte, error) {
1213 type NoMethod ListOperationsResponse
1214 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1215 }
1216
1217 // Location: A resource that represents a Google Cloud location.
1218 type Location struct {
1219 // DisplayName: The friendly name for this location, typically a nearby city
1220 // name. For example, "Tokyo".
1221 DisplayName string `json:"displayName,omitempty"`
1222 // Labels: Cross-service attributes for the location. For example
1223 // {"cloud.googleapis.com/region": "us-east1"}
1224 Labels map[string]string `json:"labels,omitempty"`
1225 // LocationId: The canonical id for this location. For example: "us-east1".
1226 LocationId string `json:"locationId,omitempty"`
1227 // Metadata: Service-specific metadata. For example the available capacity at
1228 // the given location.
1229 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1230 // Name: Resource name for the location, which may vary between
1231 // implementations. For example:
1232 // "projects/example-project/locations/us-east1"
1233 Name string `json:"name,omitempty"`
1234
1235 // ServerResponse contains the HTTP response code and headers from the server.
1236 googleapi.ServerResponse `json:"-"`
1237 // ForceSendFields is a list of field names (e.g. "DisplayName") to
1238 // unconditionally include in API requests. By default, fields with empty or
1239 // default values are omitted from API requests. See
1240 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1241 // details.
1242 ForceSendFields []string `json:"-"`
1243 // NullFields is a list of field names (e.g. "DisplayName") to include in API
1244 // requests with the JSON null value. By default, fields with empty values are
1245 // omitted from API requests. See
1246 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1247 NullFields []string `json:"-"`
1248 }
1249
1250 func (s Location) MarshalJSON() ([]byte, error) {
1251 type NoMethod Location
1252 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1253 }
1254
1255 // Operation: This resource represents a long-running operation that is the
1256 // result of a network API call.
1257 type Operation struct {
1258 // Done: If the value is `false`, it means the operation is still in progress.
1259 // If `true`, the operation is completed, and either `error` or `response` is
1260 // available.
1261 Done bool `json:"done,omitempty"`
1262 // Error: The error result of the operation in case of failure or cancellation.
1263 Error *Status `json:"error,omitempty"`
1264 // Metadata: Service-specific metadata associated with the operation. It
1265 // typically contains progress information and common metadata such as create
1266 // time. Some services might not provide such metadata. Any method that returns
1267 // a long-running operation should document the metadata type, if any.
1268 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1269 // Name: The server-assigned name, which is only unique within the same service
1270 // that originally returns it. If you use the default HTTP mapping, the `name`
1271 // should be a resource name ending with `operations/{unique_id}`.
1272 Name string `json:"name,omitempty"`
1273 // Response: The normal, successful response of the operation. If the original
1274 // method returns no data on success, such as `Delete`, the response is
1275 // `google.protobuf.Empty`. If the original method is standard
1276 // `Get`/`Create`/`Update`, the response should be the resource. For other
1277 // methods, the response should have the type `XxxResponse`, where `Xxx` is the
1278 // original method name. For example, if the original method name is
1279 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
1280 Response googleapi.RawMessage `json:"response,omitempty"`
1281
1282 // ServerResponse contains the HTTP response code and headers from the server.
1283 googleapi.ServerResponse `json:"-"`
1284 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally
1285 // include in API requests. By default, fields with empty or default values are
1286 // omitted from API requests. See
1287 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1288 // details.
1289 ForceSendFields []string `json:"-"`
1290 // NullFields is a list of field names (e.g. "Done") to include in API requests
1291 // with the JSON null value. By default, fields with empty values are omitted
1292 // from API requests. See
1293 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1294 NullFields []string `json:"-"`
1295 }
1296
1297 func (s Operation) MarshalJSON() ([]byte, error) {
1298 type NoMethod Operation
1299 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1300 }
1301
1302 // OperationMetadata: Represents the metadata of the long-running operation.
1303 type OperationMetadata struct {
1304 // ApiVersion: API version used to start the operation.
1305 ApiVersion string `json:"apiVersion,omitempty"`
1306 // CancellationRequested: Identifies whether the user has requested
1307 // cancellation of the operation. Operations that have successfully been
1308 // cancelled have Operation.error value with a google.rpc.Status.code of 1,
1309 // corresponding to `Code.CANCELLED`.
1310 CancellationRequested bool `json:"cancellationRequested,omitempty"`
1311 // CreateTime: The time the operation was created.
1312 CreateTime string `json:"createTime,omitempty"`
1313 // EndTime: The time the operation finished running.
1314 EndTime string `json:"endTime,omitempty"`
1315 // StatusMessage: Human-readable status of the operation, if any.
1316 StatusMessage string `json:"statusMessage,omitempty"`
1317 // Target: Server-defined resource path for the target of the operation.
1318 Target string `json:"target,omitempty"`
1319 // Verb: Name of the verb executed by the operation.
1320 Verb string `json:"verb,omitempty"`
1321 // ForceSendFields is a list of field names (e.g. "ApiVersion") to
1322 // unconditionally include in API requests. By default, fields with empty or
1323 // default values are omitted from API requests. See
1324 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1325 // details.
1326 ForceSendFields []string `json:"-"`
1327 // NullFields is a list of field names (e.g. "ApiVersion") to include in API
1328 // requests with the JSON null value. By default, fields with empty values are
1329 // omitted from API requests. See
1330 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1331 NullFields []string `json:"-"`
1332 }
1333
1334 func (s OperationMetadata) MarshalJSON() ([]byte, error) {
1335 type NoMethod OperationMetadata
1336 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1337 }
1338
1339 // Policy: An Identity and Access Management (IAM) policy, which specifies
1340 // access controls for Google Cloud resources. A `Policy` is a collection of
1341 // `bindings`. A `binding` binds one or more `members`, or principals, to a
1342 // single `role`. Principals can be user accounts, service accounts, Google
1343 // groups, and domains (such as G Suite). A `role` is a named list of
1344 // permissions; each `role` can be an IAM predefined role or a user-created
1345 // custom role. For some types of Google Cloud resources, a `binding` can also
1346 // specify a `condition`, which is a logical expression that allows access to a
1347 // resource only if the expression evaluates to `true`. A condition can add
1348 // constraints based on attributes of the request, the resource, or both. To
1349 // learn which resources support conditions in their IAM policies, see the IAM
1350 // documentation
1351 // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
1352 // example:** ``` { "bindings": [ { "role":
1353 // "roles/resourcemanager.organizationAdmin", "members": [
1354 // "user:[email protected]", "group:[email protected]", "domain:google.com",
1355 // "serviceAccount:[email protected]" ] }, { "role":
1356 // "roles/resourcemanager.organizationViewer", "members": [
1357 // "user:[email protected]" ], "condition": { "title": "expirable access",
1358 // "description": "Does not grant access after Sep 2020", "expression":
1359 // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
1360 // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
1361 // members: - user:[email protected] - group:[email protected] -
1362 // domain:google.com - serviceAccount:[email protected]
1363 // role: roles/resourcemanager.organizationAdmin - members: -
1364 // user:[email protected] role: roles/resourcemanager.organizationViewer
1365 // condition: title: expirable access description: Does not grant access after
1366 // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
1367 // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
1368 // see the IAM documentation (https://cloud.google.com/iam/docs/).
1369 type Policy struct {
1370 // Bindings: Associates a list of `members`, or principals, with a `role`.
1371 // Optionally, may specify a `condition` that determines how and when the
1372 // `bindings` are applied. Each of the `bindings` must contain at least one
1373 // principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
1374 // up to 250 of these principals can be Google groups. Each occurrence of a
1375 // principal counts towards these limits. For example, if the `bindings` grant
1376 // 50 different roles to `user:[email protected]`, and not to any other
1377 // principal, then you can add another 1,450 principals to the `bindings` in
1378 // the `Policy`.
1379 Bindings []*Binding `json:"bindings,omitempty"`
1380 // Etag: `etag` is used for optimistic concurrency control as a way to help
1381 // prevent simultaneous updates of a policy from overwriting each other. It is
1382 // strongly suggested that systems make use of the `etag` in the
1383 // read-modify-write cycle to perform policy updates in order to avoid race
1384 // conditions: An `etag` is returned in the response to `getIamPolicy`, and
1385 // systems are expected to put that etag in the request to `setIamPolicy` to
1386 // ensure that their change will be applied to the same version of the policy.
1387 // **Important:** If you use IAM Conditions, you must include the `etag` field
1388 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows
1389 // you to overwrite a version `3` policy with a version `1` policy, and all of
1390 // the conditions in the version `3` policy are lost.
1391 Etag string `json:"etag,omitempty"`
1392 // Version: Specifies the format of the policy. Valid values are `0`, `1`, and
1393 // `3`. Requests that specify an invalid value are rejected. Any operation that
1394 // affects conditional role bindings must specify version `3`. This requirement
1395 // applies to the following operations: * Getting a policy that includes a
1396 // conditional role binding * Adding a conditional role binding to a policy *
1397 // Changing a conditional role binding in a policy * Removing any role binding,
1398 // with or without a condition, from a policy that includes conditions
1399 // **Important:** If you use IAM Conditions, you must include the `etag` field
1400 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows
1401 // you to overwrite a version `3` policy with a version `1` policy, and all of
1402 // the conditions in the version `3` policy are lost. If a policy does not
1403 // include any conditions, operations on that policy may specify any valid
1404 // version or leave the field unset. To learn which resources support
1405 // conditions in their IAM policies, see the IAM documentation
1406 // (https://cloud.google.com/iam/help/conditions/resource-policies).
1407 Version int64 `json:"version,omitempty"`
1408
1409 // ServerResponse contains the HTTP response code and headers from the server.
1410 googleapi.ServerResponse `json:"-"`
1411 // ForceSendFields is a list of field names (e.g. "Bindings") to
1412 // unconditionally include in API requests. By default, fields with empty or
1413 // default values are omitted from API requests. See
1414 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1415 // details.
1416 ForceSendFields []string `json:"-"`
1417 // NullFields is a list of field names (e.g. "Bindings") to include in API
1418 // requests with the JSON null value. By default, fields with empty values are
1419 // omitted from API requests. See
1420 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1421 NullFields []string `json:"-"`
1422 }
1423
1424 func (s Policy) MarshalJSON() ([]byte, error) {
1425 type NoMethod Policy
1426 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1427 }
1428
1429 // RollbackApiDeploymentRequest: Request message for RollbackApiDeployment.
1430 type RollbackApiDeploymentRequest struct {
1431 // RevisionId: Required. The revision ID to roll back to. It must be a revision
1432 // of the same deployment. Example: `c7cfa2a8`
1433 RevisionId string `json:"revisionId,omitempty"`
1434 // ForceSendFields is a list of field names (e.g. "RevisionId") to
1435 // unconditionally include in API requests. By default, fields with empty or
1436 // default values are omitted from API requests. See
1437 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1438 // details.
1439 ForceSendFields []string `json:"-"`
1440 // NullFields is a list of field names (e.g. "RevisionId") to include in API
1441 // requests with the JSON null value. By default, fields with empty values are
1442 // omitted from API requests. See
1443 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1444 NullFields []string `json:"-"`
1445 }
1446
1447 func (s RollbackApiDeploymentRequest) MarshalJSON() ([]byte, error) {
1448 type NoMethod RollbackApiDeploymentRequest
1449 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1450 }
1451
1452 // RollbackApiSpecRequest: Request message for RollbackApiSpec.
1453 type RollbackApiSpecRequest struct {
1454 // RevisionId: Required. The revision ID to roll back to. It must be a revision
1455 // of the same spec. Example: `c7cfa2a8`
1456 RevisionId string `json:"revisionId,omitempty"`
1457 // ForceSendFields is a list of field names (e.g. "RevisionId") to
1458 // unconditionally include in API requests. By default, fields with empty or
1459 // default values are omitted from API requests. See
1460 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1461 // details.
1462 ForceSendFields []string `json:"-"`
1463 // NullFields is a list of field names (e.g. "RevisionId") to include in API
1464 // requests with the JSON null value. By default, fields with empty values are
1465 // omitted from API requests. See
1466 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1467 NullFields []string `json:"-"`
1468 }
1469
1470 func (s RollbackApiSpecRequest) MarshalJSON() ([]byte, error) {
1471 type NoMethod RollbackApiSpecRequest
1472 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1473 }
1474
1475 // SetIamPolicyRequest: Request message for `SetIamPolicy` method.
1476 type SetIamPolicyRequest struct {
1477 // Policy: REQUIRED: The complete policy to be applied to the `resource`. The
1478 // size of the policy is limited to a few 10s of KB. An empty policy is a valid
1479 // policy but certain Google Cloud services (such as Projects) might reject
1480 // them.
1481 Policy *Policy `json:"policy,omitempty"`
1482 // ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
1483 // include in API requests. By default, fields with empty or default values are
1484 // omitted from API requests. See
1485 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1486 // details.
1487 ForceSendFields []string `json:"-"`
1488 // NullFields is a list of field names (e.g. "Policy") to include in API
1489 // requests with the JSON null value. By default, fields with empty values are
1490 // omitted from API requests. See
1491 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1492 NullFields []string `json:"-"`
1493 }
1494
1495 func (s SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
1496 type NoMethod SetIamPolicyRequest
1497 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1498 }
1499
1500 // Status: The `Status` type defines a logical error model that is suitable for
1501 // different programming environments, including REST APIs and RPC APIs. It is
1502 // used by gRPC (https://github.com/grpc). Each `Status` message contains three
1503 // pieces of data: error code, error message, and error details. You can find
1504 // out more about this error model and how to work with it in the API Design
1505 // Guide (https://cloud.google.com/apis/design/errors).
1506 type Status struct {
1507 // Code: The status code, which should be an enum value of google.rpc.Code.
1508 Code int64 `json:"code,omitempty"`
1509 // Details: A list of messages that carry the error details. There is a common
1510 // set of message types for APIs to use.
1511 Details []googleapi.RawMessage `json:"details,omitempty"`
1512 // Message: A developer-facing error message, which should be in English. Any
1513 // user-facing error message should be localized and sent in the
1514 // google.rpc.Status.details field, or localized by the client.
1515 Message string `json:"message,omitempty"`
1516 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
1517 // include in API requests. By default, fields with empty or default values are
1518 // omitted from API requests. See
1519 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1520 // details.
1521 ForceSendFields []string `json:"-"`
1522 // NullFields is a list of field names (e.g. "Code") to include in API requests
1523 // with the JSON null value. By default, fields with empty values are omitted
1524 // from API requests. See
1525 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1526 NullFields []string `json:"-"`
1527 }
1528
1529 func (s Status) MarshalJSON() ([]byte, error) {
1530 type NoMethod Status
1531 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1532 }
1533
1534 // TagApiDeploymentRevisionRequest: Request message for
1535 // TagApiDeploymentRevision.
1536 type TagApiDeploymentRevisionRequest struct {
1537 // Tag: Required. The tag to apply. The tag should be at most 40 characters,
1538 // and match `a-z{3,39}`.
1539 Tag string `json:"tag,omitempty"`
1540 // ForceSendFields is a list of field names (e.g. "Tag") to unconditionally
1541 // include in API requests. By default, fields with empty or default values are
1542 // omitted from API requests. See
1543 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1544 // details.
1545 ForceSendFields []string `json:"-"`
1546 // NullFields is a list of field names (e.g. "Tag") to include in API requests
1547 // with the JSON null value. By default, fields with empty values are omitted
1548 // from API requests. See
1549 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1550 NullFields []string `json:"-"`
1551 }
1552
1553 func (s TagApiDeploymentRevisionRequest) MarshalJSON() ([]byte, error) {
1554 type NoMethod TagApiDeploymentRevisionRequest
1555 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1556 }
1557
1558 // TagApiSpecRevisionRequest: Request message for TagApiSpecRevision.
1559 type TagApiSpecRevisionRequest struct {
1560 // Tag: Required. The tag to apply. The tag should be at most 40 characters,
1561 // and match `a-z{3,39}`.
1562 Tag string `json:"tag,omitempty"`
1563 // ForceSendFields is a list of field names (e.g. "Tag") to unconditionally
1564 // include in API requests. By default, fields with empty or default values are
1565 // omitted from API requests. See
1566 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1567 // details.
1568 ForceSendFields []string `json:"-"`
1569 // NullFields is a list of field names (e.g. "Tag") to include in API requests
1570 // with the JSON null value. By default, fields with empty values are omitted
1571 // from API requests. See
1572 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1573 NullFields []string `json:"-"`
1574 }
1575
1576 func (s TagApiSpecRevisionRequest) MarshalJSON() ([]byte, error) {
1577 type NoMethod TagApiSpecRevisionRequest
1578 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1579 }
1580
1581 // TestIamPermissionsRequest: Request message for `TestIamPermissions` method.
1582 type TestIamPermissionsRequest struct {
1583 // Permissions: The set of permissions to check for the `resource`. Permissions
1584 // with wildcards (such as `*` or `storage.*`) are not allowed. For more
1585 // information see IAM Overview
1586 // (https://cloud.google.com/iam/docs/overview#permissions).
1587 Permissions []string `json:"permissions,omitempty"`
1588 // ForceSendFields is a list of field names (e.g. "Permissions") to
1589 // unconditionally include in API requests. By default, fields with empty or
1590 // default values are omitted from API requests. See
1591 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1592 // details.
1593 ForceSendFields []string `json:"-"`
1594 // NullFields is a list of field names (e.g. "Permissions") to include in API
1595 // requests with the JSON null value. By default, fields with empty values are
1596 // omitted from API requests. See
1597 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1598 NullFields []string `json:"-"`
1599 }
1600
1601 func (s TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
1602 type NoMethod TestIamPermissionsRequest
1603 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1604 }
1605
1606 // TestIamPermissionsResponse: Response message for `TestIamPermissions`
1607 // method.
1608 type TestIamPermissionsResponse struct {
1609 // Permissions: A subset of `TestPermissionsRequest.permissions` that the
1610 // caller is allowed.
1611 Permissions []string `json:"permissions,omitempty"`
1612
1613 // ServerResponse contains the HTTP response code and headers from the server.
1614 googleapi.ServerResponse `json:"-"`
1615 // ForceSendFields is a list of field names (e.g. "Permissions") to
1616 // unconditionally include in API requests. By default, fields with empty or
1617 // default values are omitted from API requests. See
1618 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1619 // details.
1620 ForceSendFields []string `json:"-"`
1621 // NullFields is a list of field names (e.g. "Permissions") to include in API
1622 // requests with the JSON null value. By default, fields with empty values are
1623 // omitted from API requests. See
1624 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1625 NullFields []string `json:"-"`
1626 }
1627
1628 func (s TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
1629 type NoMethod TestIamPermissionsResponse
1630 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1631 }
1632
1633 type ProjectsLocationsGetCall struct {
1634 s *Service
1635 name string
1636 urlParams_ gensupport.URLParams
1637 ifNoneMatch_ string
1638 ctx_ context.Context
1639 header_ http.Header
1640 }
1641
1642 // Get: Gets information about a location.
1643 //
1644 // - name: Resource name for the location.
1645 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
1646 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1647 c.name = name
1648 return c
1649 }
1650
1651 // Fields allows partial responses to be retrieved. See
1652 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1653 // details.
1654 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
1655 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1656 return c
1657 }
1658
1659 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1660 // object's ETag matches the given value. This is useful for getting updates
1661 // only after the object has changed since the last request.
1662 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
1663 c.ifNoneMatch_ = entityTag
1664 return c
1665 }
1666
1667 // Context sets the context to be used in this call's Do method.
1668 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
1669 c.ctx_ = ctx
1670 return c
1671 }
1672
1673 // Header returns a http.Header that can be modified by the caller to add
1674 // headers to the request.
1675 func (c *ProjectsLocationsGetCall) Header() http.Header {
1676 if c.header_ == nil {
1677 c.header_ = make(http.Header)
1678 }
1679 return c.header_
1680 }
1681
1682 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
1683 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1684 if c.ifNoneMatch_ != "" {
1685 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1686 }
1687 c.urlParams_.Set("alt", alt)
1688 c.urlParams_.Set("prettyPrint", "false")
1689 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
1690 urls += "?" + c.urlParams_.Encode()
1691 req, err := http.NewRequest("GET", urls, nil)
1692 if err != nil {
1693 return nil, err
1694 }
1695 req.Header = reqHeaders
1696 googleapi.Expand(req.URL, map[string]string{
1697 "name": c.name,
1698 })
1699 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.get", "request", internallog.HTTPRequest(req, nil))
1700 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1701 }
1702
1703 // Do executes the "apigeeregistry.projects.locations.get" call.
1704 // Any non-2xx status code is an error. Response headers are in either
1705 // *Location.ServerResponse.Header or (if a response was returned at all) in
1706 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1707 // whether the returned error was because http.StatusNotModified was returned.
1708 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
1709 gensupport.SetOptions(c.urlParams_, opts...)
1710 res, err := c.doRequest("json")
1711 if res != nil && res.StatusCode == http.StatusNotModified {
1712 if res.Body != nil {
1713 res.Body.Close()
1714 }
1715 return nil, gensupport.WrapError(&googleapi.Error{
1716 Code: res.StatusCode,
1717 Header: res.Header,
1718 })
1719 }
1720 if err != nil {
1721 return nil, err
1722 }
1723 defer googleapi.CloseBody(res)
1724 if err := googleapi.CheckResponse(res); err != nil {
1725 return nil, gensupport.WrapError(err)
1726 }
1727 ret := &Location{
1728 ServerResponse: googleapi.ServerResponse{
1729 Header: res.Header,
1730 HTTPStatusCode: res.StatusCode,
1731 },
1732 }
1733 target := &ret
1734 b, err := gensupport.DecodeResponseBytes(target, res)
1735 if err != nil {
1736 return nil, err
1737 }
1738 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.get", "response", internallog.HTTPResponse(res, b))
1739 return ret, nil
1740 }
1741
1742 type ProjectsLocationsListCall struct {
1743 s *Service
1744 name string
1745 urlParams_ gensupport.URLParams
1746 ifNoneMatch_ string
1747 ctx_ context.Context
1748 header_ http.Header
1749 }
1750
1751 // List: Lists information about the supported locations for this service.
1752 //
1753 // - name: The resource that owns the locations collection, if applicable.
1754 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
1755 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1756 c.name = name
1757 return c
1758 }
1759
1760 // Filter sets the optional parameter "filter": A filter to narrow down results
1761 // to a preferred subset. The filtering language accepts strings like
1762 // "displayName=tokyo", and is documented in more detail in AIP-160
1763 // (https://google.aip.dev/160).
1764 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
1765 c.urlParams_.Set("filter", filter)
1766 return c
1767 }
1768
1769 // PageSize sets the optional parameter "pageSize": The maximum number of
1770 // results to return. If not set, the service selects a default.
1771 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
1772 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1773 return c
1774 }
1775
1776 // PageToken sets the optional parameter "pageToken": A page token received
1777 // from the `next_page_token` field in the response. Send that page token to
1778 // receive the subsequent page.
1779 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
1780 c.urlParams_.Set("pageToken", pageToken)
1781 return c
1782 }
1783
1784 // Fields allows partial responses to be retrieved. See
1785 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1786 // details.
1787 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
1788 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1789 return c
1790 }
1791
1792 // IfNoneMatch sets an optional parameter which makes the operation fail if the
1793 // object's ETag matches the given value. This is useful for getting updates
1794 // only after the object has changed since the last request.
1795 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
1796 c.ifNoneMatch_ = entityTag
1797 return c
1798 }
1799
1800 // Context sets the context to be used in this call's Do method.
1801 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
1802 c.ctx_ = ctx
1803 return c
1804 }
1805
1806 // Header returns a http.Header that can be modified by the caller to add
1807 // headers to the request.
1808 func (c *ProjectsLocationsListCall) Header() http.Header {
1809 if c.header_ == nil {
1810 c.header_ = make(http.Header)
1811 }
1812 return c.header_
1813 }
1814
1815 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
1816 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
1817 if c.ifNoneMatch_ != "" {
1818 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1819 }
1820 c.urlParams_.Set("alt", alt)
1821 c.urlParams_.Set("prettyPrint", "false")
1822 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
1823 urls += "?" + c.urlParams_.Encode()
1824 req, err := http.NewRequest("GET", urls, nil)
1825 if err != nil {
1826 return nil, err
1827 }
1828 req.Header = reqHeaders
1829 googleapi.Expand(req.URL, map[string]string{
1830 "name": c.name,
1831 })
1832 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.list", "request", internallog.HTTPRequest(req, nil))
1833 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1834 }
1835
1836 // Do executes the "apigeeregistry.projects.locations.list" call.
1837 // Any non-2xx status code is an error. Response headers are in either
1838 // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
1839 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
1840 // check whether the returned error was because http.StatusNotModified was
1841 // returned.
1842 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
1843 gensupport.SetOptions(c.urlParams_, opts...)
1844 res, err := c.doRequest("json")
1845 if res != nil && res.StatusCode == http.StatusNotModified {
1846 if res.Body != nil {
1847 res.Body.Close()
1848 }
1849 return nil, gensupport.WrapError(&googleapi.Error{
1850 Code: res.StatusCode,
1851 Header: res.Header,
1852 })
1853 }
1854 if err != nil {
1855 return nil, err
1856 }
1857 defer googleapi.CloseBody(res)
1858 if err := googleapi.CheckResponse(res); err != nil {
1859 return nil, gensupport.WrapError(err)
1860 }
1861 ret := &ListLocationsResponse{
1862 ServerResponse: googleapi.ServerResponse{
1863 Header: res.Header,
1864 HTTPStatusCode: res.StatusCode,
1865 },
1866 }
1867 target := &ret
1868 b, err := gensupport.DecodeResponseBytes(target, res)
1869 if err != nil {
1870 return nil, err
1871 }
1872 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.list", "response", internallog.HTTPResponse(res, b))
1873 return ret, nil
1874 }
1875
1876 // Pages invokes f for each page of results.
1877 // A non-nil error returned from f will halt the iteration.
1878 // The provided context supersedes any context provided to the Context method.
1879 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
1880 c.ctx_ = ctx
1881 defer c.PageToken(c.urlParams_.Get("pageToken"))
1882 for {
1883 x, err := c.Do()
1884 if err != nil {
1885 return err
1886 }
1887 if err := f(x); err != nil {
1888 return err
1889 }
1890 if x.NextPageToken == "" {
1891 return nil
1892 }
1893 c.PageToken(x.NextPageToken)
1894 }
1895 }
1896
1897 type ProjectsLocationsApisCreateCall struct {
1898 s *Service
1899 parent string
1900 api *Api
1901 urlParams_ gensupport.URLParams
1902 ctx_ context.Context
1903 header_ http.Header
1904 }
1905
1906 // Create: Creates a specified API.
1907 //
1908 // - parent: The parent, which owns this collection of APIs. Format:
1909 // `projects/*/locations/*`.
1910 func (r *ProjectsLocationsApisService) Create(parent string, api *Api) *ProjectsLocationsApisCreateCall {
1911 c := &ProjectsLocationsApisCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1912 c.parent = parent
1913 c.api = api
1914 return c
1915 }
1916
1917 // ApiId sets the optional parameter "apiId": Required. The ID to use for the
1918 // API, which will become the final component of the API's resource name. This
1919 // value should be 4-63 characters, and valid characters are /a-z-/. Following
1920 // AIP-162, IDs must not have the form of a UUID.
1921 func (c *ProjectsLocationsApisCreateCall) ApiId(apiId string) *ProjectsLocationsApisCreateCall {
1922 c.urlParams_.Set("apiId", apiId)
1923 return c
1924 }
1925
1926 // Fields allows partial responses to be retrieved. See
1927 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
1928 // details.
1929 func (c *ProjectsLocationsApisCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisCreateCall {
1930 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1931 return c
1932 }
1933
1934 // Context sets the context to be used in this call's Do method.
1935 func (c *ProjectsLocationsApisCreateCall) Context(ctx context.Context) *ProjectsLocationsApisCreateCall {
1936 c.ctx_ = ctx
1937 return c
1938 }
1939
1940 // Header returns a http.Header that can be modified by the caller to add
1941 // headers to the request.
1942 func (c *ProjectsLocationsApisCreateCall) Header() http.Header {
1943 if c.header_ == nil {
1944 c.header_ = make(http.Header)
1945 }
1946 return c.header_
1947 }
1948
1949 func (c *ProjectsLocationsApisCreateCall) doRequest(alt string) (*http.Response, error) {
1950 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
1951 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.api)
1952 if err != nil {
1953 return nil, err
1954 }
1955 c.urlParams_.Set("alt", alt)
1956 c.urlParams_.Set("prettyPrint", "false")
1957 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apis")
1958 urls += "?" + c.urlParams_.Encode()
1959 req, err := http.NewRequest("POST", urls, body)
1960 if err != nil {
1961 return nil, err
1962 }
1963 req.Header = reqHeaders
1964 googleapi.Expand(req.URL, map[string]string{
1965 "parent": c.parent,
1966 })
1967 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.create", "request", internallog.HTTPRequest(req, body.Bytes()))
1968 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1969 }
1970
1971 // Do executes the "apigeeregistry.projects.locations.apis.create" call.
1972 // Any non-2xx status code is an error. Response headers are in either
1973 // *Api.ServerResponse.Header or (if a response was returned at all) in
1974 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1975 // whether the returned error was because http.StatusNotModified was returned.
1976 func (c *ProjectsLocationsApisCreateCall) Do(opts ...googleapi.CallOption) (*Api, error) {
1977 gensupport.SetOptions(c.urlParams_, opts...)
1978 res, err := c.doRequest("json")
1979 if res != nil && res.StatusCode == http.StatusNotModified {
1980 if res.Body != nil {
1981 res.Body.Close()
1982 }
1983 return nil, gensupport.WrapError(&googleapi.Error{
1984 Code: res.StatusCode,
1985 Header: res.Header,
1986 })
1987 }
1988 if err != nil {
1989 return nil, err
1990 }
1991 defer googleapi.CloseBody(res)
1992 if err := googleapi.CheckResponse(res); err != nil {
1993 return nil, gensupport.WrapError(err)
1994 }
1995 ret := &Api{
1996 ServerResponse: googleapi.ServerResponse{
1997 Header: res.Header,
1998 HTTPStatusCode: res.StatusCode,
1999 },
2000 }
2001 target := &ret
2002 b, err := gensupport.DecodeResponseBytes(target, res)
2003 if err != nil {
2004 return nil, err
2005 }
2006 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.create", "response", internallog.HTTPResponse(res, b))
2007 return ret, nil
2008 }
2009
2010 type ProjectsLocationsApisDeleteCall struct {
2011 s *Service
2012 name string
2013 urlParams_ gensupport.URLParams
2014 ctx_ context.Context
2015 header_ http.Header
2016 }
2017
2018 // Delete: Removes a specified API and all of the resources that it owns.
2019 //
2020 // - name: The name of the API to delete. Format:
2021 // `projects/*/locations/*/apis/*`.
2022 func (r *ProjectsLocationsApisService) Delete(name string) *ProjectsLocationsApisDeleteCall {
2023 c := &ProjectsLocationsApisDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2024 c.name = name
2025 return c
2026 }
2027
2028 // Force sets the optional parameter "force": If set to true, any child
2029 // resources will also be deleted. (Otherwise, the request will only work if
2030 // there are no child resources.)
2031 func (c *ProjectsLocationsApisDeleteCall) Force(force bool) *ProjectsLocationsApisDeleteCall {
2032 c.urlParams_.Set("force", fmt.Sprint(force))
2033 return c
2034 }
2035
2036 // Fields allows partial responses to be retrieved. See
2037 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2038 // details.
2039 func (c *ProjectsLocationsApisDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeleteCall {
2040 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2041 return c
2042 }
2043
2044 // Context sets the context to be used in this call's Do method.
2045 func (c *ProjectsLocationsApisDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisDeleteCall {
2046 c.ctx_ = ctx
2047 return c
2048 }
2049
2050 // Header returns a http.Header that can be modified by the caller to add
2051 // headers to the request.
2052 func (c *ProjectsLocationsApisDeleteCall) Header() http.Header {
2053 if c.header_ == nil {
2054 c.header_ = make(http.Header)
2055 }
2056 return c.header_
2057 }
2058
2059 func (c *ProjectsLocationsApisDeleteCall) doRequest(alt string) (*http.Response, error) {
2060 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2061 c.urlParams_.Set("alt", alt)
2062 c.urlParams_.Set("prettyPrint", "false")
2063 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2064 urls += "?" + c.urlParams_.Encode()
2065 req, err := http.NewRequest("DELETE", urls, nil)
2066 if err != nil {
2067 return nil, err
2068 }
2069 req.Header = reqHeaders
2070 googleapi.Expand(req.URL, map[string]string{
2071 "name": c.name,
2072 })
2073 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.delete", "request", internallog.HTTPRequest(req, nil))
2074 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2075 }
2076
2077 // Do executes the "apigeeregistry.projects.locations.apis.delete" call.
2078 // Any non-2xx status code is an error. Response headers are in either
2079 // *Empty.ServerResponse.Header or (if a response was returned at all) in
2080 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2081 // whether the returned error was because http.StatusNotModified was returned.
2082 func (c *ProjectsLocationsApisDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2083 gensupport.SetOptions(c.urlParams_, opts...)
2084 res, err := c.doRequest("json")
2085 if res != nil && res.StatusCode == http.StatusNotModified {
2086 if res.Body != nil {
2087 res.Body.Close()
2088 }
2089 return nil, gensupport.WrapError(&googleapi.Error{
2090 Code: res.StatusCode,
2091 Header: res.Header,
2092 })
2093 }
2094 if err != nil {
2095 return nil, err
2096 }
2097 defer googleapi.CloseBody(res)
2098 if err := googleapi.CheckResponse(res); err != nil {
2099 return nil, gensupport.WrapError(err)
2100 }
2101 ret := &Empty{
2102 ServerResponse: googleapi.ServerResponse{
2103 Header: res.Header,
2104 HTTPStatusCode: res.StatusCode,
2105 },
2106 }
2107 target := &ret
2108 b, err := gensupport.DecodeResponseBytes(target, res)
2109 if err != nil {
2110 return nil, err
2111 }
2112 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.delete", "response", internallog.HTTPResponse(res, b))
2113 return ret, nil
2114 }
2115
2116 type ProjectsLocationsApisGetCall struct {
2117 s *Service
2118 name string
2119 urlParams_ gensupport.URLParams
2120 ifNoneMatch_ string
2121 ctx_ context.Context
2122 header_ http.Header
2123 }
2124
2125 // Get: Returns a specified API.
2126 //
2127 // - name: The name of the API to retrieve. Format:
2128 // `projects/*/locations/*/apis/*`.
2129 func (r *ProjectsLocationsApisService) Get(name string) *ProjectsLocationsApisGetCall {
2130 c := &ProjectsLocationsApisGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2131 c.name = name
2132 return c
2133 }
2134
2135 // Fields allows partial responses to be retrieved. See
2136 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2137 // details.
2138 func (c *ProjectsLocationsApisGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisGetCall {
2139 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2140 return c
2141 }
2142
2143 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2144 // object's ETag matches the given value. This is useful for getting updates
2145 // only after the object has changed since the last request.
2146 func (c *ProjectsLocationsApisGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisGetCall {
2147 c.ifNoneMatch_ = entityTag
2148 return c
2149 }
2150
2151 // Context sets the context to be used in this call's Do method.
2152 func (c *ProjectsLocationsApisGetCall) Context(ctx context.Context) *ProjectsLocationsApisGetCall {
2153 c.ctx_ = ctx
2154 return c
2155 }
2156
2157 // Header returns a http.Header that can be modified by the caller to add
2158 // headers to the request.
2159 func (c *ProjectsLocationsApisGetCall) Header() http.Header {
2160 if c.header_ == nil {
2161 c.header_ = make(http.Header)
2162 }
2163 return c.header_
2164 }
2165
2166 func (c *ProjectsLocationsApisGetCall) doRequest(alt string) (*http.Response, error) {
2167 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2168 if c.ifNoneMatch_ != "" {
2169 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2170 }
2171 c.urlParams_.Set("alt", alt)
2172 c.urlParams_.Set("prettyPrint", "false")
2173 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2174 urls += "?" + c.urlParams_.Encode()
2175 req, err := http.NewRequest("GET", urls, nil)
2176 if err != nil {
2177 return nil, err
2178 }
2179 req.Header = reqHeaders
2180 googleapi.Expand(req.URL, map[string]string{
2181 "name": c.name,
2182 })
2183 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.get", "request", internallog.HTTPRequest(req, nil))
2184 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2185 }
2186
2187 // Do executes the "apigeeregistry.projects.locations.apis.get" call.
2188 // Any non-2xx status code is an error. Response headers are in either
2189 // *Api.ServerResponse.Header or (if a response was returned at all) in
2190 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2191 // whether the returned error was because http.StatusNotModified was returned.
2192 func (c *ProjectsLocationsApisGetCall) Do(opts ...googleapi.CallOption) (*Api, error) {
2193 gensupport.SetOptions(c.urlParams_, opts...)
2194 res, err := c.doRequest("json")
2195 if res != nil && res.StatusCode == http.StatusNotModified {
2196 if res.Body != nil {
2197 res.Body.Close()
2198 }
2199 return nil, gensupport.WrapError(&googleapi.Error{
2200 Code: res.StatusCode,
2201 Header: res.Header,
2202 })
2203 }
2204 if err != nil {
2205 return nil, err
2206 }
2207 defer googleapi.CloseBody(res)
2208 if err := googleapi.CheckResponse(res); err != nil {
2209 return nil, gensupport.WrapError(err)
2210 }
2211 ret := &Api{
2212 ServerResponse: googleapi.ServerResponse{
2213 Header: res.Header,
2214 HTTPStatusCode: res.StatusCode,
2215 },
2216 }
2217 target := &ret
2218 b, err := gensupport.DecodeResponseBytes(target, res)
2219 if err != nil {
2220 return nil, err
2221 }
2222 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.get", "response", internallog.HTTPResponse(res, b))
2223 return ret, nil
2224 }
2225
2226 type ProjectsLocationsApisGetIamPolicyCall struct {
2227 s *Service
2228 resource string
2229 urlParams_ gensupport.URLParams
2230 ifNoneMatch_ string
2231 ctx_ context.Context
2232 header_ http.Header
2233 }
2234
2235 // GetIamPolicy: Gets the access control policy for a resource. Returns an
2236 // empty policy if the resource exists and does not have a policy set.
2237 //
2238 // - resource: REQUIRED: The resource for which the policy is being requested.
2239 // See Resource names (https://cloud.google.com/apis/design/resource_names)
2240 // for the appropriate value for this field.
2241 func (r *ProjectsLocationsApisService) GetIamPolicy(resource string) *ProjectsLocationsApisGetIamPolicyCall {
2242 c := &ProjectsLocationsApisGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2243 c.resource = resource
2244 return c
2245 }
2246
2247 // OptionsRequestedPolicyVersion sets the optional parameter
2248 // "options.requestedPolicyVersion": The maximum policy version that will be
2249 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
2250 // an invalid value will be rejected. Requests for policies with any
2251 // conditional role bindings must specify version 3. Policies with no
2252 // conditional role bindings may specify any valid value or leave the field
2253 // unset. The policy in the response might use the policy version that you
2254 // specified, or it might use a lower policy version. For example, if you
2255 // specify version 3, but the policy has no conditional role bindings, the
2256 // response uses version 1. To learn which resources support conditions in
2257 // their IAM policies, see the IAM documentation
2258 // (https://cloud.google.com/iam/help/conditions/resource-policies).
2259 func (c *ProjectsLocationsApisGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsApisGetIamPolicyCall {
2260 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
2261 return c
2262 }
2263
2264 // Fields allows partial responses to be retrieved. See
2265 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2266 // details.
2267 func (c *ProjectsLocationsApisGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisGetIamPolicyCall {
2268 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2269 return c
2270 }
2271
2272 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2273 // object's ETag matches the given value. This is useful for getting updates
2274 // only after the object has changed since the last request.
2275 func (c *ProjectsLocationsApisGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisGetIamPolicyCall {
2276 c.ifNoneMatch_ = entityTag
2277 return c
2278 }
2279
2280 // Context sets the context to be used in this call's Do method.
2281 func (c *ProjectsLocationsApisGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisGetIamPolicyCall {
2282 c.ctx_ = ctx
2283 return c
2284 }
2285
2286 // Header returns a http.Header that can be modified by the caller to add
2287 // headers to the request.
2288 func (c *ProjectsLocationsApisGetIamPolicyCall) Header() http.Header {
2289 if c.header_ == nil {
2290 c.header_ = make(http.Header)
2291 }
2292 return c.header_
2293 }
2294
2295 func (c *ProjectsLocationsApisGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2296 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2297 if c.ifNoneMatch_ != "" {
2298 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2299 }
2300 c.urlParams_.Set("alt", alt)
2301 c.urlParams_.Set("prettyPrint", "false")
2302 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
2303 urls += "?" + c.urlParams_.Encode()
2304 req, err := http.NewRequest("GET", urls, nil)
2305 if err != nil {
2306 return nil, err
2307 }
2308 req.Header = reqHeaders
2309 googleapi.Expand(req.URL, map[string]string{
2310 "resource": c.resource,
2311 })
2312 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
2313 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2314 }
2315
2316 // Do executes the "apigeeregistry.projects.locations.apis.getIamPolicy" call.
2317 // Any non-2xx status code is an error. Response headers are in either
2318 // *Policy.ServerResponse.Header or (if a response was returned at all) in
2319 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2320 // whether the returned error was because http.StatusNotModified was returned.
2321 func (c *ProjectsLocationsApisGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2322 gensupport.SetOptions(c.urlParams_, opts...)
2323 res, err := c.doRequest("json")
2324 if res != nil && res.StatusCode == http.StatusNotModified {
2325 if res.Body != nil {
2326 res.Body.Close()
2327 }
2328 return nil, gensupport.WrapError(&googleapi.Error{
2329 Code: res.StatusCode,
2330 Header: res.Header,
2331 })
2332 }
2333 if err != nil {
2334 return nil, err
2335 }
2336 defer googleapi.CloseBody(res)
2337 if err := googleapi.CheckResponse(res); err != nil {
2338 return nil, gensupport.WrapError(err)
2339 }
2340 ret := &Policy{
2341 ServerResponse: googleapi.ServerResponse{
2342 Header: res.Header,
2343 HTTPStatusCode: res.StatusCode,
2344 },
2345 }
2346 target := &ret
2347 b, err := gensupport.DecodeResponseBytes(target, res)
2348 if err != nil {
2349 return nil, err
2350 }
2351 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.getIamPolicy", "response", internallog.HTTPResponse(res, b))
2352 return ret, nil
2353 }
2354
2355 type ProjectsLocationsApisListCall struct {
2356 s *Service
2357 parent string
2358 urlParams_ gensupport.URLParams
2359 ifNoneMatch_ string
2360 ctx_ context.Context
2361 header_ http.Header
2362 }
2363
2364 // List: Returns matching APIs.
2365 //
2366 // - parent: The parent, which owns this collection of APIs. Format:
2367 // `projects/*/locations/*`.
2368 func (r *ProjectsLocationsApisService) List(parent string) *ProjectsLocationsApisListCall {
2369 c := &ProjectsLocationsApisListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2370 c.parent = parent
2371 return c
2372 }
2373
2374 // Filter sets the optional parameter "filter": An expression that can be used
2375 // to filter the list. Filters use the Common Expression Language and can refer
2376 // to all message fields.
2377 func (c *ProjectsLocationsApisListCall) Filter(filter string) *ProjectsLocationsApisListCall {
2378 c.urlParams_.Set("filter", filter)
2379 return c
2380 }
2381
2382 // OrderBy sets the optional parameter "orderBy": A comma-separated list of
2383 // fields, e.g. "foo,bar" Fields can be sorted in descending order using the
2384 // "desc" identifier, e.g. "foo desc,bar"
2385 func (c *ProjectsLocationsApisListCall) OrderBy(orderBy string) *ProjectsLocationsApisListCall {
2386 c.urlParams_.Set("orderBy", orderBy)
2387 return c
2388 }
2389
2390 // PageSize sets the optional parameter "pageSize": The maximum number of APIs
2391 // to return. The service may return fewer than this value. If unspecified, at
2392 // most 50 values will be returned. The maximum is 1000; values above 1000 will
2393 // be coerced to 1000.
2394 func (c *ProjectsLocationsApisListCall) PageSize(pageSize int64) *ProjectsLocationsApisListCall {
2395 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2396 return c
2397 }
2398
2399 // PageToken sets the optional parameter "pageToken": A page token, received
2400 // from a previous `ListApis` call. Provide this to retrieve the subsequent
2401 // page. When paginating, all other parameters provided to `ListApis` must
2402 // match the call that provided the page token.
2403 func (c *ProjectsLocationsApisListCall) PageToken(pageToken string) *ProjectsLocationsApisListCall {
2404 c.urlParams_.Set("pageToken", pageToken)
2405 return c
2406 }
2407
2408 // Fields allows partial responses to be retrieved. See
2409 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2410 // details.
2411 func (c *ProjectsLocationsApisListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisListCall {
2412 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2413 return c
2414 }
2415
2416 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2417 // object's ETag matches the given value. This is useful for getting updates
2418 // only after the object has changed since the last request.
2419 func (c *ProjectsLocationsApisListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisListCall {
2420 c.ifNoneMatch_ = entityTag
2421 return c
2422 }
2423
2424 // Context sets the context to be used in this call's Do method.
2425 func (c *ProjectsLocationsApisListCall) Context(ctx context.Context) *ProjectsLocationsApisListCall {
2426 c.ctx_ = ctx
2427 return c
2428 }
2429
2430 // Header returns a http.Header that can be modified by the caller to add
2431 // headers to the request.
2432 func (c *ProjectsLocationsApisListCall) Header() http.Header {
2433 if c.header_ == nil {
2434 c.header_ = make(http.Header)
2435 }
2436 return c.header_
2437 }
2438
2439 func (c *ProjectsLocationsApisListCall) doRequest(alt string) (*http.Response, error) {
2440 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2441 if c.ifNoneMatch_ != "" {
2442 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2443 }
2444 c.urlParams_.Set("alt", alt)
2445 c.urlParams_.Set("prettyPrint", "false")
2446 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/apis")
2447 urls += "?" + c.urlParams_.Encode()
2448 req, err := http.NewRequest("GET", urls, nil)
2449 if err != nil {
2450 return nil, err
2451 }
2452 req.Header = reqHeaders
2453 googleapi.Expand(req.URL, map[string]string{
2454 "parent": c.parent,
2455 })
2456 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.list", "request", internallog.HTTPRequest(req, nil))
2457 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2458 }
2459
2460 // Do executes the "apigeeregistry.projects.locations.apis.list" call.
2461 // Any non-2xx status code is an error. Response headers are in either
2462 // *ListApisResponse.ServerResponse.Header or (if a response was returned at
2463 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2464 // check whether the returned error was because http.StatusNotModified was
2465 // returned.
2466 func (c *ProjectsLocationsApisListCall) Do(opts ...googleapi.CallOption) (*ListApisResponse, error) {
2467 gensupport.SetOptions(c.urlParams_, opts...)
2468 res, err := c.doRequest("json")
2469 if res != nil && res.StatusCode == http.StatusNotModified {
2470 if res.Body != nil {
2471 res.Body.Close()
2472 }
2473 return nil, gensupport.WrapError(&googleapi.Error{
2474 Code: res.StatusCode,
2475 Header: res.Header,
2476 })
2477 }
2478 if err != nil {
2479 return nil, err
2480 }
2481 defer googleapi.CloseBody(res)
2482 if err := googleapi.CheckResponse(res); err != nil {
2483 return nil, gensupport.WrapError(err)
2484 }
2485 ret := &ListApisResponse{
2486 ServerResponse: googleapi.ServerResponse{
2487 Header: res.Header,
2488 HTTPStatusCode: res.StatusCode,
2489 },
2490 }
2491 target := &ret
2492 b, err := gensupport.DecodeResponseBytes(target, res)
2493 if err != nil {
2494 return nil, err
2495 }
2496 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.list", "response", internallog.HTTPResponse(res, b))
2497 return ret, nil
2498 }
2499
2500 // Pages invokes f for each page of results.
2501 // A non-nil error returned from f will halt the iteration.
2502 // The provided context supersedes any context provided to the Context method.
2503 func (c *ProjectsLocationsApisListCall) Pages(ctx context.Context, f func(*ListApisResponse) error) error {
2504 c.ctx_ = ctx
2505 defer c.PageToken(c.urlParams_.Get("pageToken"))
2506 for {
2507 x, err := c.Do()
2508 if err != nil {
2509 return err
2510 }
2511 if err := f(x); err != nil {
2512 return err
2513 }
2514 if x.NextPageToken == "" {
2515 return nil
2516 }
2517 c.PageToken(x.NextPageToken)
2518 }
2519 }
2520
2521 type ProjectsLocationsApisPatchCall struct {
2522 s *Service
2523 name string
2524 api *Api
2525 urlParams_ gensupport.URLParams
2526 ctx_ context.Context
2527 header_ http.Header
2528 }
2529
2530 // Patch: Used to modify a specified API.
2531 //
2532 // - name: Resource name.
2533 func (r *ProjectsLocationsApisService) Patch(name string, api *Api) *ProjectsLocationsApisPatchCall {
2534 c := &ProjectsLocationsApisPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2535 c.name = name
2536 c.api = api
2537 return c
2538 }
2539
2540 // AllowMissing sets the optional parameter "allowMissing": If set to true, and
2541 // the API is not found, a new API will be created. In this situation,
2542 // `update_mask` is ignored.
2543 func (c *ProjectsLocationsApisPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsApisPatchCall {
2544 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing))
2545 return c
2546 }
2547
2548 // UpdateMask sets the optional parameter "updateMask": The list of fields to
2549 // be updated. If omitted, all fields are updated that are set in the request
2550 // message (fields set to default values are ignored). If an asterisk "*" is
2551 // specified, all fields are updated, including fields that are
2552 // unspecified/default in the request.
2553 func (c *ProjectsLocationsApisPatchCall) UpdateMask(updateMask string) *ProjectsLocationsApisPatchCall {
2554 c.urlParams_.Set("updateMask", updateMask)
2555 return c
2556 }
2557
2558 // Fields allows partial responses to be retrieved. See
2559 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2560 // details.
2561 func (c *ProjectsLocationsApisPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisPatchCall {
2562 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2563 return c
2564 }
2565
2566 // Context sets the context to be used in this call's Do method.
2567 func (c *ProjectsLocationsApisPatchCall) Context(ctx context.Context) *ProjectsLocationsApisPatchCall {
2568 c.ctx_ = ctx
2569 return c
2570 }
2571
2572 // Header returns a http.Header that can be modified by the caller to add
2573 // headers to the request.
2574 func (c *ProjectsLocationsApisPatchCall) Header() http.Header {
2575 if c.header_ == nil {
2576 c.header_ = make(http.Header)
2577 }
2578 return c.header_
2579 }
2580
2581 func (c *ProjectsLocationsApisPatchCall) doRequest(alt string) (*http.Response, error) {
2582 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2583 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.api)
2584 if err != nil {
2585 return nil, err
2586 }
2587 c.urlParams_.Set("alt", alt)
2588 c.urlParams_.Set("prettyPrint", "false")
2589 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2590 urls += "?" + c.urlParams_.Encode()
2591 req, err := http.NewRequest("PATCH", urls, body)
2592 if err != nil {
2593 return nil, err
2594 }
2595 req.Header = reqHeaders
2596 googleapi.Expand(req.URL, map[string]string{
2597 "name": c.name,
2598 })
2599 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
2600 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2601 }
2602
2603 // Do executes the "apigeeregistry.projects.locations.apis.patch" call.
2604 // Any non-2xx status code is an error. Response headers are in either
2605 // *Api.ServerResponse.Header or (if a response was returned at all) in
2606 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2607 // whether the returned error was because http.StatusNotModified was returned.
2608 func (c *ProjectsLocationsApisPatchCall) Do(opts ...googleapi.CallOption) (*Api, error) {
2609 gensupport.SetOptions(c.urlParams_, opts...)
2610 res, err := c.doRequest("json")
2611 if res != nil && res.StatusCode == http.StatusNotModified {
2612 if res.Body != nil {
2613 res.Body.Close()
2614 }
2615 return nil, gensupport.WrapError(&googleapi.Error{
2616 Code: res.StatusCode,
2617 Header: res.Header,
2618 })
2619 }
2620 if err != nil {
2621 return nil, err
2622 }
2623 defer googleapi.CloseBody(res)
2624 if err := googleapi.CheckResponse(res); err != nil {
2625 return nil, gensupport.WrapError(err)
2626 }
2627 ret := &Api{
2628 ServerResponse: googleapi.ServerResponse{
2629 Header: res.Header,
2630 HTTPStatusCode: res.StatusCode,
2631 },
2632 }
2633 target := &ret
2634 b, err := gensupport.DecodeResponseBytes(target, res)
2635 if err != nil {
2636 return nil, err
2637 }
2638 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.patch", "response", internallog.HTTPResponse(res, b))
2639 return ret, nil
2640 }
2641
2642 type ProjectsLocationsApisSetIamPolicyCall struct {
2643 s *Service
2644 resource string
2645 setiampolicyrequest *SetIamPolicyRequest
2646 urlParams_ gensupport.URLParams
2647 ctx_ context.Context
2648 header_ http.Header
2649 }
2650
2651 // SetIamPolicy: Sets the access control policy on the specified resource.
2652 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
2653 // and `PERMISSION_DENIED` errors.
2654 //
2655 // - resource: REQUIRED: The resource for which the policy is being specified.
2656 // See Resource names (https://cloud.google.com/apis/design/resource_names)
2657 // for the appropriate value for this field.
2658 func (r *ProjectsLocationsApisService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsApisSetIamPolicyCall {
2659 c := &ProjectsLocationsApisSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2660 c.resource = resource
2661 c.setiampolicyrequest = setiampolicyrequest
2662 return c
2663 }
2664
2665 // Fields allows partial responses to be retrieved. See
2666 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2667 // details.
2668 func (c *ProjectsLocationsApisSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisSetIamPolicyCall {
2669 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2670 return c
2671 }
2672
2673 // Context sets the context to be used in this call's Do method.
2674 func (c *ProjectsLocationsApisSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisSetIamPolicyCall {
2675 c.ctx_ = ctx
2676 return c
2677 }
2678
2679 // Header returns a http.Header that can be modified by the caller to add
2680 // headers to the request.
2681 func (c *ProjectsLocationsApisSetIamPolicyCall) Header() http.Header {
2682 if c.header_ == nil {
2683 c.header_ = make(http.Header)
2684 }
2685 return c.header_
2686 }
2687
2688 func (c *ProjectsLocationsApisSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
2689 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2690 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
2691 if err != nil {
2692 return nil, err
2693 }
2694 c.urlParams_.Set("alt", alt)
2695 c.urlParams_.Set("prettyPrint", "false")
2696 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
2697 urls += "?" + c.urlParams_.Encode()
2698 req, err := http.NewRequest("POST", urls, body)
2699 if err != nil {
2700 return nil, err
2701 }
2702 req.Header = reqHeaders
2703 googleapi.Expand(req.URL, map[string]string{
2704 "resource": c.resource,
2705 })
2706 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
2707 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2708 }
2709
2710 // Do executes the "apigeeregistry.projects.locations.apis.setIamPolicy" call.
2711 // Any non-2xx status code is an error. Response headers are in either
2712 // *Policy.ServerResponse.Header or (if a response was returned at all) in
2713 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2714 // whether the returned error was because http.StatusNotModified was returned.
2715 func (c *ProjectsLocationsApisSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
2716 gensupport.SetOptions(c.urlParams_, opts...)
2717 res, err := c.doRequest("json")
2718 if res != nil && res.StatusCode == http.StatusNotModified {
2719 if res.Body != nil {
2720 res.Body.Close()
2721 }
2722 return nil, gensupport.WrapError(&googleapi.Error{
2723 Code: res.StatusCode,
2724 Header: res.Header,
2725 })
2726 }
2727 if err != nil {
2728 return nil, err
2729 }
2730 defer googleapi.CloseBody(res)
2731 if err := googleapi.CheckResponse(res); err != nil {
2732 return nil, gensupport.WrapError(err)
2733 }
2734 ret := &Policy{
2735 ServerResponse: googleapi.ServerResponse{
2736 Header: res.Header,
2737 HTTPStatusCode: res.StatusCode,
2738 },
2739 }
2740 target := &ret
2741 b, err := gensupport.DecodeResponseBytes(target, res)
2742 if err != nil {
2743 return nil, err
2744 }
2745 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.setIamPolicy", "response", internallog.HTTPResponse(res, b))
2746 return ret, nil
2747 }
2748
2749 type ProjectsLocationsApisTestIamPermissionsCall struct {
2750 s *Service
2751 resource string
2752 testiampermissionsrequest *TestIamPermissionsRequest
2753 urlParams_ gensupport.URLParams
2754 ctx_ context.Context
2755 header_ http.Header
2756 }
2757
2758 // TestIamPermissions: Returns permissions that a caller has on the specified
2759 // resource. If the resource does not exist, this will return an empty set of
2760 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
2761 // used for building permission-aware UIs and command-line tools, not for
2762 // authorization checking. This operation may "fail open" without warning.
2763 //
2764 // - resource: REQUIRED: The resource for which the policy detail is being
2765 // requested. See Resource names
2766 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
2767 // value for this field.
2768 func (r *ProjectsLocationsApisService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsApisTestIamPermissionsCall {
2769 c := &ProjectsLocationsApisTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2770 c.resource = resource
2771 c.testiampermissionsrequest = testiampermissionsrequest
2772 return c
2773 }
2774
2775 // Fields allows partial responses to be retrieved. See
2776 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2777 // details.
2778 func (c *ProjectsLocationsApisTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisTestIamPermissionsCall {
2779 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2780 return c
2781 }
2782
2783 // Context sets the context to be used in this call's Do method.
2784 func (c *ProjectsLocationsApisTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsApisTestIamPermissionsCall {
2785 c.ctx_ = ctx
2786 return c
2787 }
2788
2789 // Header returns a http.Header that can be modified by the caller to add
2790 // headers to the request.
2791 func (c *ProjectsLocationsApisTestIamPermissionsCall) Header() http.Header {
2792 if c.header_ == nil {
2793 c.header_ = make(http.Header)
2794 }
2795 return c.header_
2796 }
2797
2798 func (c *ProjectsLocationsApisTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
2799 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2800 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
2801 if err != nil {
2802 return nil, err
2803 }
2804 c.urlParams_.Set("alt", alt)
2805 c.urlParams_.Set("prettyPrint", "false")
2806 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
2807 urls += "?" + c.urlParams_.Encode()
2808 req, err := http.NewRequest("POST", urls, body)
2809 if err != nil {
2810 return nil, err
2811 }
2812 req.Header = reqHeaders
2813 googleapi.Expand(req.URL, map[string]string{
2814 "resource": c.resource,
2815 })
2816 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
2817 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2818 }
2819
2820 // Do executes the "apigeeregistry.projects.locations.apis.testIamPermissions" call.
2821 // Any non-2xx status code is an error. Response headers are in either
2822 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
2823 // returned at all) in error.(*googleapi.Error).Header. Use
2824 // googleapi.IsNotModified to check whether the returned error was because
2825 // http.StatusNotModified was returned.
2826 func (c *ProjectsLocationsApisTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
2827 gensupport.SetOptions(c.urlParams_, opts...)
2828 res, err := c.doRequest("json")
2829 if res != nil && res.StatusCode == http.StatusNotModified {
2830 if res.Body != nil {
2831 res.Body.Close()
2832 }
2833 return nil, gensupport.WrapError(&googleapi.Error{
2834 Code: res.StatusCode,
2835 Header: res.Header,
2836 })
2837 }
2838 if err != nil {
2839 return nil, err
2840 }
2841 defer googleapi.CloseBody(res)
2842 if err := googleapi.CheckResponse(res); err != nil {
2843 return nil, gensupport.WrapError(err)
2844 }
2845 ret := &TestIamPermissionsResponse{
2846 ServerResponse: googleapi.ServerResponse{
2847 Header: res.Header,
2848 HTTPStatusCode: res.StatusCode,
2849 },
2850 }
2851 target := &ret
2852 b, err := gensupport.DecodeResponseBytes(target, res)
2853 if err != nil {
2854 return nil, err
2855 }
2856 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.testIamPermissions", "response", internallog.HTTPResponse(res, b))
2857 return ret, nil
2858 }
2859
2860 type ProjectsLocationsApisArtifactsCreateCall struct {
2861 s *Service
2862 parent string
2863 artifact *Artifact
2864 urlParams_ gensupport.URLParams
2865 ctx_ context.Context
2866 header_ http.Header
2867 }
2868
2869 // Create: Creates a specified artifact.
2870 //
2871 // - parent: The parent, which owns this collection of artifacts. Format:
2872 // `{parent}`.
2873 func (r *ProjectsLocationsApisArtifactsService) Create(parent string, artifact *Artifact) *ProjectsLocationsApisArtifactsCreateCall {
2874 c := &ProjectsLocationsApisArtifactsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2875 c.parent = parent
2876 c.artifact = artifact
2877 return c
2878 }
2879
2880 // ArtifactId sets the optional parameter "artifactId": Required. The ID to use
2881 // for the artifact, which will become the final component of the artifact's
2882 // resource name. This value should be 4-63 characters, and valid characters
2883 // are /a-z-/. Following AIP-162, IDs must not have the form of a UUID.
2884 func (c *ProjectsLocationsApisArtifactsCreateCall) ArtifactId(artifactId string) *ProjectsLocationsApisArtifactsCreateCall {
2885 c.urlParams_.Set("artifactId", artifactId)
2886 return c
2887 }
2888
2889 // Fields allows partial responses to be retrieved. See
2890 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2891 // details.
2892 func (c *ProjectsLocationsApisArtifactsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsCreateCall {
2893 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2894 return c
2895 }
2896
2897 // Context sets the context to be used in this call's Do method.
2898 func (c *ProjectsLocationsApisArtifactsCreateCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsCreateCall {
2899 c.ctx_ = ctx
2900 return c
2901 }
2902
2903 // Header returns a http.Header that can be modified by the caller to add
2904 // headers to the request.
2905 func (c *ProjectsLocationsApisArtifactsCreateCall) Header() http.Header {
2906 if c.header_ == nil {
2907 c.header_ = make(http.Header)
2908 }
2909 return c.header_
2910 }
2911
2912 func (c *ProjectsLocationsApisArtifactsCreateCall) doRequest(alt string) (*http.Response, error) {
2913 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2914 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact)
2915 if err != nil {
2916 return nil, err
2917 }
2918 c.urlParams_.Set("alt", alt)
2919 c.urlParams_.Set("prettyPrint", "false")
2920 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
2921 urls += "?" + c.urlParams_.Encode()
2922 req, err := http.NewRequest("POST", urls, body)
2923 if err != nil {
2924 return nil, err
2925 }
2926 req.Header = reqHeaders
2927 googleapi.Expand(req.URL, map[string]string{
2928 "parent": c.parent,
2929 })
2930 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.create", "request", internallog.HTTPRequest(req, body.Bytes()))
2931 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2932 }
2933
2934 // Do executes the "apigeeregistry.projects.locations.apis.artifacts.create" call.
2935 // Any non-2xx status code is an error. Response headers are in either
2936 // *Artifact.ServerResponse.Header or (if a response was returned at all) in
2937 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2938 // whether the returned error was because http.StatusNotModified was returned.
2939 func (c *ProjectsLocationsApisArtifactsCreateCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
2940 gensupport.SetOptions(c.urlParams_, opts...)
2941 res, err := c.doRequest("json")
2942 if res != nil && res.StatusCode == http.StatusNotModified {
2943 if res.Body != nil {
2944 res.Body.Close()
2945 }
2946 return nil, gensupport.WrapError(&googleapi.Error{
2947 Code: res.StatusCode,
2948 Header: res.Header,
2949 })
2950 }
2951 if err != nil {
2952 return nil, err
2953 }
2954 defer googleapi.CloseBody(res)
2955 if err := googleapi.CheckResponse(res); err != nil {
2956 return nil, gensupport.WrapError(err)
2957 }
2958 ret := &Artifact{
2959 ServerResponse: googleapi.ServerResponse{
2960 Header: res.Header,
2961 HTTPStatusCode: res.StatusCode,
2962 },
2963 }
2964 target := &ret
2965 b, err := gensupport.DecodeResponseBytes(target, res)
2966 if err != nil {
2967 return nil, err
2968 }
2969 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.create", "response", internallog.HTTPResponse(res, b))
2970 return ret, nil
2971 }
2972
2973 type ProjectsLocationsApisArtifactsDeleteCall struct {
2974 s *Service
2975 name string
2976 urlParams_ gensupport.URLParams
2977 ctx_ context.Context
2978 header_ http.Header
2979 }
2980
2981 // Delete: Removes a specified artifact.
2982 //
2983 // - name: The name of the artifact to delete. Format: `{parent}/artifacts/*`.
2984 func (r *ProjectsLocationsApisArtifactsService) Delete(name string) *ProjectsLocationsApisArtifactsDeleteCall {
2985 c := &ProjectsLocationsApisArtifactsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2986 c.name = name
2987 return c
2988 }
2989
2990 // Fields allows partial responses to be retrieved. See
2991 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2992 // details.
2993 func (c *ProjectsLocationsApisArtifactsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsDeleteCall {
2994 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2995 return c
2996 }
2997
2998 // Context sets the context to be used in this call's Do method.
2999 func (c *ProjectsLocationsApisArtifactsDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsDeleteCall {
3000 c.ctx_ = ctx
3001 return c
3002 }
3003
3004 // Header returns a http.Header that can be modified by the caller to add
3005 // headers to the request.
3006 func (c *ProjectsLocationsApisArtifactsDeleteCall) Header() http.Header {
3007 if c.header_ == nil {
3008 c.header_ = make(http.Header)
3009 }
3010 return c.header_
3011 }
3012
3013 func (c *ProjectsLocationsApisArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) {
3014 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3015 c.urlParams_.Set("alt", alt)
3016 c.urlParams_.Set("prettyPrint", "false")
3017 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3018 urls += "?" + c.urlParams_.Encode()
3019 req, err := http.NewRequest("DELETE", urls, nil)
3020 if err != nil {
3021 return nil, err
3022 }
3023 req.Header = reqHeaders
3024 googleapi.Expand(req.URL, map[string]string{
3025 "name": c.name,
3026 })
3027 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.delete", "request", internallog.HTTPRequest(req, nil))
3028 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3029 }
3030
3031 // Do executes the "apigeeregistry.projects.locations.apis.artifacts.delete" call.
3032 // Any non-2xx status code is an error. Response headers are in either
3033 // *Empty.ServerResponse.Header or (if a response was returned at all) in
3034 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3035 // whether the returned error was because http.StatusNotModified was returned.
3036 func (c *ProjectsLocationsApisArtifactsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3037 gensupport.SetOptions(c.urlParams_, opts...)
3038 res, err := c.doRequest("json")
3039 if res != nil && res.StatusCode == http.StatusNotModified {
3040 if res.Body != nil {
3041 res.Body.Close()
3042 }
3043 return nil, gensupport.WrapError(&googleapi.Error{
3044 Code: res.StatusCode,
3045 Header: res.Header,
3046 })
3047 }
3048 if err != nil {
3049 return nil, err
3050 }
3051 defer googleapi.CloseBody(res)
3052 if err := googleapi.CheckResponse(res); err != nil {
3053 return nil, gensupport.WrapError(err)
3054 }
3055 ret := &Empty{
3056 ServerResponse: googleapi.ServerResponse{
3057 Header: res.Header,
3058 HTTPStatusCode: res.StatusCode,
3059 },
3060 }
3061 target := &ret
3062 b, err := gensupport.DecodeResponseBytes(target, res)
3063 if err != nil {
3064 return nil, err
3065 }
3066 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.delete", "response", internallog.HTTPResponse(res, b))
3067 return ret, nil
3068 }
3069
3070 type ProjectsLocationsApisArtifactsGetCall struct {
3071 s *Service
3072 name string
3073 urlParams_ gensupport.URLParams
3074 ifNoneMatch_ string
3075 ctx_ context.Context
3076 header_ http.Header
3077 }
3078
3079 // Get: Returns a specified artifact.
3080 //
3081 // - name: The name of the artifact to retrieve. Format: `{parent}/artifacts/*`.
3082 func (r *ProjectsLocationsApisArtifactsService) Get(name string) *ProjectsLocationsApisArtifactsGetCall {
3083 c := &ProjectsLocationsApisArtifactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3084 c.name = name
3085 return c
3086 }
3087
3088 // Fields allows partial responses to be retrieved. See
3089 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3090 // details.
3091 func (c *ProjectsLocationsApisArtifactsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsGetCall {
3092 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3093 return c
3094 }
3095
3096 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3097 // object's ETag matches the given value. This is useful for getting updates
3098 // only after the object has changed since the last request.
3099 func (c *ProjectsLocationsApisArtifactsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisArtifactsGetCall {
3100 c.ifNoneMatch_ = entityTag
3101 return c
3102 }
3103
3104 // Context sets the context to be used in this call's Do method.
3105 func (c *ProjectsLocationsApisArtifactsGetCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsGetCall {
3106 c.ctx_ = ctx
3107 return c
3108 }
3109
3110 // Header returns a http.Header that can be modified by the caller to add
3111 // headers to the request.
3112 func (c *ProjectsLocationsApisArtifactsGetCall) Header() http.Header {
3113 if c.header_ == nil {
3114 c.header_ = make(http.Header)
3115 }
3116 return c.header_
3117 }
3118
3119 func (c *ProjectsLocationsApisArtifactsGetCall) doRequest(alt string) (*http.Response, error) {
3120 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3121 if c.ifNoneMatch_ != "" {
3122 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3123 }
3124 c.urlParams_.Set("alt", alt)
3125 c.urlParams_.Set("prettyPrint", "false")
3126 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3127 urls += "?" + c.urlParams_.Encode()
3128 req, err := http.NewRequest("GET", urls, nil)
3129 if err != nil {
3130 return nil, err
3131 }
3132 req.Header = reqHeaders
3133 googleapi.Expand(req.URL, map[string]string{
3134 "name": c.name,
3135 })
3136 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.get", "request", internallog.HTTPRequest(req, nil))
3137 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3138 }
3139
3140 // Do executes the "apigeeregistry.projects.locations.apis.artifacts.get" call.
3141 // Any non-2xx status code is an error. Response headers are in either
3142 // *Artifact.ServerResponse.Header or (if a response was returned at all) in
3143 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3144 // whether the returned error was because http.StatusNotModified was returned.
3145 func (c *ProjectsLocationsApisArtifactsGetCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
3146 gensupport.SetOptions(c.urlParams_, opts...)
3147 res, err := c.doRequest("json")
3148 if res != nil && res.StatusCode == http.StatusNotModified {
3149 if res.Body != nil {
3150 res.Body.Close()
3151 }
3152 return nil, gensupport.WrapError(&googleapi.Error{
3153 Code: res.StatusCode,
3154 Header: res.Header,
3155 })
3156 }
3157 if err != nil {
3158 return nil, err
3159 }
3160 defer googleapi.CloseBody(res)
3161 if err := googleapi.CheckResponse(res); err != nil {
3162 return nil, gensupport.WrapError(err)
3163 }
3164 ret := &Artifact{
3165 ServerResponse: googleapi.ServerResponse{
3166 Header: res.Header,
3167 HTTPStatusCode: res.StatusCode,
3168 },
3169 }
3170 target := &ret
3171 b, err := gensupport.DecodeResponseBytes(target, res)
3172 if err != nil {
3173 return nil, err
3174 }
3175 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.get", "response", internallog.HTTPResponse(res, b))
3176 return ret, nil
3177 }
3178
3179 type ProjectsLocationsApisArtifactsGetContentsCall struct {
3180 s *Service
3181 name string
3182 urlParams_ gensupport.URLParams
3183 ifNoneMatch_ string
3184 ctx_ context.Context
3185 header_ http.Header
3186 }
3187
3188 // GetContents: Returns the contents of a specified artifact. If artifacts are
3189 // stored with GZip compression, the default behavior is to return the artifact
3190 // uncompressed (the mime_type response field indicates the exact format
3191 // returned).
3192 //
3193 // - name: The name of the artifact whose contents should be retrieved. Format:
3194 // `{parent}/artifacts/*`.
3195 func (r *ProjectsLocationsApisArtifactsService) GetContents(name string) *ProjectsLocationsApisArtifactsGetContentsCall {
3196 c := &ProjectsLocationsApisArtifactsGetContentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3197 c.name = name
3198 return c
3199 }
3200
3201 // Fields allows partial responses to be retrieved. See
3202 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3203 // details.
3204 func (c *ProjectsLocationsApisArtifactsGetContentsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsGetContentsCall {
3205 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3206 return c
3207 }
3208
3209 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3210 // object's ETag matches the given value. This is useful for getting updates
3211 // only after the object has changed since the last request.
3212 func (c *ProjectsLocationsApisArtifactsGetContentsCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisArtifactsGetContentsCall {
3213 c.ifNoneMatch_ = entityTag
3214 return c
3215 }
3216
3217 // Context sets the context to be used in this call's Do method.
3218 func (c *ProjectsLocationsApisArtifactsGetContentsCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsGetContentsCall {
3219 c.ctx_ = ctx
3220 return c
3221 }
3222
3223 // Header returns a http.Header that can be modified by the caller to add
3224 // headers to the request.
3225 func (c *ProjectsLocationsApisArtifactsGetContentsCall) Header() http.Header {
3226 if c.header_ == nil {
3227 c.header_ = make(http.Header)
3228 }
3229 return c.header_
3230 }
3231
3232 func (c *ProjectsLocationsApisArtifactsGetContentsCall) doRequest(alt string) (*http.Response, error) {
3233 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3234 if c.ifNoneMatch_ != "" {
3235 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3236 }
3237 c.urlParams_.Set("alt", alt)
3238 c.urlParams_.Set("prettyPrint", "false")
3239 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents")
3240 urls += "?" + c.urlParams_.Encode()
3241 req, err := http.NewRequest("GET", urls, nil)
3242 if err != nil {
3243 return nil, err
3244 }
3245 req.Header = reqHeaders
3246 googleapi.Expand(req.URL, map[string]string{
3247 "name": c.name,
3248 })
3249 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.getContents", "request", internallog.HTTPRequest(req, nil))
3250 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3251 }
3252
3253 // Do executes the "apigeeregistry.projects.locations.apis.artifacts.getContents" call.
3254 // Any non-2xx status code is an error. Response headers are in either
3255 // *HttpBody.ServerResponse.Header or (if a response was returned at all) in
3256 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3257 // whether the returned error was because http.StatusNotModified was returned.
3258 func (c *ProjectsLocationsApisArtifactsGetContentsCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
3259 gensupport.SetOptions(c.urlParams_, opts...)
3260 res, err := c.doRequest("json")
3261 if res != nil && res.StatusCode == http.StatusNotModified {
3262 if res.Body != nil {
3263 res.Body.Close()
3264 }
3265 return nil, gensupport.WrapError(&googleapi.Error{
3266 Code: res.StatusCode,
3267 Header: res.Header,
3268 })
3269 }
3270 if err != nil {
3271 return nil, err
3272 }
3273 defer googleapi.CloseBody(res)
3274 if err := googleapi.CheckResponse(res); err != nil {
3275 return nil, gensupport.WrapError(err)
3276 }
3277 ret := &HttpBody{
3278 ServerResponse: googleapi.ServerResponse{
3279 Header: res.Header,
3280 HTTPStatusCode: res.StatusCode,
3281 },
3282 }
3283 target := &ret
3284 b, err := gensupport.DecodeResponseBytes(target, res)
3285 if err != nil {
3286 return nil, err
3287 }
3288 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.getContents", "response", internallog.HTTPResponse(res, b))
3289 return ret, nil
3290 }
3291
3292 type ProjectsLocationsApisArtifactsGetIamPolicyCall struct {
3293 s *Service
3294 resource string
3295 urlParams_ gensupport.URLParams
3296 ifNoneMatch_ string
3297 ctx_ context.Context
3298 header_ http.Header
3299 }
3300
3301 // GetIamPolicy: Gets the access control policy for a resource. Returns an
3302 // empty policy if the resource exists and does not have a policy set.
3303 //
3304 // - resource: REQUIRED: The resource for which the policy is being requested.
3305 // See Resource names (https://cloud.google.com/apis/design/resource_names)
3306 // for the appropriate value for this field.
3307 func (r *ProjectsLocationsApisArtifactsService) GetIamPolicy(resource string) *ProjectsLocationsApisArtifactsGetIamPolicyCall {
3308 c := &ProjectsLocationsApisArtifactsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3309 c.resource = resource
3310 return c
3311 }
3312
3313 // OptionsRequestedPolicyVersion sets the optional parameter
3314 // "options.requestedPolicyVersion": The maximum policy version that will be
3315 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
3316 // an invalid value will be rejected. Requests for policies with any
3317 // conditional role bindings must specify version 3. Policies with no
3318 // conditional role bindings may specify any valid value or leave the field
3319 // unset. The policy in the response might use the policy version that you
3320 // specified, or it might use a lower policy version. For example, if you
3321 // specify version 3, but the policy has no conditional role bindings, the
3322 // response uses version 1. To learn which resources support conditions in
3323 // their IAM policies, see the IAM documentation
3324 // (https://cloud.google.com/iam/help/conditions/resource-policies).
3325 func (c *ProjectsLocationsApisArtifactsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsApisArtifactsGetIamPolicyCall {
3326 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
3327 return c
3328 }
3329
3330 // Fields allows partial responses to be retrieved. See
3331 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3332 // details.
3333 func (c *ProjectsLocationsApisArtifactsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsGetIamPolicyCall {
3334 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3335 return c
3336 }
3337
3338 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3339 // object's ETag matches the given value. This is useful for getting updates
3340 // only after the object has changed since the last request.
3341 func (c *ProjectsLocationsApisArtifactsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisArtifactsGetIamPolicyCall {
3342 c.ifNoneMatch_ = entityTag
3343 return c
3344 }
3345
3346 // Context sets the context to be used in this call's Do method.
3347 func (c *ProjectsLocationsApisArtifactsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsGetIamPolicyCall {
3348 c.ctx_ = ctx
3349 return c
3350 }
3351
3352 // Header returns a http.Header that can be modified by the caller to add
3353 // headers to the request.
3354 func (c *ProjectsLocationsApisArtifactsGetIamPolicyCall) Header() http.Header {
3355 if c.header_ == nil {
3356 c.header_ = make(http.Header)
3357 }
3358 return c.header_
3359 }
3360
3361 func (c *ProjectsLocationsApisArtifactsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3362 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3363 if c.ifNoneMatch_ != "" {
3364 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3365 }
3366 c.urlParams_.Set("alt", alt)
3367 c.urlParams_.Set("prettyPrint", "false")
3368 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
3369 urls += "?" + c.urlParams_.Encode()
3370 req, err := http.NewRequest("GET", urls, nil)
3371 if err != nil {
3372 return nil, err
3373 }
3374 req.Header = reqHeaders
3375 googleapi.Expand(req.URL, map[string]string{
3376 "resource": c.resource,
3377 })
3378 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
3379 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3380 }
3381
3382 // Do executes the "apigeeregistry.projects.locations.apis.artifacts.getIamPolicy" call.
3383 // Any non-2xx status code is an error. Response headers are in either
3384 // *Policy.ServerResponse.Header or (if a response was returned at all) in
3385 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3386 // whether the returned error was because http.StatusNotModified was returned.
3387 func (c *ProjectsLocationsApisArtifactsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3388 gensupport.SetOptions(c.urlParams_, opts...)
3389 res, err := c.doRequest("json")
3390 if res != nil && res.StatusCode == http.StatusNotModified {
3391 if res.Body != nil {
3392 res.Body.Close()
3393 }
3394 return nil, gensupport.WrapError(&googleapi.Error{
3395 Code: res.StatusCode,
3396 Header: res.Header,
3397 })
3398 }
3399 if err != nil {
3400 return nil, err
3401 }
3402 defer googleapi.CloseBody(res)
3403 if err := googleapi.CheckResponse(res); err != nil {
3404 return nil, gensupport.WrapError(err)
3405 }
3406 ret := &Policy{
3407 ServerResponse: googleapi.ServerResponse{
3408 Header: res.Header,
3409 HTTPStatusCode: res.StatusCode,
3410 },
3411 }
3412 target := &ret
3413 b, err := gensupport.DecodeResponseBytes(target, res)
3414 if err != nil {
3415 return nil, err
3416 }
3417 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.getIamPolicy", "response", internallog.HTTPResponse(res, b))
3418 return ret, nil
3419 }
3420
3421 type ProjectsLocationsApisArtifactsListCall struct {
3422 s *Service
3423 parent string
3424 urlParams_ gensupport.URLParams
3425 ifNoneMatch_ string
3426 ctx_ context.Context
3427 header_ http.Header
3428 }
3429
3430 // List: Returns matching artifacts.
3431 //
3432 // - parent: The parent, which owns this collection of artifacts. Format:
3433 // `{parent}`.
3434 func (r *ProjectsLocationsApisArtifactsService) List(parent string) *ProjectsLocationsApisArtifactsListCall {
3435 c := &ProjectsLocationsApisArtifactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3436 c.parent = parent
3437 return c
3438 }
3439
3440 // Filter sets the optional parameter "filter": An expression that can be used
3441 // to filter the list. Filters use the Common Expression Language and can refer
3442 // to all message fields except contents.
3443 func (c *ProjectsLocationsApisArtifactsListCall) Filter(filter string) *ProjectsLocationsApisArtifactsListCall {
3444 c.urlParams_.Set("filter", filter)
3445 return c
3446 }
3447
3448 // OrderBy sets the optional parameter "orderBy": A comma-separated list of
3449 // fields, e.g. "foo,bar" Fields can be sorted in descending order using the
3450 // "desc" identifier, e.g. "foo desc,bar"
3451 func (c *ProjectsLocationsApisArtifactsListCall) OrderBy(orderBy string) *ProjectsLocationsApisArtifactsListCall {
3452 c.urlParams_.Set("orderBy", orderBy)
3453 return c
3454 }
3455
3456 // PageSize sets the optional parameter "pageSize": The maximum number of
3457 // artifacts to return. The service may return fewer than this value. If
3458 // unspecified, at most 50 values will be returned. The maximum is 1000; values
3459 // above 1000 will be coerced to 1000.
3460 func (c *ProjectsLocationsApisArtifactsListCall) PageSize(pageSize int64) *ProjectsLocationsApisArtifactsListCall {
3461 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3462 return c
3463 }
3464
3465 // PageToken sets the optional parameter "pageToken": A page token, received
3466 // from a previous `ListArtifacts` call. Provide this to retrieve the
3467 // subsequent page. When paginating, all other parameters provided to
3468 // `ListArtifacts` must match the call that provided the page token.
3469 func (c *ProjectsLocationsApisArtifactsListCall) PageToken(pageToken string) *ProjectsLocationsApisArtifactsListCall {
3470 c.urlParams_.Set("pageToken", pageToken)
3471 return c
3472 }
3473
3474 // Fields allows partial responses to be retrieved. See
3475 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3476 // details.
3477 func (c *ProjectsLocationsApisArtifactsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsListCall {
3478 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3479 return c
3480 }
3481
3482 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3483 // object's ETag matches the given value. This is useful for getting updates
3484 // only after the object has changed since the last request.
3485 func (c *ProjectsLocationsApisArtifactsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisArtifactsListCall {
3486 c.ifNoneMatch_ = entityTag
3487 return c
3488 }
3489
3490 // Context sets the context to be used in this call's Do method.
3491 func (c *ProjectsLocationsApisArtifactsListCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsListCall {
3492 c.ctx_ = ctx
3493 return c
3494 }
3495
3496 // Header returns a http.Header that can be modified by the caller to add
3497 // headers to the request.
3498 func (c *ProjectsLocationsApisArtifactsListCall) Header() http.Header {
3499 if c.header_ == nil {
3500 c.header_ = make(http.Header)
3501 }
3502 return c.header_
3503 }
3504
3505 func (c *ProjectsLocationsApisArtifactsListCall) doRequest(alt string) (*http.Response, error) {
3506 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3507 if c.ifNoneMatch_ != "" {
3508 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3509 }
3510 c.urlParams_.Set("alt", alt)
3511 c.urlParams_.Set("prettyPrint", "false")
3512 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
3513 urls += "?" + c.urlParams_.Encode()
3514 req, err := http.NewRequest("GET", urls, nil)
3515 if err != nil {
3516 return nil, err
3517 }
3518 req.Header = reqHeaders
3519 googleapi.Expand(req.URL, map[string]string{
3520 "parent": c.parent,
3521 })
3522 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.list", "request", internallog.HTTPRequest(req, nil))
3523 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3524 }
3525
3526 // Do executes the "apigeeregistry.projects.locations.apis.artifacts.list" call.
3527 // Any non-2xx status code is an error. Response headers are in either
3528 // *ListArtifactsResponse.ServerResponse.Header or (if a response was returned
3529 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3530 // check whether the returned error was because http.StatusNotModified was
3531 // returned.
3532 func (c *ProjectsLocationsApisArtifactsListCall) Do(opts ...googleapi.CallOption) (*ListArtifactsResponse, error) {
3533 gensupport.SetOptions(c.urlParams_, opts...)
3534 res, err := c.doRequest("json")
3535 if res != nil && res.StatusCode == http.StatusNotModified {
3536 if res.Body != nil {
3537 res.Body.Close()
3538 }
3539 return nil, gensupport.WrapError(&googleapi.Error{
3540 Code: res.StatusCode,
3541 Header: res.Header,
3542 })
3543 }
3544 if err != nil {
3545 return nil, err
3546 }
3547 defer googleapi.CloseBody(res)
3548 if err := googleapi.CheckResponse(res); err != nil {
3549 return nil, gensupport.WrapError(err)
3550 }
3551 ret := &ListArtifactsResponse{
3552 ServerResponse: googleapi.ServerResponse{
3553 Header: res.Header,
3554 HTTPStatusCode: res.StatusCode,
3555 },
3556 }
3557 target := &ret
3558 b, err := gensupport.DecodeResponseBytes(target, res)
3559 if err != nil {
3560 return nil, err
3561 }
3562 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.list", "response", internallog.HTTPResponse(res, b))
3563 return ret, nil
3564 }
3565
3566 // Pages invokes f for each page of results.
3567 // A non-nil error returned from f will halt the iteration.
3568 // The provided context supersedes any context provided to the Context method.
3569 func (c *ProjectsLocationsApisArtifactsListCall) Pages(ctx context.Context, f func(*ListArtifactsResponse) error) error {
3570 c.ctx_ = ctx
3571 defer c.PageToken(c.urlParams_.Get("pageToken"))
3572 for {
3573 x, err := c.Do()
3574 if err != nil {
3575 return err
3576 }
3577 if err := f(x); err != nil {
3578 return err
3579 }
3580 if x.NextPageToken == "" {
3581 return nil
3582 }
3583 c.PageToken(x.NextPageToken)
3584 }
3585 }
3586
3587 type ProjectsLocationsApisArtifactsReplaceArtifactCall struct {
3588 s *Service
3589 name string
3590 artifact *Artifact
3591 urlParams_ gensupport.URLParams
3592 ctx_ context.Context
3593 header_ http.Header
3594 }
3595
3596 // ReplaceArtifact: Used to replace a specified artifact.
3597 //
3598 // - name: Resource name.
3599 func (r *ProjectsLocationsApisArtifactsService) ReplaceArtifact(name string, artifact *Artifact) *ProjectsLocationsApisArtifactsReplaceArtifactCall {
3600 c := &ProjectsLocationsApisArtifactsReplaceArtifactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3601 c.name = name
3602 c.artifact = artifact
3603 return c
3604 }
3605
3606 // Fields allows partial responses to be retrieved. See
3607 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3608 // details.
3609 func (c *ProjectsLocationsApisArtifactsReplaceArtifactCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsReplaceArtifactCall {
3610 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3611 return c
3612 }
3613
3614 // Context sets the context to be used in this call's Do method.
3615 func (c *ProjectsLocationsApisArtifactsReplaceArtifactCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsReplaceArtifactCall {
3616 c.ctx_ = ctx
3617 return c
3618 }
3619
3620 // Header returns a http.Header that can be modified by the caller to add
3621 // headers to the request.
3622 func (c *ProjectsLocationsApisArtifactsReplaceArtifactCall) Header() http.Header {
3623 if c.header_ == nil {
3624 c.header_ = make(http.Header)
3625 }
3626 return c.header_
3627 }
3628
3629 func (c *ProjectsLocationsApisArtifactsReplaceArtifactCall) doRequest(alt string) (*http.Response, error) {
3630 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3631 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact)
3632 if err != nil {
3633 return nil, err
3634 }
3635 c.urlParams_.Set("alt", alt)
3636 c.urlParams_.Set("prettyPrint", "false")
3637 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3638 urls += "?" + c.urlParams_.Encode()
3639 req, err := http.NewRequest("PUT", urls, body)
3640 if err != nil {
3641 return nil, err
3642 }
3643 req.Header = reqHeaders
3644 googleapi.Expand(req.URL, map[string]string{
3645 "name": c.name,
3646 })
3647 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.replaceArtifact", "request", internallog.HTTPRequest(req, body.Bytes()))
3648 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3649 }
3650
3651 // Do executes the "apigeeregistry.projects.locations.apis.artifacts.replaceArtifact" call.
3652 // Any non-2xx status code is an error. Response headers are in either
3653 // *Artifact.ServerResponse.Header or (if a response was returned at all) in
3654 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3655 // whether the returned error was because http.StatusNotModified was returned.
3656 func (c *ProjectsLocationsApisArtifactsReplaceArtifactCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
3657 gensupport.SetOptions(c.urlParams_, opts...)
3658 res, err := c.doRequest("json")
3659 if res != nil && res.StatusCode == http.StatusNotModified {
3660 if res.Body != nil {
3661 res.Body.Close()
3662 }
3663 return nil, gensupport.WrapError(&googleapi.Error{
3664 Code: res.StatusCode,
3665 Header: res.Header,
3666 })
3667 }
3668 if err != nil {
3669 return nil, err
3670 }
3671 defer googleapi.CloseBody(res)
3672 if err := googleapi.CheckResponse(res); err != nil {
3673 return nil, gensupport.WrapError(err)
3674 }
3675 ret := &Artifact{
3676 ServerResponse: googleapi.ServerResponse{
3677 Header: res.Header,
3678 HTTPStatusCode: res.StatusCode,
3679 },
3680 }
3681 target := &ret
3682 b, err := gensupport.DecodeResponseBytes(target, res)
3683 if err != nil {
3684 return nil, err
3685 }
3686 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.replaceArtifact", "response", internallog.HTTPResponse(res, b))
3687 return ret, nil
3688 }
3689
3690 type ProjectsLocationsApisArtifactsSetIamPolicyCall struct {
3691 s *Service
3692 resource string
3693 setiampolicyrequest *SetIamPolicyRequest
3694 urlParams_ gensupport.URLParams
3695 ctx_ context.Context
3696 header_ http.Header
3697 }
3698
3699 // SetIamPolicy: Sets the access control policy on the specified resource.
3700 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
3701 // and `PERMISSION_DENIED` errors.
3702 //
3703 // - resource: REQUIRED: The resource for which the policy is being specified.
3704 // See Resource names (https://cloud.google.com/apis/design/resource_names)
3705 // for the appropriate value for this field.
3706 func (r *ProjectsLocationsApisArtifactsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsApisArtifactsSetIamPolicyCall {
3707 c := &ProjectsLocationsApisArtifactsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3708 c.resource = resource
3709 c.setiampolicyrequest = setiampolicyrequest
3710 return c
3711 }
3712
3713 // Fields allows partial responses to be retrieved. See
3714 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3715 // details.
3716 func (c *ProjectsLocationsApisArtifactsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsSetIamPolicyCall {
3717 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3718 return c
3719 }
3720
3721 // Context sets the context to be used in this call's Do method.
3722 func (c *ProjectsLocationsApisArtifactsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsSetIamPolicyCall {
3723 c.ctx_ = ctx
3724 return c
3725 }
3726
3727 // Header returns a http.Header that can be modified by the caller to add
3728 // headers to the request.
3729 func (c *ProjectsLocationsApisArtifactsSetIamPolicyCall) Header() http.Header {
3730 if c.header_ == nil {
3731 c.header_ = make(http.Header)
3732 }
3733 return c.header_
3734 }
3735
3736 func (c *ProjectsLocationsApisArtifactsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
3737 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3738 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
3739 if err != nil {
3740 return nil, err
3741 }
3742 c.urlParams_.Set("alt", alt)
3743 c.urlParams_.Set("prettyPrint", "false")
3744 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
3745 urls += "?" + c.urlParams_.Encode()
3746 req, err := http.NewRequest("POST", urls, body)
3747 if err != nil {
3748 return nil, err
3749 }
3750 req.Header = reqHeaders
3751 googleapi.Expand(req.URL, map[string]string{
3752 "resource": c.resource,
3753 })
3754 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
3755 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3756 }
3757
3758 // Do executes the "apigeeregistry.projects.locations.apis.artifacts.setIamPolicy" call.
3759 // Any non-2xx status code is an error. Response headers are in either
3760 // *Policy.ServerResponse.Header or (if a response was returned at all) in
3761 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3762 // whether the returned error was because http.StatusNotModified was returned.
3763 func (c *ProjectsLocationsApisArtifactsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
3764 gensupport.SetOptions(c.urlParams_, opts...)
3765 res, err := c.doRequest("json")
3766 if res != nil && res.StatusCode == http.StatusNotModified {
3767 if res.Body != nil {
3768 res.Body.Close()
3769 }
3770 return nil, gensupport.WrapError(&googleapi.Error{
3771 Code: res.StatusCode,
3772 Header: res.Header,
3773 })
3774 }
3775 if err != nil {
3776 return nil, err
3777 }
3778 defer googleapi.CloseBody(res)
3779 if err := googleapi.CheckResponse(res); err != nil {
3780 return nil, gensupport.WrapError(err)
3781 }
3782 ret := &Policy{
3783 ServerResponse: googleapi.ServerResponse{
3784 Header: res.Header,
3785 HTTPStatusCode: res.StatusCode,
3786 },
3787 }
3788 target := &ret
3789 b, err := gensupport.DecodeResponseBytes(target, res)
3790 if err != nil {
3791 return nil, err
3792 }
3793 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.setIamPolicy", "response", internallog.HTTPResponse(res, b))
3794 return ret, nil
3795 }
3796
3797 type ProjectsLocationsApisArtifactsTestIamPermissionsCall struct {
3798 s *Service
3799 resource string
3800 testiampermissionsrequest *TestIamPermissionsRequest
3801 urlParams_ gensupport.URLParams
3802 ctx_ context.Context
3803 header_ http.Header
3804 }
3805
3806 // TestIamPermissions: Returns permissions that a caller has on the specified
3807 // resource. If the resource does not exist, this will return an empty set of
3808 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
3809 // used for building permission-aware UIs and command-line tools, not for
3810 // authorization checking. This operation may "fail open" without warning.
3811 //
3812 // - resource: REQUIRED: The resource for which the policy detail is being
3813 // requested. See Resource names
3814 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
3815 // value for this field.
3816 func (r *ProjectsLocationsApisArtifactsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsApisArtifactsTestIamPermissionsCall {
3817 c := &ProjectsLocationsApisArtifactsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3818 c.resource = resource
3819 c.testiampermissionsrequest = testiampermissionsrequest
3820 return c
3821 }
3822
3823 // Fields allows partial responses to be retrieved. See
3824 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3825 // details.
3826 func (c *ProjectsLocationsApisArtifactsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisArtifactsTestIamPermissionsCall {
3827 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3828 return c
3829 }
3830
3831 // Context sets the context to be used in this call's Do method.
3832 func (c *ProjectsLocationsApisArtifactsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsApisArtifactsTestIamPermissionsCall {
3833 c.ctx_ = ctx
3834 return c
3835 }
3836
3837 // Header returns a http.Header that can be modified by the caller to add
3838 // headers to the request.
3839 func (c *ProjectsLocationsApisArtifactsTestIamPermissionsCall) Header() http.Header {
3840 if c.header_ == nil {
3841 c.header_ = make(http.Header)
3842 }
3843 return c.header_
3844 }
3845
3846 func (c *ProjectsLocationsApisArtifactsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
3847 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3848 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
3849 if err != nil {
3850 return nil, err
3851 }
3852 c.urlParams_.Set("alt", alt)
3853 c.urlParams_.Set("prettyPrint", "false")
3854 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
3855 urls += "?" + c.urlParams_.Encode()
3856 req, err := http.NewRequest("POST", urls, body)
3857 if err != nil {
3858 return nil, err
3859 }
3860 req.Header = reqHeaders
3861 googleapi.Expand(req.URL, map[string]string{
3862 "resource": c.resource,
3863 })
3864 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
3865 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3866 }
3867
3868 // Do executes the "apigeeregistry.projects.locations.apis.artifacts.testIamPermissions" call.
3869 // Any non-2xx status code is an error. Response headers are in either
3870 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
3871 // returned at all) in error.(*googleapi.Error).Header. Use
3872 // googleapi.IsNotModified to check whether the returned error was because
3873 // http.StatusNotModified was returned.
3874 func (c *ProjectsLocationsApisArtifactsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
3875 gensupport.SetOptions(c.urlParams_, opts...)
3876 res, err := c.doRequest("json")
3877 if res != nil && res.StatusCode == http.StatusNotModified {
3878 if res.Body != nil {
3879 res.Body.Close()
3880 }
3881 return nil, gensupport.WrapError(&googleapi.Error{
3882 Code: res.StatusCode,
3883 Header: res.Header,
3884 })
3885 }
3886 if err != nil {
3887 return nil, err
3888 }
3889 defer googleapi.CloseBody(res)
3890 if err := googleapi.CheckResponse(res); err != nil {
3891 return nil, gensupport.WrapError(err)
3892 }
3893 ret := &TestIamPermissionsResponse{
3894 ServerResponse: googleapi.ServerResponse{
3895 Header: res.Header,
3896 HTTPStatusCode: res.StatusCode,
3897 },
3898 }
3899 target := &ret
3900 b, err := gensupport.DecodeResponseBytes(target, res)
3901 if err != nil {
3902 return nil, err
3903 }
3904 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.artifacts.testIamPermissions", "response", internallog.HTTPResponse(res, b))
3905 return ret, nil
3906 }
3907
3908 type ProjectsLocationsApisDeploymentsCreateCall struct {
3909 s *Service
3910 parent string
3911 apideployment *ApiDeployment
3912 urlParams_ gensupport.URLParams
3913 ctx_ context.Context
3914 header_ http.Header
3915 }
3916
3917 // Create: Creates a specified deployment.
3918 //
3919 // - parent: The parent, which owns this collection of deployments. Format:
3920 // `projects/*/locations/*/apis/*`.
3921 func (r *ProjectsLocationsApisDeploymentsService) Create(parent string, apideployment *ApiDeployment) *ProjectsLocationsApisDeploymentsCreateCall {
3922 c := &ProjectsLocationsApisDeploymentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3923 c.parent = parent
3924 c.apideployment = apideployment
3925 return c
3926 }
3927
3928 // ApiDeploymentId sets the optional parameter "apiDeploymentId": Required. The
3929 // ID to use for the deployment, which will become the final component of the
3930 // deployment's resource name. This value should be 4-63 characters, and valid
3931 // characters are /a-z-/. Following AIP-162, IDs must not have the form of a
3932 // UUID.
3933 func (c *ProjectsLocationsApisDeploymentsCreateCall) ApiDeploymentId(apiDeploymentId string) *ProjectsLocationsApisDeploymentsCreateCall {
3934 c.urlParams_.Set("apiDeploymentId", apiDeploymentId)
3935 return c
3936 }
3937
3938 // Fields allows partial responses to be retrieved. See
3939 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3940 // details.
3941 func (c *ProjectsLocationsApisDeploymentsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsCreateCall {
3942 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3943 return c
3944 }
3945
3946 // Context sets the context to be used in this call's Do method.
3947 func (c *ProjectsLocationsApisDeploymentsCreateCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsCreateCall {
3948 c.ctx_ = ctx
3949 return c
3950 }
3951
3952 // Header returns a http.Header that can be modified by the caller to add
3953 // headers to the request.
3954 func (c *ProjectsLocationsApisDeploymentsCreateCall) Header() http.Header {
3955 if c.header_ == nil {
3956 c.header_ = make(http.Header)
3957 }
3958 return c.header_
3959 }
3960
3961 func (c *ProjectsLocationsApisDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) {
3962 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3963 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apideployment)
3964 if err != nil {
3965 return nil, err
3966 }
3967 c.urlParams_.Set("alt", alt)
3968 c.urlParams_.Set("prettyPrint", "false")
3969 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deployments")
3970 urls += "?" + c.urlParams_.Encode()
3971 req, err := http.NewRequest("POST", urls, body)
3972 if err != nil {
3973 return nil, err
3974 }
3975 req.Header = reqHeaders
3976 googleapi.Expand(req.URL, map[string]string{
3977 "parent": c.parent,
3978 })
3979 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.create", "request", internallog.HTTPRequest(req, body.Bytes()))
3980 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3981 }
3982
3983 // Do executes the "apigeeregistry.projects.locations.apis.deployments.create" call.
3984 // Any non-2xx status code is an error. Response headers are in either
3985 // *ApiDeployment.ServerResponse.Header or (if a response was returned at all)
3986 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3987 // whether the returned error was because http.StatusNotModified was returned.
3988 func (c *ProjectsLocationsApisDeploymentsCreateCall) Do(opts ...googleapi.CallOption) (*ApiDeployment, error) {
3989 gensupport.SetOptions(c.urlParams_, opts...)
3990 res, err := c.doRequest("json")
3991 if res != nil && res.StatusCode == http.StatusNotModified {
3992 if res.Body != nil {
3993 res.Body.Close()
3994 }
3995 return nil, gensupport.WrapError(&googleapi.Error{
3996 Code: res.StatusCode,
3997 Header: res.Header,
3998 })
3999 }
4000 if err != nil {
4001 return nil, err
4002 }
4003 defer googleapi.CloseBody(res)
4004 if err := googleapi.CheckResponse(res); err != nil {
4005 return nil, gensupport.WrapError(err)
4006 }
4007 ret := &ApiDeployment{
4008 ServerResponse: googleapi.ServerResponse{
4009 Header: res.Header,
4010 HTTPStatusCode: res.StatusCode,
4011 },
4012 }
4013 target := &ret
4014 b, err := gensupport.DecodeResponseBytes(target, res)
4015 if err != nil {
4016 return nil, err
4017 }
4018 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.create", "response", internallog.HTTPResponse(res, b))
4019 return ret, nil
4020 }
4021
4022 type ProjectsLocationsApisDeploymentsDeleteCall struct {
4023 s *Service
4024 name string
4025 urlParams_ gensupport.URLParams
4026 ctx_ context.Context
4027 header_ http.Header
4028 }
4029
4030 // Delete: Removes a specified deployment, all revisions, and all child
4031 // resources (e.g., artifacts).
4032 //
4033 // - name: The name of the deployment to delete. Format:
4034 // `projects/*/locations/*/apis/*/deployments/*`.
4035 func (r *ProjectsLocationsApisDeploymentsService) Delete(name string) *ProjectsLocationsApisDeploymentsDeleteCall {
4036 c := &ProjectsLocationsApisDeploymentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4037 c.name = name
4038 return c
4039 }
4040
4041 // Force sets the optional parameter "force": If set to true, any child
4042 // resources will also be deleted. (Otherwise, the request will only work if
4043 // there are no child resources.)
4044 func (c *ProjectsLocationsApisDeploymentsDeleteCall) Force(force bool) *ProjectsLocationsApisDeploymentsDeleteCall {
4045 c.urlParams_.Set("force", fmt.Sprint(force))
4046 return c
4047 }
4048
4049 // Fields allows partial responses to be retrieved. See
4050 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4051 // details.
4052 func (c *ProjectsLocationsApisDeploymentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsDeleteCall {
4053 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4054 return c
4055 }
4056
4057 // Context sets the context to be used in this call's Do method.
4058 func (c *ProjectsLocationsApisDeploymentsDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsDeleteCall {
4059 c.ctx_ = ctx
4060 return c
4061 }
4062
4063 // Header returns a http.Header that can be modified by the caller to add
4064 // headers to the request.
4065 func (c *ProjectsLocationsApisDeploymentsDeleteCall) Header() http.Header {
4066 if c.header_ == nil {
4067 c.header_ = make(http.Header)
4068 }
4069 return c.header_
4070 }
4071
4072 func (c *ProjectsLocationsApisDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) {
4073 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4074 c.urlParams_.Set("alt", alt)
4075 c.urlParams_.Set("prettyPrint", "false")
4076 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4077 urls += "?" + c.urlParams_.Encode()
4078 req, err := http.NewRequest("DELETE", urls, nil)
4079 if err != nil {
4080 return nil, err
4081 }
4082 req.Header = reqHeaders
4083 googleapi.Expand(req.URL, map[string]string{
4084 "name": c.name,
4085 })
4086 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.delete", "request", internallog.HTTPRequest(req, nil))
4087 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4088 }
4089
4090 // Do executes the "apigeeregistry.projects.locations.apis.deployments.delete" call.
4091 // Any non-2xx status code is an error. Response headers are in either
4092 // *Empty.ServerResponse.Header or (if a response was returned at all) in
4093 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4094 // whether the returned error was because http.StatusNotModified was returned.
4095 func (c *ProjectsLocationsApisDeploymentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4096 gensupport.SetOptions(c.urlParams_, opts...)
4097 res, err := c.doRequest("json")
4098 if res != nil && res.StatusCode == http.StatusNotModified {
4099 if res.Body != nil {
4100 res.Body.Close()
4101 }
4102 return nil, gensupport.WrapError(&googleapi.Error{
4103 Code: res.StatusCode,
4104 Header: res.Header,
4105 })
4106 }
4107 if err != nil {
4108 return nil, err
4109 }
4110 defer googleapi.CloseBody(res)
4111 if err := googleapi.CheckResponse(res); err != nil {
4112 return nil, gensupport.WrapError(err)
4113 }
4114 ret := &Empty{
4115 ServerResponse: googleapi.ServerResponse{
4116 Header: res.Header,
4117 HTTPStatusCode: res.StatusCode,
4118 },
4119 }
4120 target := &ret
4121 b, err := gensupport.DecodeResponseBytes(target, res)
4122 if err != nil {
4123 return nil, err
4124 }
4125 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.delete", "response", internallog.HTTPResponse(res, b))
4126 return ret, nil
4127 }
4128
4129 type ProjectsLocationsApisDeploymentsDeleteRevisionCall struct {
4130 s *Service
4131 name string
4132 urlParams_ gensupport.URLParams
4133 ctx_ context.Context
4134 header_ http.Header
4135 }
4136
4137 // DeleteRevision: Deletes a revision of a deployment.
4138 //
4139 // - name: The name of the deployment revision to be deleted, with a revision
4140 // ID explicitly included. Example:
4141 // `projects/sample/locations/global/apis/petstore/deployments/prod@c7cfa2a8`.
4142 func (r *ProjectsLocationsApisDeploymentsService) DeleteRevision(name string) *ProjectsLocationsApisDeploymentsDeleteRevisionCall {
4143 c := &ProjectsLocationsApisDeploymentsDeleteRevisionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4144 c.name = name
4145 return c
4146 }
4147
4148 // Fields allows partial responses to be retrieved. See
4149 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4150 // details.
4151 func (c *ProjectsLocationsApisDeploymentsDeleteRevisionCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsDeleteRevisionCall {
4152 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4153 return c
4154 }
4155
4156 // Context sets the context to be used in this call's Do method.
4157 func (c *ProjectsLocationsApisDeploymentsDeleteRevisionCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsDeleteRevisionCall {
4158 c.ctx_ = ctx
4159 return c
4160 }
4161
4162 // Header returns a http.Header that can be modified by the caller to add
4163 // headers to the request.
4164 func (c *ProjectsLocationsApisDeploymentsDeleteRevisionCall) Header() http.Header {
4165 if c.header_ == nil {
4166 c.header_ = make(http.Header)
4167 }
4168 return c.header_
4169 }
4170
4171 func (c *ProjectsLocationsApisDeploymentsDeleteRevisionCall) doRequest(alt string) (*http.Response, error) {
4172 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4173 c.urlParams_.Set("alt", alt)
4174 c.urlParams_.Set("prettyPrint", "false")
4175 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:deleteRevision")
4176 urls += "?" + c.urlParams_.Encode()
4177 req, err := http.NewRequest("DELETE", urls, nil)
4178 if err != nil {
4179 return nil, err
4180 }
4181 req.Header = reqHeaders
4182 googleapi.Expand(req.URL, map[string]string{
4183 "name": c.name,
4184 })
4185 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.deleteRevision", "request", internallog.HTTPRequest(req, nil))
4186 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4187 }
4188
4189 // Do executes the "apigeeregistry.projects.locations.apis.deployments.deleteRevision" call.
4190 // Any non-2xx status code is an error. Response headers are in either
4191 // *ApiDeployment.ServerResponse.Header or (if a response was returned at all)
4192 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4193 // whether the returned error was because http.StatusNotModified was returned.
4194 func (c *ProjectsLocationsApisDeploymentsDeleteRevisionCall) Do(opts ...googleapi.CallOption) (*ApiDeployment, error) {
4195 gensupport.SetOptions(c.urlParams_, opts...)
4196 res, err := c.doRequest("json")
4197 if res != nil && res.StatusCode == http.StatusNotModified {
4198 if res.Body != nil {
4199 res.Body.Close()
4200 }
4201 return nil, gensupport.WrapError(&googleapi.Error{
4202 Code: res.StatusCode,
4203 Header: res.Header,
4204 })
4205 }
4206 if err != nil {
4207 return nil, err
4208 }
4209 defer googleapi.CloseBody(res)
4210 if err := googleapi.CheckResponse(res); err != nil {
4211 return nil, gensupport.WrapError(err)
4212 }
4213 ret := &ApiDeployment{
4214 ServerResponse: googleapi.ServerResponse{
4215 Header: res.Header,
4216 HTTPStatusCode: res.StatusCode,
4217 },
4218 }
4219 target := &ret
4220 b, err := gensupport.DecodeResponseBytes(target, res)
4221 if err != nil {
4222 return nil, err
4223 }
4224 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.deleteRevision", "response", internallog.HTTPResponse(res, b))
4225 return ret, nil
4226 }
4227
4228 type ProjectsLocationsApisDeploymentsGetCall struct {
4229 s *Service
4230 name string
4231 urlParams_ gensupport.URLParams
4232 ifNoneMatch_ string
4233 ctx_ context.Context
4234 header_ http.Header
4235 }
4236
4237 // Get: Returns a specified deployment.
4238 //
4239 // - name: The name of the deployment to retrieve. Format:
4240 // `projects/*/locations/*/apis/*/deployments/*`.
4241 func (r *ProjectsLocationsApisDeploymentsService) Get(name string) *ProjectsLocationsApisDeploymentsGetCall {
4242 c := &ProjectsLocationsApisDeploymentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4243 c.name = name
4244 return c
4245 }
4246
4247 // Fields allows partial responses to be retrieved. See
4248 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4249 // details.
4250 func (c *ProjectsLocationsApisDeploymentsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsGetCall {
4251 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4252 return c
4253 }
4254
4255 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4256 // object's ETag matches the given value. This is useful for getting updates
4257 // only after the object has changed since the last request.
4258 func (c *ProjectsLocationsApisDeploymentsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisDeploymentsGetCall {
4259 c.ifNoneMatch_ = entityTag
4260 return c
4261 }
4262
4263 // Context sets the context to be used in this call's Do method.
4264 func (c *ProjectsLocationsApisDeploymentsGetCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsGetCall {
4265 c.ctx_ = ctx
4266 return c
4267 }
4268
4269 // Header returns a http.Header that can be modified by the caller to add
4270 // headers to the request.
4271 func (c *ProjectsLocationsApisDeploymentsGetCall) Header() http.Header {
4272 if c.header_ == nil {
4273 c.header_ = make(http.Header)
4274 }
4275 return c.header_
4276 }
4277
4278 func (c *ProjectsLocationsApisDeploymentsGetCall) doRequest(alt string) (*http.Response, error) {
4279 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4280 if c.ifNoneMatch_ != "" {
4281 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4282 }
4283 c.urlParams_.Set("alt", alt)
4284 c.urlParams_.Set("prettyPrint", "false")
4285 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4286 urls += "?" + c.urlParams_.Encode()
4287 req, err := http.NewRequest("GET", urls, nil)
4288 if err != nil {
4289 return nil, err
4290 }
4291 req.Header = reqHeaders
4292 googleapi.Expand(req.URL, map[string]string{
4293 "name": c.name,
4294 })
4295 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.get", "request", internallog.HTTPRequest(req, nil))
4296 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4297 }
4298
4299 // Do executes the "apigeeregistry.projects.locations.apis.deployments.get" call.
4300 // Any non-2xx status code is an error. Response headers are in either
4301 // *ApiDeployment.ServerResponse.Header or (if a response was returned at all)
4302 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4303 // whether the returned error was because http.StatusNotModified was returned.
4304 func (c *ProjectsLocationsApisDeploymentsGetCall) Do(opts ...googleapi.CallOption) (*ApiDeployment, error) {
4305 gensupport.SetOptions(c.urlParams_, opts...)
4306 res, err := c.doRequest("json")
4307 if res != nil && res.StatusCode == http.StatusNotModified {
4308 if res.Body != nil {
4309 res.Body.Close()
4310 }
4311 return nil, gensupport.WrapError(&googleapi.Error{
4312 Code: res.StatusCode,
4313 Header: res.Header,
4314 })
4315 }
4316 if err != nil {
4317 return nil, err
4318 }
4319 defer googleapi.CloseBody(res)
4320 if err := googleapi.CheckResponse(res); err != nil {
4321 return nil, gensupport.WrapError(err)
4322 }
4323 ret := &ApiDeployment{
4324 ServerResponse: googleapi.ServerResponse{
4325 Header: res.Header,
4326 HTTPStatusCode: res.StatusCode,
4327 },
4328 }
4329 target := &ret
4330 b, err := gensupport.DecodeResponseBytes(target, res)
4331 if err != nil {
4332 return nil, err
4333 }
4334 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.get", "response", internallog.HTTPResponse(res, b))
4335 return ret, nil
4336 }
4337
4338 type ProjectsLocationsApisDeploymentsGetIamPolicyCall struct {
4339 s *Service
4340 resource string
4341 urlParams_ gensupport.URLParams
4342 ifNoneMatch_ string
4343 ctx_ context.Context
4344 header_ http.Header
4345 }
4346
4347 // GetIamPolicy: Gets the access control policy for a resource. Returns an
4348 // empty policy if the resource exists and does not have a policy set.
4349 //
4350 // - resource: REQUIRED: The resource for which the policy is being requested.
4351 // See Resource names (https://cloud.google.com/apis/design/resource_names)
4352 // for the appropriate value for this field.
4353 func (r *ProjectsLocationsApisDeploymentsService) GetIamPolicy(resource string) *ProjectsLocationsApisDeploymentsGetIamPolicyCall {
4354 c := &ProjectsLocationsApisDeploymentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4355 c.resource = resource
4356 return c
4357 }
4358
4359 // OptionsRequestedPolicyVersion sets the optional parameter
4360 // "options.requestedPolicyVersion": The maximum policy version that will be
4361 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
4362 // an invalid value will be rejected. Requests for policies with any
4363 // conditional role bindings must specify version 3. Policies with no
4364 // conditional role bindings may specify any valid value or leave the field
4365 // unset. The policy in the response might use the policy version that you
4366 // specified, or it might use a lower policy version. For example, if you
4367 // specify version 3, but the policy has no conditional role bindings, the
4368 // response uses version 1. To learn which resources support conditions in
4369 // their IAM policies, see the IAM documentation
4370 // (https://cloud.google.com/iam/help/conditions/resource-policies).
4371 func (c *ProjectsLocationsApisDeploymentsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsApisDeploymentsGetIamPolicyCall {
4372 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
4373 return c
4374 }
4375
4376 // Fields allows partial responses to be retrieved. See
4377 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4378 // details.
4379 func (c *ProjectsLocationsApisDeploymentsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsGetIamPolicyCall {
4380 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4381 return c
4382 }
4383
4384 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4385 // object's ETag matches the given value. This is useful for getting updates
4386 // only after the object has changed since the last request.
4387 func (c *ProjectsLocationsApisDeploymentsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisDeploymentsGetIamPolicyCall {
4388 c.ifNoneMatch_ = entityTag
4389 return c
4390 }
4391
4392 // Context sets the context to be used in this call's Do method.
4393 func (c *ProjectsLocationsApisDeploymentsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsGetIamPolicyCall {
4394 c.ctx_ = ctx
4395 return c
4396 }
4397
4398 // Header returns a http.Header that can be modified by the caller to add
4399 // headers to the request.
4400 func (c *ProjectsLocationsApisDeploymentsGetIamPolicyCall) Header() http.Header {
4401 if c.header_ == nil {
4402 c.header_ = make(http.Header)
4403 }
4404 return c.header_
4405 }
4406
4407 func (c *ProjectsLocationsApisDeploymentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
4408 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4409 if c.ifNoneMatch_ != "" {
4410 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4411 }
4412 c.urlParams_.Set("alt", alt)
4413 c.urlParams_.Set("prettyPrint", "false")
4414 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
4415 urls += "?" + c.urlParams_.Encode()
4416 req, err := http.NewRequest("GET", urls, nil)
4417 if err != nil {
4418 return nil, err
4419 }
4420 req.Header = reqHeaders
4421 googleapi.Expand(req.URL, map[string]string{
4422 "resource": c.resource,
4423 })
4424 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
4425 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4426 }
4427
4428 // Do executes the "apigeeregistry.projects.locations.apis.deployments.getIamPolicy" call.
4429 // Any non-2xx status code is an error. Response headers are in either
4430 // *Policy.ServerResponse.Header or (if a response was returned at all) in
4431 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4432 // whether the returned error was because http.StatusNotModified was returned.
4433 func (c *ProjectsLocationsApisDeploymentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
4434 gensupport.SetOptions(c.urlParams_, opts...)
4435 res, err := c.doRequest("json")
4436 if res != nil && res.StatusCode == http.StatusNotModified {
4437 if res.Body != nil {
4438 res.Body.Close()
4439 }
4440 return nil, gensupport.WrapError(&googleapi.Error{
4441 Code: res.StatusCode,
4442 Header: res.Header,
4443 })
4444 }
4445 if err != nil {
4446 return nil, err
4447 }
4448 defer googleapi.CloseBody(res)
4449 if err := googleapi.CheckResponse(res); err != nil {
4450 return nil, gensupport.WrapError(err)
4451 }
4452 ret := &Policy{
4453 ServerResponse: googleapi.ServerResponse{
4454 Header: res.Header,
4455 HTTPStatusCode: res.StatusCode,
4456 },
4457 }
4458 target := &ret
4459 b, err := gensupport.DecodeResponseBytes(target, res)
4460 if err != nil {
4461 return nil, err
4462 }
4463 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.getIamPolicy", "response", internallog.HTTPResponse(res, b))
4464 return ret, nil
4465 }
4466
4467 type ProjectsLocationsApisDeploymentsListCall struct {
4468 s *Service
4469 parent string
4470 urlParams_ gensupport.URLParams
4471 ifNoneMatch_ string
4472 ctx_ context.Context
4473 header_ http.Header
4474 }
4475
4476 // List: Returns matching deployments.
4477 //
4478 // - parent: The parent, which owns this collection of deployments. Format:
4479 // `projects/*/locations/*/apis/*`.
4480 func (r *ProjectsLocationsApisDeploymentsService) List(parent string) *ProjectsLocationsApisDeploymentsListCall {
4481 c := &ProjectsLocationsApisDeploymentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4482 c.parent = parent
4483 return c
4484 }
4485
4486 // Filter sets the optional parameter "filter": An expression that can be used
4487 // to filter the list. Filters use the Common Expression Language and can refer
4488 // to all message fields.
4489 func (c *ProjectsLocationsApisDeploymentsListCall) Filter(filter string) *ProjectsLocationsApisDeploymentsListCall {
4490 c.urlParams_.Set("filter", filter)
4491 return c
4492 }
4493
4494 // OrderBy sets the optional parameter "orderBy": A comma-separated list of
4495 // fields, e.g. "foo,bar" Fields can be sorted in descending order using the
4496 // "desc" identifier, e.g. "foo desc,bar"
4497 func (c *ProjectsLocationsApisDeploymentsListCall) OrderBy(orderBy string) *ProjectsLocationsApisDeploymentsListCall {
4498 c.urlParams_.Set("orderBy", orderBy)
4499 return c
4500 }
4501
4502 // PageSize sets the optional parameter "pageSize": The maximum number of
4503 // deployments to return. The service may return fewer than this value. If
4504 // unspecified, at most 50 values will be returned. The maximum is 1000; values
4505 // above 1000 will be coerced to 1000.
4506 func (c *ProjectsLocationsApisDeploymentsListCall) PageSize(pageSize int64) *ProjectsLocationsApisDeploymentsListCall {
4507 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4508 return c
4509 }
4510
4511 // PageToken sets the optional parameter "pageToken": A page token, received
4512 // from a previous `ListApiDeployments` call. Provide this to retrieve the
4513 // subsequent page. When paginating, all other parameters provided to
4514 // `ListApiDeployments` must match the call that provided the page token.
4515 func (c *ProjectsLocationsApisDeploymentsListCall) PageToken(pageToken string) *ProjectsLocationsApisDeploymentsListCall {
4516 c.urlParams_.Set("pageToken", pageToken)
4517 return c
4518 }
4519
4520 // Fields allows partial responses to be retrieved. See
4521 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4522 // details.
4523 func (c *ProjectsLocationsApisDeploymentsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsListCall {
4524 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4525 return c
4526 }
4527
4528 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4529 // object's ETag matches the given value. This is useful for getting updates
4530 // only after the object has changed since the last request.
4531 func (c *ProjectsLocationsApisDeploymentsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisDeploymentsListCall {
4532 c.ifNoneMatch_ = entityTag
4533 return c
4534 }
4535
4536 // Context sets the context to be used in this call's Do method.
4537 func (c *ProjectsLocationsApisDeploymentsListCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsListCall {
4538 c.ctx_ = ctx
4539 return c
4540 }
4541
4542 // Header returns a http.Header that can be modified by the caller to add
4543 // headers to the request.
4544 func (c *ProjectsLocationsApisDeploymentsListCall) Header() http.Header {
4545 if c.header_ == nil {
4546 c.header_ = make(http.Header)
4547 }
4548 return c.header_
4549 }
4550
4551 func (c *ProjectsLocationsApisDeploymentsListCall) doRequest(alt string) (*http.Response, error) {
4552 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4553 if c.ifNoneMatch_ != "" {
4554 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4555 }
4556 c.urlParams_.Set("alt", alt)
4557 c.urlParams_.Set("prettyPrint", "false")
4558 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/deployments")
4559 urls += "?" + c.urlParams_.Encode()
4560 req, err := http.NewRequest("GET", urls, nil)
4561 if err != nil {
4562 return nil, err
4563 }
4564 req.Header = reqHeaders
4565 googleapi.Expand(req.URL, map[string]string{
4566 "parent": c.parent,
4567 })
4568 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.list", "request", internallog.HTTPRequest(req, nil))
4569 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4570 }
4571
4572 // Do executes the "apigeeregistry.projects.locations.apis.deployments.list" call.
4573 // Any non-2xx status code is an error. Response headers are in either
4574 // *ListApiDeploymentsResponse.ServerResponse.Header or (if a response was
4575 // returned at all) in error.(*googleapi.Error).Header. Use
4576 // googleapi.IsNotModified to check whether the returned error was because
4577 // http.StatusNotModified was returned.
4578 func (c *ProjectsLocationsApisDeploymentsListCall) Do(opts ...googleapi.CallOption) (*ListApiDeploymentsResponse, error) {
4579 gensupport.SetOptions(c.urlParams_, opts...)
4580 res, err := c.doRequest("json")
4581 if res != nil && res.StatusCode == http.StatusNotModified {
4582 if res.Body != nil {
4583 res.Body.Close()
4584 }
4585 return nil, gensupport.WrapError(&googleapi.Error{
4586 Code: res.StatusCode,
4587 Header: res.Header,
4588 })
4589 }
4590 if err != nil {
4591 return nil, err
4592 }
4593 defer googleapi.CloseBody(res)
4594 if err := googleapi.CheckResponse(res); err != nil {
4595 return nil, gensupport.WrapError(err)
4596 }
4597 ret := &ListApiDeploymentsResponse{
4598 ServerResponse: googleapi.ServerResponse{
4599 Header: res.Header,
4600 HTTPStatusCode: res.StatusCode,
4601 },
4602 }
4603 target := &ret
4604 b, err := gensupport.DecodeResponseBytes(target, res)
4605 if err != nil {
4606 return nil, err
4607 }
4608 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.list", "response", internallog.HTTPResponse(res, b))
4609 return ret, nil
4610 }
4611
4612 // Pages invokes f for each page of results.
4613 // A non-nil error returned from f will halt the iteration.
4614 // The provided context supersedes any context provided to the Context method.
4615 func (c *ProjectsLocationsApisDeploymentsListCall) Pages(ctx context.Context, f func(*ListApiDeploymentsResponse) error) error {
4616 c.ctx_ = ctx
4617 defer c.PageToken(c.urlParams_.Get("pageToken"))
4618 for {
4619 x, err := c.Do()
4620 if err != nil {
4621 return err
4622 }
4623 if err := f(x); err != nil {
4624 return err
4625 }
4626 if x.NextPageToken == "" {
4627 return nil
4628 }
4629 c.PageToken(x.NextPageToken)
4630 }
4631 }
4632
4633 type ProjectsLocationsApisDeploymentsListRevisionsCall struct {
4634 s *Service
4635 name string
4636 urlParams_ gensupport.URLParams
4637 ifNoneMatch_ string
4638 ctx_ context.Context
4639 header_ http.Header
4640 }
4641
4642 // ListRevisions: Lists all revisions of a deployment. Revisions are returned
4643 // in descending order of revision creation time.
4644 //
4645 // - name: The name of the deployment to list revisions for.
4646 func (r *ProjectsLocationsApisDeploymentsService) ListRevisions(name string) *ProjectsLocationsApisDeploymentsListRevisionsCall {
4647 c := &ProjectsLocationsApisDeploymentsListRevisionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4648 c.name = name
4649 return c
4650 }
4651
4652 // Filter sets the optional parameter "filter": An expression that can be used
4653 // to filter the list. Filters use the Common Expression Language and can refer
4654 // to all message fields.
4655 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) Filter(filter string) *ProjectsLocationsApisDeploymentsListRevisionsCall {
4656 c.urlParams_.Set("filter", filter)
4657 return c
4658 }
4659
4660 // PageSize sets the optional parameter "pageSize": The maximum number of
4661 // revisions to return per page.
4662 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) PageSize(pageSize int64) *ProjectsLocationsApisDeploymentsListRevisionsCall {
4663 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4664 return c
4665 }
4666
4667 // PageToken sets the optional parameter "pageToken": The page token, received
4668 // from a previous ListApiDeploymentRevisions call. Provide this to retrieve
4669 // the subsequent page.
4670 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) PageToken(pageToken string) *ProjectsLocationsApisDeploymentsListRevisionsCall {
4671 c.urlParams_.Set("pageToken", pageToken)
4672 return c
4673 }
4674
4675 // Fields allows partial responses to be retrieved. See
4676 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4677 // details.
4678 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsListRevisionsCall {
4679 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4680 return c
4681 }
4682
4683 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4684 // object's ETag matches the given value. This is useful for getting updates
4685 // only after the object has changed since the last request.
4686 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisDeploymentsListRevisionsCall {
4687 c.ifNoneMatch_ = entityTag
4688 return c
4689 }
4690
4691 // Context sets the context to be used in this call's Do method.
4692 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsListRevisionsCall {
4693 c.ctx_ = ctx
4694 return c
4695 }
4696
4697 // Header returns a http.Header that can be modified by the caller to add
4698 // headers to the request.
4699 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) Header() http.Header {
4700 if c.header_ == nil {
4701 c.header_ = make(http.Header)
4702 }
4703 return c.header_
4704 }
4705
4706 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) doRequest(alt string) (*http.Response, error) {
4707 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4708 if c.ifNoneMatch_ != "" {
4709 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4710 }
4711 c.urlParams_.Set("alt", alt)
4712 c.urlParams_.Set("prettyPrint", "false")
4713 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listRevisions")
4714 urls += "?" + c.urlParams_.Encode()
4715 req, err := http.NewRequest("GET", urls, nil)
4716 if err != nil {
4717 return nil, err
4718 }
4719 req.Header = reqHeaders
4720 googleapi.Expand(req.URL, map[string]string{
4721 "name": c.name,
4722 })
4723 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.listRevisions", "request", internallog.HTTPRequest(req, nil))
4724 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4725 }
4726
4727 // Do executes the "apigeeregistry.projects.locations.apis.deployments.listRevisions" call.
4728 // Any non-2xx status code is an error. Response headers are in either
4729 // *ListApiDeploymentRevisionsResponse.ServerResponse.Header or (if a response
4730 // was returned at all) in error.(*googleapi.Error).Header. Use
4731 // googleapi.IsNotModified to check whether the returned error was because
4732 // http.StatusNotModified was returned.
4733 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) Do(opts ...googleapi.CallOption) (*ListApiDeploymentRevisionsResponse, error) {
4734 gensupport.SetOptions(c.urlParams_, opts...)
4735 res, err := c.doRequest("json")
4736 if res != nil && res.StatusCode == http.StatusNotModified {
4737 if res.Body != nil {
4738 res.Body.Close()
4739 }
4740 return nil, gensupport.WrapError(&googleapi.Error{
4741 Code: res.StatusCode,
4742 Header: res.Header,
4743 })
4744 }
4745 if err != nil {
4746 return nil, err
4747 }
4748 defer googleapi.CloseBody(res)
4749 if err := googleapi.CheckResponse(res); err != nil {
4750 return nil, gensupport.WrapError(err)
4751 }
4752 ret := &ListApiDeploymentRevisionsResponse{
4753 ServerResponse: googleapi.ServerResponse{
4754 Header: res.Header,
4755 HTTPStatusCode: res.StatusCode,
4756 },
4757 }
4758 target := &ret
4759 b, err := gensupport.DecodeResponseBytes(target, res)
4760 if err != nil {
4761 return nil, err
4762 }
4763 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.listRevisions", "response", internallog.HTTPResponse(res, b))
4764 return ret, nil
4765 }
4766
4767 // Pages invokes f for each page of results.
4768 // A non-nil error returned from f will halt the iteration.
4769 // The provided context supersedes any context provided to the Context method.
4770 func (c *ProjectsLocationsApisDeploymentsListRevisionsCall) Pages(ctx context.Context, f func(*ListApiDeploymentRevisionsResponse) error) error {
4771 c.ctx_ = ctx
4772 defer c.PageToken(c.urlParams_.Get("pageToken"))
4773 for {
4774 x, err := c.Do()
4775 if err != nil {
4776 return err
4777 }
4778 if err := f(x); err != nil {
4779 return err
4780 }
4781 if x.NextPageToken == "" {
4782 return nil
4783 }
4784 c.PageToken(x.NextPageToken)
4785 }
4786 }
4787
4788 type ProjectsLocationsApisDeploymentsPatchCall struct {
4789 s *Service
4790 name string
4791 apideployment *ApiDeployment
4792 urlParams_ gensupport.URLParams
4793 ctx_ context.Context
4794 header_ http.Header
4795 }
4796
4797 // Patch: Used to modify a specified deployment.
4798 //
4799 // - name: Resource name.
4800 func (r *ProjectsLocationsApisDeploymentsService) Patch(name string, apideployment *ApiDeployment) *ProjectsLocationsApisDeploymentsPatchCall {
4801 c := &ProjectsLocationsApisDeploymentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4802 c.name = name
4803 c.apideployment = apideployment
4804 return c
4805 }
4806
4807 // AllowMissing sets the optional parameter "allowMissing": If set to true, and
4808 // the deployment is not found, a new deployment will be created. In this
4809 // situation, `update_mask` is ignored.
4810 func (c *ProjectsLocationsApisDeploymentsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsApisDeploymentsPatchCall {
4811 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing))
4812 return c
4813 }
4814
4815 // UpdateMask sets the optional parameter "updateMask": The list of fields to
4816 // be updated. If omitted, all fields are updated that are set in the request
4817 // message (fields set to default values are ignored). If an asterisk "*" is
4818 // specified, all fields are updated, including fields that are
4819 // unspecified/default in the request.
4820 func (c *ProjectsLocationsApisDeploymentsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsApisDeploymentsPatchCall {
4821 c.urlParams_.Set("updateMask", updateMask)
4822 return c
4823 }
4824
4825 // Fields allows partial responses to be retrieved. See
4826 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4827 // details.
4828 func (c *ProjectsLocationsApisDeploymentsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsPatchCall {
4829 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4830 return c
4831 }
4832
4833 // Context sets the context to be used in this call's Do method.
4834 func (c *ProjectsLocationsApisDeploymentsPatchCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsPatchCall {
4835 c.ctx_ = ctx
4836 return c
4837 }
4838
4839 // Header returns a http.Header that can be modified by the caller to add
4840 // headers to the request.
4841 func (c *ProjectsLocationsApisDeploymentsPatchCall) Header() http.Header {
4842 if c.header_ == nil {
4843 c.header_ = make(http.Header)
4844 }
4845 return c.header_
4846 }
4847
4848 func (c *ProjectsLocationsApisDeploymentsPatchCall) doRequest(alt string) (*http.Response, error) {
4849 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4850 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apideployment)
4851 if err != nil {
4852 return nil, err
4853 }
4854 c.urlParams_.Set("alt", alt)
4855 c.urlParams_.Set("prettyPrint", "false")
4856 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4857 urls += "?" + c.urlParams_.Encode()
4858 req, err := http.NewRequest("PATCH", urls, body)
4859 if err != nil {
4860 return nil, err
4861 }
4862 req.Header = reqHeaders
4863 googleapi.Expand(req.URL, map[string]string{
4864 "name": c.name,
4865 })
4866 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
4867 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4868 }
4869
4870 // Do executes the "apigeeregistry.projects.locations.apis.deployments.patch" call.
4871 // Any non-2xx status code is an error. Response headers are in either
4872 // *ApiDeployment.ServerResponse.Header or (if a response was returned at all)
4873 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4874 // whether the returned error was because http.StatusNotModified was returned.
4875 func (c *ProjectsLocationsApisDeploymentsPatchCall) Do(opts ...googleapi.CallOption) (*ApiDeployment, error) {
4876 gensupport.SetOptions(c.urlParams_, opts...)
4877 res, err := c.doRequest("json")
4878 if res != nil && res.StatusCode == http.StatusNotModified {
4879 if res.Body != nil {
4880 res.Body.Close()
4881 }
4882 return nil, gensupport.WrapError(&googleapi.Error{
4883 Code: res.StatusCode,
4884 Header: res.Header,
4885 })
4886 }
4887 if err != nil {
4888 return nil, err
4889 }
4890 defer googleapi.CloseBody(res)
4891 if err := googleapi.CheckResponse(res); err != nil {
4892 return nil, gensupport.WrapError(err)
4893 }
4894 ret := &ApiDeployment{
4895 ServerResponse: googleapi.ServerResponse{
4896 Header: res.Header,
4897 HTTPStatusCode: res.StatusCode,
4898 },
4899 }
4900 target := &ret
4901 b, err := gensupport.DecodeResponseBytes(target, res)
4902 if err != nil {
4903 return nil, err
4904 }
4905 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.patch", "response", internallog.HTTPResponse(res, b))
4906 return ret, nil
4907 }
4908
4909 type ProjectsLocationsApisDeploymentsRollbackCall struct {
4910 s *Service
4911 name string
4912 rollbackapideploymentrequest *RollbackApiDeploymentRequest
4913 urlParams_ gensupport.URLParams
4914 ctx_ context.Context
4915 header_ http.Header
4916 }
4917
4918 // Rollback: Sets the current revision to a specified prior revision. Note that
4919 // this creates a new revision with a new revision ID.
4920 //
4921 // - name: The deployment being rolled back.
4922 func (r *ProjectsLocationsApisDeploymentsService) Rollback(name string, rollbackapideploymentrequest *RollbackApiDeploymentRequest) *ProjectsLocationsApisDeploymentsRollbackCall {
4923 c := &ProjectsLocationsApisDeploymentsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4924 c.name = name
4925 c.rollbackapideploymentrequest = rollbackapideploymentrequest
4926 return c
4927 }
4928
4929 // Fields allows partial responses to be retrieved. See
4930 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4931 // details.
4932 func (c *ProjectsLocationsApisDeploymentsRollbackCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsRollbackCall {
4933 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4934 return c
4935 }
4936
4937 // Context sets the context to be used in this call's Do method.
4938 func (c *ProjectsLocationsApisDeploymentsRollbackCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsRollbackCall {
4939 c.ctx_ = ctx
4940 return c
4941 }
4942
4943 // Header returns a http.Header that can be modified by the caller to add
4944 // headers to the request.
4945 func (c *ProjectsLocationsApisDeploymentsRollbackCall) Header() http.Header {
4946 if c.header_ == nil {
4947 c.header_ = make(http.Header)
4948 }
4949 return c.header_
4950 }
4951
4952 func (c *ProjectsLocationsApisDeploymentsRollbackCall) doRequest(alt string) (*http.Response, error) {
4953 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4954 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackapideploymentrequest)
4955 if err != nil {
4956 return nil, err
4957 }
4958 c.urlParams_.Set("alt", alt)
4959 c.urlParams_.Set("prettyPrint", "false")
4960 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:rollback")
4961 urls += "?" + c.urlParams_.Encode()
4962 req, err := http.NewRequest("POST", urls, body)
4963 if err != nil {
4964 return nil, err
4965 }
4966 req.Header = reqHeaders
4967 googleapi.Expand(req.URL, map[string]string{
4968 "name": c.name,
4969 })
4970 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.rollback", "request", internallog.HTTPRequest(req, body.Bytes()))
4971 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4972 }
4973
4974 // Do executes the "apigeeregistry.projects.locations.apis.deployments.rollback" call.
4975 // Any non-2xx status code is an error. Response headers are in either
4976 // *ApiDeployment.ServerResponse.Header or (if a response was returned at all)
4977 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4978 // whether the returned error was because http.StatusNotModified was returned.
4979 func (c *ProjectsLocationsApisDeploymentsRollbackCall) Do(opts ...googleapi.CallOption) (*ApiDeployment, 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, gensupport.WrapError(&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, gensupport.WrapError(err)
4997 }
4998 ret := &ApiDeployment{
4999 ServerResponse: googleapi.ServerResponse{
5000 Header: res.Header,
5001 HTTPStatusCode: res.StatusCode,
5002 },
5003 }
5004 target := &ret
5005 b, err := gensupport.DecodeResponseBytes(target, res)
5006 if err != nil {
5007 return nil, err
5008 }
5009 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.rollback", "response", internallog.HTTPResponse(res, b))
5010 return ret, nil
5011 }
5012
5013 type ProjectsLocationsApisDeploymentsSetIamPolicyCall struct {
5014 s *Service
5015 resource string
5016 setiampolicyrequest *SetIamPolicyRequest
5017 urlParams_ gensupport.URLParams
5018 ctx_ context.Context
5019 header_ http.Header
5020 }
5021
5022 // SetIamPolicy: Sets the access control policy on the specified resource.
5023 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
5024 // and `PERMISSION_DENIED` errors.
5025 //
5026 // - resource: REQUIRED: The resource for which the policy is being specified.
5027 // See Resource names (https://cloud.google.com/apis/design/resource_names)
5028 // for the appropriate value for this field.
5029 func (r *ProjectsLocationsApisDeploymentsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsApisDeploymentsSetIamPolicyCall {
5030 c := &ProjectsLocationsApisDeploymentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5031 c.resource = resource
5032 c.setiampolicyrequest = setiampolicyrequest
5033 return c
5034 }
5035
5036 // Fields allows partial responses to be retrieved. See
5037 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5038 // details.
5039 func (c *ProjectsLocationsApisDeploymentsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsSetIamPolicyCall {
5040 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5041 return c
5042 }
5043
5044 // Context sets the context to be used in this call's Do method.
5045 func (c *ProjectsLocationsApisDeploymentsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsSetIamPolicyCall {
5046 c.ctx_ = ctx
5047 return c
5048 }
5049
5050 // Header returns a http.Header that can be modified by the caller to add
5051 // headers to the request.
5052 func (c *ProjectsLocationsApisDeploymentsSetIamPolicyCall) Header() http.Header {
5053 if c.header_ == nil {
5054 c.header_ = make(http.Header)
5055 }
5056 return c.header_
5057 }
5058
5059 func (c *ProjectsLocationsApisDeploymentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
5060 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5061 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
5062 if err != nil {
5063 return nil, err
5064 }
5065 c.urlParams_.Set("alt", alt)
5066 c.urlParams_.Set("prettyPrint", "false")
5067 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
5068 urls += "?" + c.urlParams_.Encode()
5069 req, err := http.NewRequest("POST", urls, body)
5070 if err != nil {
5071 return nil, err
5072 }
5073 req.Header = reqHeaders
5074 googleapi.Expand(req.URL, map[string]string{
5075 "resource": c.resource,
5076 })
5077 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
5078 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5079 }
5080
5081 // Do executes the "apigeeregistry.projects.locations.apis.deployments.setIamPolicy" call.
5082 // Any non-2xx status code is an error. Response headers are in either
5083 // *Policy.ServerResponse.Header or (if a response was returned at all) in
5084 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5085 // whether the returned error was because http.StatusNotModified was returned.
5086 func (c *ProjectsLocationsApisDeploymentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
5087 gensupport.SetOptions(c.urlParams_, opts...)
5088 res, err := c.doRequest("json")
5089 if res != nil && res.StatusCode == http.StatusNotModified {
5090 if res.Body != nil {
5091 res.Body.Close()
5092 }
5093 return nil, gensupport.WrapError(&googleapi.Error{
5094 Code: res.StatusCode,
5095 Header: res.Header,
5096 })
5097 }
5098 if err != nil {
5099 return nil, err
5100 }
5101 defer googleapi.CloseBody(res)
5102 if err := googleapi.CheckResponse(res); err != nil {
5103 return nil, gensupport.WrapError(err)
5104 }
5105 ret := &Policy{
5106 ServerResponse: googleapi.ServerResponse{
5107 Header: res.Header,
5108 HTTPStatusCode: res.StatusCode,
5109 },
5110 }
5111 target := &ret
5112 b, err := gensupport.DecodeResponseBytes(target, res)
5113 if err != nil {
5114 return nil, err
5115 }
5116 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.setIamPolicy", "response", internallog.HTTPResponse(res, b))
5117 return ret, nil
5118 }
5119
5120 type ProjectsLocationsApisDeploymentsTagRevisionCall struct {
5121 s *Service
5122 name string
5123 tagapideploymentrevisionrequest *TagApiDeploymentRevisionRequest
5124 urlParams_ gensupport.URLParams
5125 ctx_ context.Context
5126 header_ http.Header
5127 }
5128
5129 // TagRevision: Adds a tag to a specified revision of a deployment.
5130 //
5131 // - name: The name of the deployment to be tagged, including the revision ID
5132 // is optional. If a revision is not specified, it will tag the latest
5133 // revision.
5134 func (r *ProjectsLocationsApisDeploymentsService) TagRevision(name string, tagapideploymentrevisionrequest *TagApiDeploymentRevisionRequest) *ProjectsLocationsApisDeploymentsTagRevisionCall {
5135 c := &ProjectsLocationsApisDeploymentsTagRevisionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5136 c.name = name
5137 c.tagapideploymentrevisionrequest = tagapideploymentrevisionrequest
5138 return c
5139 }
5140
5141 // Fields allows partial responses to be retrieved. See
5142 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5143 // details.
5144 func (c *ProjectsLocationsApisDeploymentsTagRevisionCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsTagRevisionCall {
5145 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5146 return c
5147 }
5148
5149 // Context sets the context to be used in this call's Do method.
5150 func (c *ProjectsLocationsApisDeploymentsTagRevisionCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsTagRevisionCall {
5151 c.ctx_ = ctx
5152 return c
5153 }
5154
5155 // Header returns a http.Header that can be modified by the caller to add
5156 // headers to the request.
5157 func (c *ProjectsLocationsApisDeploymentsTagRevisionCall) Header() http.Header {
5158 if c.header_ == nil {
5159 c.header_ = make(http.Header)
5160 }
5161 return c.header_
5162 }
5163
5164 func (c *ProjectsLocationsApisDeploymentsTagRevisionCall) doRequest(alt string) (*http.Response, error) {
5165 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5166 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tagapideploymentrevisionrequest)
5167 if err != nil {
5168 return nil, err
5169 }
5170 c.urlParams_.Set("alt", alt)
5171 c.urlParams_.Set("prettyPrint", "false")
5172 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:tagRevision")
5173 urls += "?" + c.urlParams_.Encode()
5174 req, err := http.NewRequest("POST", urls, body)
5175 if err != nil {
5176 return nil, err
5177 }
5178 req.Header = reqHeaders
5179 googleapi.Expand(req.URL, map[string]string{
5180 "name": c.name,
5181 })
5182 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.tagRevision", "request", internallog.HTTPRequest(req, body.Bytes()))
5183 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5184 }
5185
5186 // Do executes the "apigeeregistry.projects.locations.apis.deployments.tagRevision" call.
5187 // Any non-2xx status code is an error. Response headers are in either
5188 // *ApiDeployment.ServerResponse.Header or (if a response was returned at all)
5189 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5190 // whether the returned error was because http.StatusNotModified was returned.
5191 func (c *ProjectsLocationsApisDeploymentsTagRevisionCall) Do(opts ...googleapi.CallOption) (*ApiDeployment, error) {
5192 gensupport.SetOptions(c.urlParams_, opts...)
5193 res, err := c.doRequest("json")
5194 if res != nil && res.StatusCode == http.StatusNotModified {
5195 if res.Body != nil {
5196 res.Body.Close()
5197 }
5198 return nil, gensupport.WrapError(&googleapi.Error{
5199 Code: res.StatusCode,
5200 Header: res.Header,
5201 })
5202 }
5203 if err != nil {
5204 return nil, err
5205 }
5206 defer googleapi.CloseBody(res)
5207 if err := googleapi.CheckResponse(res); err != nil {
5208 return nil, gensupport.WrapError(err)
5209 }
5210 ret := &ApiDeployment{
5211 ServerResponse: googleapi.ServerResponse{
5212 Header: res.Header,
5213 HTTPStatusCode: res.StatusCode,
5214 },
5215 }
5216 target := &ret
5217 b, err := gensupport.DecodeResponseBytes(target, res)
5218 if err != nil {
5219 return nil, err
5220 }
5221 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.tagRevision", "response", internallog.HTTPResponse(res, b))
5222 return ret, nil
5223 }
5224
5225 type ProjectsLocationsApisDeploymentsTestIamPermissionsCall struct {
5226 s *Service
5227 resource string
5228 testiampermissionsrequest *TestIamPermissionsRequest
5229 urlParams_ gensupport.URLParams
5230 ctx_ context.Context
5231 header_ http.Header
5232 }
5233
5234 // TestIamPermissions: Returns permissions that a caller has on the specified
5235 // resource. If the resource does not exist, this will return an empty set of
5236 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
5237 // used for building permission-aware UIs and command-line tools, not for
5238 // authorization checking. This operation may "fail open" without warning.
5239 //
5240 // - resource: REQUIRED: The resource for which the policy detail is being
5241 // requested. See Resource names
5242 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
5243 // value for this field.
5244 func (r *ProjectsLocationsApisDeploymentsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsApisDeploymentsTestIamPermissionsCall {
5245 c := &ProjectsLocationsApisDeploymentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5246 c.resource = resource
5247 c.testiampermissionsrequest = testiampermissionsrequest
5248 return c
5249 }
5250
5251 // Fields allows partial responses to be retrieved. See
5252 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5253 // details.
5254 func (c *ProjectsLocationsApisDeploymentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsTestIamPermissionsCall {
5255 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5256 return c
5257 }
5258
5259 // Context sets the context to be used in this call's Do method.
5260 func (c *ProjectsLocationsApisDeploymentsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsTestIamPermissionsCall {
5261 c.ctx_ = ctx
5262 return c
5263 }
5264
5265 // Header returns a http.Header that can be modified by the caller to add
5266 // headers to the request.
5267 func (c *ProjectsLocationsApisDeploymentsTestIamPermissionsCall) Header() http.Header {
5268 if c.header_ == nil {
5269 c.header_ = make(http.Header)
5270 }
5271 return c.header_
5272 }
5273
5274 func (c *ProjectsLocationsApisDeploymentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
5275 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5276 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
5277 if err != nil {
5278 return nil, err
5279 }
5280 c.urlParams_.Set("alt", alt)
5281 c.urlParams_.Set("prettyPrint", "false")
5282 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
5283 urls += "?" + c.urlParams_.Encode()
5284 req, err := http.NewRequest("POST", urls, body)
5285 if err != nil {
5286 return nil, err
5287 }
5288 req.Header = reqHeaders
5289 googleapi.Expand(req.URL, map[string]string{
5290 "resource": c.resource,
5291 })
5292 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
5293 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5294 }
5295
5296 // Do executes the "apigeeregistry.projects.locations.apis.deployments.testIamPermissions" call.
5297 // Any non-2xx status code is an error. Response headers are in either
5298 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
5299 // returned at all) in error.(*googleapi.Error).Header. Use
5300 // googleapi.IsNotModified to check whether the returned error was because
5301 // http.StatusNotModified was returned.
5302 func (c *ProjectsLocationsApisDeploymentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
5303 gensupport.SetOptions(c.urlParams_, opts...)
5304 res, err := c.doRequest("json")
5305 if res != nil && res.StatusCode == http.StatusNotModified {
5306 if res.Body != nil {
5307 res.Body.Close()
5308 }
5309 return nil, gensupport.WrapError(&googleapi.Error{
5310 Code: res.StatusCode,
5311 Header: res.Header,
5312 })
5313 }
5314 if err != nil {
5315 return nil, err
5316 }
5317 defer googleapi.CloseBody(res)
5318 if err := googleapi.CheckResponse(res); err != nil {
5319 return nil, gensupport.WrapError(err)
5320 }
5321 ret := &TestIamPermissionsResponse{
5322 ServerResponse: googleapi.ServerResponse{
5323 Header: res.Header,
5324 HTTPStatusCode: res.StatusCode,
5325 },
5326 }
5327 target := &ret
5328 b, err := gensupport.DecodeResponseBytes(target, res)
5329 if err != nil {
5330 return nil, err
5331 }
5332 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.testIamPermissions", "response", internallog.HTTPResponse(res, b))
5333 return ret, nil
5334 }
5335
5336 type ProjectsLocationsApisDeploymentsArtifactsCreateCall struct {
5337 s *Service
5338 parent string
5339 artifact *Artifact
5340 urlParams_ gensupport.URLParams
5341 ctx_ context.Context
5342 header_ http.Header
5343 }
5344
5345 // Create: Creates a specified artifact.
5346 //
5347 // - parent: The parent, which owns this collection of artifacts. Format:
5348 // `{parent}`.
5349 func (r *ProjectsLocationsApisDeploymentsArtifactsService) Create(parent string, artifact *Artifact) *ProjectsLocationsApisDeploymentsArtifactsCreateCall {
5350 c := &ProjectsLocationsApisDeploymentsArtifactsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5351 c.parent = parent
5352 c.artifact = artifact
5353 return c
5354 }
5355
5356 // ArtifactId sets the optional parameter "artifactId": Required. The ID to use
5357 // for the artifact, which will become the final component of the artifact's
5358 // resource name. This value should be 4-63 characters, and valid characters
5359 // are /a-z-/. Following AIP-162, IDs must not have the form of a UUID.
5360 func (c *ProjectsLocationsApisDeploymentsArtifactsCreateCall) ArtifactId(artifactId string) *ProjectsLocationsApisDeploymentsArtifactsCreateCall {
5361 c.urlParams_.Set("artifactId", artifactId)
5362 return c
5363 }
5364
5365 // Fields allows partial responses to be retrieved. See
5366 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5367 // details.
5368 func (c *ProjectsLocationsApisDeploymentsArtifactsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsArtifactsCreateCall {
5369 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5370 return c
5371 }
5372
5373 // Context sets the context to be used in this call's Do method.
5374 func (c *ProjectsLocationsApisDeploymentsArtifactsCreateCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsArtifactsCreateCall {
5375 c.ctx_ = ctx
5376 return c
5377 }
5378
5379 // Header returns a http.Header that can be modified by the caller to add
5380 // headers to the request.
5381 func (c *ProjectsLocationsApisDeploymentsArtifactsCreateCall) Header() http.Header {
5382 if c.header_ == nil {
5383 c.header_ = make(http.Header)
5384 }
5385 return c.header_
5386 }
5387
5388 func (c *ProjectsLocationsApisDeploymentsArtifactsCreateCall) doRequest(alt string) (*http.Response, error) {
5389 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5390 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact)
5391 if err != nil {
5392 return nil, err
5393 }
5394 c.urlParams_.Set("alt", alt)
5395 c.urlParams_.Set("prettyPrint", "false")
5396 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
5397 urls += "?" + c.urlParams_.Encode()
5398 req, err := http.NewRequest("POST", urls, body)
5399 if err != nil {
5400 return nil, err
5401 }
5402 req.Header = reqHeaders
5403 googleapi.Expand(req.URL, map[string]string{
5404 "parent": c.parent,
5405 })
5406 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.artifacts.create", "request", internallog.HTTPRequest(req, body.Bytes()))
5407 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5408 }
5409
5410 // Do executes the "apigeeregistry.projects.locations.apis.deployments.artifacts.create" call.
5411 // Any non-2xx status code is an error. Response headers are in either
5412 // *Artifact.ServerResponse.Header or (if a response was returned at all) in
5413 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5414 // whether the returned error was because http.StatusNotModified was returned.
5415 func (c *ProjectsLocationsApisDeploymentsArtifactsCreateCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
5416 gensupport.SetOptions(c.urlParams_, opts...)
5417 res, err := c.doRequest("json")
5418 if res != nil && res.StatusCode == http.StatusNotModified {
5419 if res.Body != nil {
5420 res.Body.Close()
5421 }
5422 return nil, gensupport.WrapError(&googleapi.Error{
5423 Code: res.StatusCode,
5424 Header: res.Header,
5425 })
5426 }
5427 if err != nil {
5428 return nil, err
5429 }
5430 defer googleapi.CloseBody(res)
5431 if err := googleapi.CheckResponse(res); err != nil {
5432 return nil, gensupport.WrapError(err)
5433 }
5434 ret := &Artifact{
5435 ServerResponse: googleapi.ServerResponse{
5436 Header: res.Header,
5437 HTTPStatusCode: res.StatusCode,
5438 },
5439 }
5440 target := &ret
5441 b, err := gensupport.DecodeResponseBytes(target, res)
5442 if err != nil {
5443 return nil, err
5444 }
5445 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.artifacts.create", "response", internallog.HTTPResponse(res, b))
5446 return ret, nil
5447 }
5448
5449 type ProjectsLocationsApisDeploymentsArtifactsDeleteCall struct {
5450 s *Service
5451 name string
5452 urlParams_ gensupport.URLParams
5453 ctx_ context.Context
5454 header_ http.Header
5455 }
5456
5457 // Delete: Removes a specified artifact.
5458 //
5459 // - name: The name of the artifact to delete. Format: `{parent}/artifacts/*`.
5460 func (r *ProjectsLocationsApisDeploymentsArtifactsService) Delete(name string) *ProjectsLocationsApisDeploymentsArtifactsDeleteCall {
5461 c := &ProjectsLocationsApisDeploymentsArtifactsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5462 c.name = name
5463 return c
5464 }
5465
5466 // Fields allows partial responses to be retrieved. See
5467 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5468 // details.
5469 func (c *ProjectsLocationsApisDeploymentsArtifactsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsArtifactsDeleteCall {
5470 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5471 return c
5472 }
5473
5474 // Context sets the context to be used in this call's Do method.
5475 func (c *ProjectsLocationsApisDeploymentsArtifactsDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsArtifactsDeleteCall {
5476 c.ctx_ = ctx
5477 return c
5478 }
5479
5480 // Header returns a http.Header that can be modified by the caller to add
5481 // headers to the request.
5482 func (c *ProjectsLocationsApisDeploymentsArtifactsDeleteCall) Header() http.Header {
5483 if c.header_ == nil {
5484 c.header_ = make(http.Header)
5485 }
5486 return c.header_
5487 }
5488
5489 func (c *ProjectsLocationsApisDeploymentsArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) {
5490 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5491 c.urlParams_.Set("alt", alt)
5492 c.urlParams_.Set("prettyPrint", "false")
5493 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5494 urls += "?" + c.urlParams_.Encode()
5495 req, err := http.NewRequest("DELETE", urls, nil)
5496 if err != nil {
5497 return nil, err
5498 }
5499 req.Header = reqHeaders
5500 googleapi.Expand(req.URL, map[string]string{
5501 "name": c.name,
5502 })
5503 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.artifacts.delete", "request", internallog.HTTPRequest(req, nil))
5504 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5505 }
5506
5507 // Do executes the "apigeeregistry.projects.locations.apis.deployments.artifacts.delete" call.
5508 // Any non-2xx status code is an error. Response headers are in either
5509 // *Empty.ServerResponse.Header or (if a response was returned at all) in
5510 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5511 // whether the returned error was because http.StatusNotModified was returned.
5512 func (c *ProjectsLocationsApisDeploymentsArtifactsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5513 gensupport.SetOptions(c.urlParams_, opts...)
5514 res, err := c.doRequest("json")
5515 if res != nil && res.StatusCode == http.StatusNotModified {
5516 if res.Body != nil {
5517 res.Body.Close()
5518 }
5519 return nil, gensupport.WrapError(&googleapi.Error{
5520 Code: res.StatusCode,
5521 Header: res.Header,
5522 })
5523 }
5524 if err != nil {
5525 return nil, err
5526 }
5527 defer googleapi.CloseBody(res)
5528 if err := googleapi.CheckResponse(res); err != nil {
5529 return nil, gensupport.WrapError(err)
5530 }
5531 ret := &Empty{
5532 ServerResponse: googleapi.ServerResponse{
5533 Header: res.Header,
5534 HTTPStatusCode: res.StatusCode,
5535 },
5536 }
5537 target := &ret
5538 b, err := gensupport.DecodeResponseBytes(target, res)
5539 if err != nil {
5540 return nil, err
5541 }
5542 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.artifacts.delete", "response", internallog.HTTPResponse(res, b))
5543 return ret, nil
5544 }
5545
5546 type ProjectsLocationsApisDeploymentsArtifactsGetCall struct {
5547 s *Service
5548 name string
5549 urlParams_ gensupport.URLParams
5550 ifNoneMatch_ string
5551 ctx_ context.Context
5552 header_ http.Header
5553 }
5554
5555 // Get: Returns a specified artifact.
5556 //
5557 // - name: The name of the artifact to retrieve. Format: `{parent}/artifacts/*`.
5558 func (r *ProjectsLocationsApisDeploymentsArtifactsService) Get(name string) *ProjectsLocationsApisDeploymentsArtifactsGetCall {
5559 c := &ProjectsLocationsApisDeploymentsArtifactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5560 c.name = name
5561 return c
5562 }
5563
5564 // Fields allows partial responses to be retrieved. See
5565 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5566 // details.
5567 func (c *ProjectsLocationsApisDeploymentsArtifactsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsArtifactsGetCall {
5568 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5569 return c
5570 }
5571
5572 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5573 // object's ETag matches the given value. This is useful for getting updates
5574 // only after the object has changed since the last request.
5575 func (c *ProjectsLocationsApisDeploymentsArtifactsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisDeploymentsArtifactsGetCall {
5576 c.ifNoneMatch_ = entityTag
5577 return c
5578 }
5579
5580 // Context sets the context to be used in this call's Do method.
5581 func (c *ProjectsLocationsApisDeploymentsArtifactsGetCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsArtifactsGetCall {
5582 c.ctx_ = ctx
5583 return c
5584 }
5585
5586 // Header returns a http.Header that can be modified by the caller to add
5587 // headers to the request.
5588 func (c *ProjectsLocationsApisDeploymentsArtifactsGetCall) Header() http.Header {
5589 if c.header_ == nil {
5590 c.header_ = make(http.Header)
5591 }
5592 return c.header_
5593 }
5594
5595 func (c *ProjectsLocationsApisDeploymentsArtifactsGetCall) doRequest(alt string) (*http.Response, error) {
5596 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5597 if c.ifNoneMatch_ != "" {
5598 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5599 }
5600 c.urlParams_.Set("alt", alt)
5601 c.urlParams_.Set("prettyPrint", "false")
5602 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5603 urls += "?" + c.urlParams_.Encode()
5604 req, err := http.NewRequest("GET", urls, nil)
5605 if err != nil {
5606 return nil, err
5607 }
5608 req.Header = reqHeaders
5609 googleapi.Expand(req.URL, map[string]string{
5610 "name": c.name,
5611 })
5612 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.artifacts.get", "request", internallog.HTTPRequest(req, nil))
5613 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5614 }
5615
5616 // Do executes the "apigeeregistry.projects.locations.apis.deployments.artifacts.get" call.
5617 // Any non-2xx status code is an error. Response headers are in either
5618 // *Artifact.ServerResponse.Header or (if a response was returned at all) in
5619 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5620 // whether the returned error was because http.StatusNotModified was returned.
5621 func (c *ProjectsLocationsApisDeploymentsArtifactsGetCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
5622 gensupport.SetOptions(c.urlParams_, opts...)
5623 res, err := c.doRequest("json")
5624 if res != nil && res.StatusCode == http.StatusNotModified {
5625 if res.Body != nil {
5626 res.Body.Close()
5627 }
5628 return nil, gensupport.WrapError(&googleapi.Error{
5629 Code: res.StatusCode,
5630 Header: res.Header,
5631 })
5632 }
5633 if err != nil {
5634 return nil, err
5635 }
5636 defer googleapi.CloseBody(res)
5637 if err := googleapi.CheckResponse(res); err != nil {
5638 return nil, gensupport.WrapError(err)
5639 }
5640 ret := &Artifact{
5641 ServerResponse: googleapi.ServerResponse{
5642 Header: res.Header,
5643 HTTPStatusCode: res.StatusCode,
5644 },
5645 }
5646 target := &ret
5647 b, err := gensupport.DecodeResponseBytes(target, res)
5648 if err != nil {
5649 return nil, err
5650 }
5651 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.artifacts.get", "response", internallog.HTTPResponse(res, b))
5652 return ret, nil
5653 }
5654
5655 type ProjectsLocationsApisDeploymentsArtifactsGetContentsCall struct {
5656 s *Service
5657 name string
5658 urlParams_ gensupport.URLParams
5659 ifNoneMatch_ string
5660 ctx_ context.Context
5661 header_ http.Header
5662 }
5663
5664 // GetContents: Returns the contents of a specified artifact. If artifacts are
5665 // stored with GZip compression, the default behavior is to return the artifact
5666 // uncompressed (the mime_type response field indicates the exact format
5667 // returned).
5668 //
5669 // - name: The name of the artifact whose contents should be retrieved. Format:
5670 // `{parent}/artifacts/*`.
5671 func (r *ProjectsLocationsApisDeploymentsArtifactsService) GetContents(name string) *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall {
5672 c := &ProjectsLocationsApisDeploymentsArtifactsGetContentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5673 c.name = name
5674 return c
5675 }
5676
5677 // Fields allows partial responses to be retrieved. See
5678 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5679 // details.
5680 func (c *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall {
5681 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5682 return c
5683 }
5684
5685 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5686 // object's ETag matches the given value. This is useful for getting updates
5687 // only after the object has changed since the last request.
5688 func (c *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall {
5689 c.ifNoneMatch_ = entityTag
5690 return c
5691 }
5692
5693 // Context sets the context to be used in this call's Do method.
5694 func (c *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall {
5695 c.ctx_ = ctx
5696 return c
5697 }
5698
5699 // Header returns a http.Header that can be modified by the caller to add
5700 // headers to the request.
5701 func (c *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall) Header() http.Header {
5702 if c.header_ == nil {
5703 c.header_ = make(http.Header)
5704 }
5705 return c.header_
5706 }
5707
5708 func (c *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall) doRequest(alt string) (*http.Response, error) {
5709 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5710 if c.ifNoneMatch_ != "" {
5711 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5712 }
5713 c.urlParams_.Set("alt", alt)
5714 c.urlParams_.Set("prettyPrint", "false")
5715 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents")
5716 urls += "?" + c.urlParams_.Encode()
5717 req, err := http.NewRequest("GET", urls, nil)
5718 if err != nil {
5719 return nil, err
5720 }
5721 req.Header = reqHeaders
5722 googleapi.Expand(req.URL, map[string]string{
5723 "name": c.name,
5724 })
5725 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.artifacts.getContents", "request", internallog.HTTPRequest(req, nil))
5726 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5727 }
5728
5729 // Do executes the "apigeeregistry.projects.locations.apis.deployments.artifacts.getContents" call.
5730 // Any non-2xx status code is an error. Response headers are in either
5731 // *HttpBody.ServerResponse.Header or (if a response was returned at all) in
5732 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5733 // whether the returned error was because http.StatusNotModified was returned.
5734 func (c *ProjectsLocationsApisDeploymentsArtifactsGetContentsCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
5735 gensupport.SetOptions(c.urlParams_, opts...)
5736 res, err := c.doRequest("json")
5737 if res != nil && res.StatusCode == http.StatusNotModified {
5738 if res.Body != nil {
5739 res.Body.Close()
5740 }
5741 return nil, gensupport.WrapError(&googleapi.Error{
5742 Code: res.StatusCode,
5743 Header: res.Header,
5744 })
5745 }
5746 if err != nil {
5747 return nil, err
5748 }
5749 defer googleapi.CloseBody(res)
5750 if err := googleapi.CheckResponse(res); err != nil {
5751 return nil, gensupport.WrapError(err)
5752 }
5753 ret := &HttpBody{
5754 ServerResponse: googleapi.ServerResponse{
5755 Header: res.Header,
5756 HTTPStatusCode: res.StatusCode,
5757 },
5758 }
5759 target := &ret
5760 b, err := gensupport.DecodeResponseBytes(target, res)
5761 if err != nil {
5762 return nil, err
5763 }
5764 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.artifacts.getContents", "response", internallog.HTTPResponse(res, b))
5765 return ret, nil
5766 }
5767
5768 type ProjectsLocationsApisDeploymentsArtifactsListCall struct {
5769 s *Service
5770 parent string
5771 urlParams_ gensupport.URLParams
5772 ifNoneMatch_ string
5773 ctx_ context.Context
5774 header_ http.Header
5775 }
5776
5777 // List: Returns matching artifacts.
5778 //
5779 // - parent: The parent, which owns this collection of artifacts. Format:
5780 // `{parent}`.
5781 func (r *ProjectsLocationsApisDeploymentsArtifactsService) List(parent string) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5782 c := &ProjectsLocationsApisDeploymentsArtifactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5783 c.parent = parent
5784 return c
5785 }
5786
5787 // Filter sets the optional parameter "filter": An expression that can be used
5788 // to filter the list. Filters use the Common Expression Language and can refer
5789 // to all message fields except contents.
5790 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) Filter(filter string) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5791 c.urlParams_.Set("filter", filter)
5792 return c
5793 }
5794
5795 // OrderBy sets the optional parameter "orderBy": A comma-separated list of
5796 // fields, e.g. "foo,bar" Fields can be sorted in descending order using the
5797 // "desc" identifier, e.g. "foo desc,bar"
5798 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) OrderBy(orderBy string) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5799 c.urlParams_.Set("orderBy", orderBy)
5800 return c
5801 }
5802
5803 // PageSize sets the optional parameter "pageSize": The maximum number of
5804 // artifacts to return. The service may return fewer than this value. If
5805 // unspecified, at most 50 values will be returned. The maximum is 1000; values
5806 // above 1000 will be coerced to 1000.
5807 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) PageSize(pageSize int64) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5808 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5809 return c
5810 }
5811
5812 // PageToken sets the optional parameter "pageToken": A page token, received
5813 // from a previous `ListArtifacts` call. Provide this to retrieve the
5814 // subsequent page. When paginating, all other parameters provided to
5815 // `ListArtifacts` must match the call that provided the page token.
5816 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) PageToken(pageToken string) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5817 c.urlParams_.Set("pageToken", pageToken)
5818 return c
5819 }
5820
5821 // Fields allows partial responses to be retrieved. See
5822 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5823 // details.
5824 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5825 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5826 return c
5827 }
5828
5829 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5830 // object's ETag matches the given value. This is useful for getting updates
5831 // only after the object has changed since the last request.
5832 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5833 c.ifNoneMatch_ = entityTag
5834 return c
5835 }
5836
5837 // Context sets the context to be used in this call's Do method.
5838 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsArtifactsListCall {
5839 c.ctx_ = ctx
5840 return c
5841 }
5842
5843 // Header returns a http.Header that can be modified by the caller to add
5844 // headers to the request.
5845 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) Header() http.Header {
5846 if c.header_ == nil {
5847 c.header_ = make(http.Header)
5848 }
5849 return c.header_
5850 }
5851
5852 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) doRequest(alt string) (*http.Response, error) {
5853 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5854 if c.ifNoneMatch_ != "" {
5855 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5856 }
5857 c.urlParams_.Set("alt", alt)
5858 c.urlParams_.Set("prettyPrint", "false")
5859 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
5860 urls += "?" + c.urlParams_.Encode()
5861 req, err := http.NewRequest("GET", urls, nil)
5862 if err != nil {
5863 return nil, err
5864 }
5865 req.Header = reqHeaders
5866 googleapi.Expand(req.URL, map[string]string{
5867 "parent": c.parent,
5868 })
5869 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.artifacts.list", "request", internallog.HTTPRequest(req, nil))
5870 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5871 }
5872
5873 // Do executes the "apigeeregistry.projects.locations.apis.deployments.artifacts.list" call.
5874 // Any non-2xx status code is an error. Response headers are in either
5875 // *ListArtifactsResponse.ServerResponse.Header or (if a response was returned
5876 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5877 // check whether the returned error was because http.StatusNotModified was
5878 // returned.
5879 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) Do(opts ...googleapi.CallOption) (*ListArtifactsResponse, error) {
5880 gensupport.SetOptions(c.urlParams_, opts...)
5881 res, err := c.doRequest("json")
5882 if res != nil && res.StatusCode == http.StatusNotModified {
5883 if res.Body != nil {
5884 res.Body.Close()
5885 }
5886 return nil, gensupport.WrapError(&googleapi.Error{
5887 Code: res.StatusCode,
5888 Header: res.Header,
5889 })
5890 }
5891 if err != nil {
5892 return nil, err
5893 }
5894 defer googleapi.CloseBody(res)
5895 if err := googleapi.CheckResponse(res); err != nil {
5896 return nil, gensupport.WrapError(err)
5897 }
5898 ret := &ListArtifactsResponse{
5899 ServerResponse: googleapi.ServerResponse{
5900 Header: res.Header,
5901 HTTPStatusCode: res.StatusCode,
5902 },
5903 }
5904 target := &ret
5905 b, err := gensupport.DecodeResponseBytes(target, res)
5906 if err != nil {
5907 return nil, err
5908 }
5909 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.artifacts.list", "response", internallog.HTTPResponse(res, b))
5910 return ret, nil
5911 }
5912
5913 // Pages invokes f for each page of results.
5914 // A non-nil error returned from f will halt the iteration.
5915 // The provided context supersedes any context provided to the Context method.
5916 func (c *ProjectsLocationsApisDeploymentsArtifactsListCall) Pages(ctx context.Context, f func(*ListArtifactsResponse) error) error {
5917 c.ctx_ = ctx
5918 defer c.PageToken(c.urlParams_.Get("pageToken"))
5919 for {
5920 x, err := c.Do()
5921 if err != nil {
5922 return err
5923 }
5924 if err := f(x); err != nil {
5925 return err
5926 }
5927 if x.NextPageToken == "" {
5928 return nil
5929 }
5930 c.PageToken(x.NextPageToken)
5931 }
5932 }
5933
5934 type ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall struct {
5935 s *Service
5936 name string
5937 artifact *Artifact
5938 urlParams_ gensupport.URLParams
5939 ctx_ context.Context
5940 header_ http.Header
5941 }
5942
5943 // ReplaceArtifact: Used to replace a specified artifact.
5944 //
5945 // - name: Resource name.
5946 func (r *ProjectsLocationsApisDeploymentsArtifactsService) ReplaceArtifact(name string, artifact *Artifact) *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall {
5947 c := &ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5948 c.name = name
5949 c.artifact = artifact
5950 return c
5951 }
5952
5953 // Fields allows partial responses to be retrieved. See
5954 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5955 // details.
5956 func (c *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall {
5957 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5958 return c
5959 }
5960
5961 // Context sets the context to be used in this call's Do method.
5962 func (c *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall) Context(ctx context.Context) *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall {
5963 c.ctx_ = ctx
5964 return c
5965 }
5966
5967 // Header returns a http.Header that can be modified by the caller to add
5968 // headers to the request.
5969 func (c *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall) Header() http.Header {
5970 if c.header_ == nil {
5971 c.header_ = make(http.Header)
5972 }
5973 return c.header_
5974 }
5975
5976 func (c *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall) doRequest(alt string) (*http.Response, error) {
5977 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5978 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact)
5979 if err != nil {
5980 return nil, err
5981 }
5982 c.urlParams_.Set("alt", alt)
5983 c.urlParams_.Set("prettyPrint", "false")
5984 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5985 urls += "?" + c.urlParams_.Encode()
5986 req, err := http.NewRequest("PUT", urls, body)
5987 if err != nil {
5988 return nil, err
5989 }
5990 req.Header = reqHeaders
5991 googleapi.Expand(req.URL, map[string]string{
5992 "name": c.name,
5993 })
5994 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.artifacts.replaceArtifact", "request", internallog.HTTPRequest(req, body.Bytes()))
5995 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5996 }
5997
5998 // Do executes the "apigeeregistry.projects.locations.apis.deployments.artifacts.replaceArtifact" call.
5999 // Any non-2xx status code is an error. Response headers are in either
6000 // *Artifact.ServerResponse.Header or (if a response was returned at all) in
6001 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6002 // whether the returned error was because http.StatusNotModified was returned.
6003 func (c *ProjectsLocationsApisDeploymentsArtifactsReplaceArtifactCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
6004 gensupport.SetOptions(c.urlParams_, opts...)
6005 res, err := c.doRequest("json")
6006 if res != nil && res.StatusCode == http.StatusNotModified {
6007 if res.Body != nil {
6008 res.Body.Close()
6009 }
6010 return nil, gensupport.WrapError(&googleapi.Error{
6011 Code: res.StatusCode,
6012 Header: res.Header,
6013 })
6014 }
6015 if err != nil {
6016 return nil, err
6017 }
6018 defer googleapi.CloseBody(res)
6019 if err := googleapi.CheckResponse(res); err != nil {
6020 return nil, gensupport.WrapError(err)
6021 }
6022 ret := &Artifact{
6023 ServerResponse: googleapi.ServerResponse{
6024 Header: res.Header,
6025 HTTPStatusCode: res.StatusCode,
6026 },
6027 }
6028 target := &ret
6029 b, err := gensupport.DecodeResponseBytes(target, res)
6030 if err != nil {
6031 return nil, err
6032 }
6033 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.deployments.artifacts.replaceArtifact", "response", internallog.HTTPResponse(res, b))
6034 return ret, nil
6035 }
6036
6037 type ProjectsLocationsApisVersionsCreateCall struct {
6038 s *Service
6039 parent string
6040 apiversion *ApiVersion
6041 urlParams_ gensupport.URLParams
6042 ctx_ context.Context
6043 header_ http.Header
6044 }
6045
6046 // Create: Creates a specified version.
6047 //
6048 // - parent: The parent, which owns this collection of versions. Format:
6049 // `projects/*/locations/*/apis/*`.
6050 func (r *ProjectsLocationsApisVersionsService) Create(parent string, apiversion *ApiVersion) *ProjectsLocationsApisVersionsCreateCall {
6051 c := &ProjectsLocationsApisVersionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6052 c.parent = parent
6053 c.apiversion = apiversion
6054 return c
6055 }
6056
6057 // ApiVersionId sets the optional parameter "apiVersionId": Required. The ID to
6058 // use for the version, which will become the final component of the version's
6059 // resource name. This value should be 1-63 characters, and valid characters
6060 // are /a-z-/. Following AIP-162, IDs must not have the form of a UUID.
6061 func (c *ProjectsLocationsApisVersionsCreateCall) ApiVersionId(apiVersionId string) *ProjectsLocationsApisVersionsCreateCall {
6062 c.urlParams_.Set("apiVersionId", apiVersionId)
6063 return c
6064 }
6065
6066 // Fields allows partial responses to be retrieved. See
6067 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6068 // details.
6069 func (c *ProjectsLocationsApisVersionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsCreateCall {
6070 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6071 return c
6072 }
6073
6074 // Context sets the context to be used in this call's Do method.
6075 func (c *ProjectsLocationsApisVersionsCreateCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsCreateCall {
6076 c.ctx_ = ctx
6077 return c
6078 }
6079
6080 // Header returns a http.Header that can be modified by the caller to add
6081 // headers to the request.
6082 func (c *ProjectsLocationsApisVersionsCreateCall) Header() http.Header {
6083 if c.header_ == nil {
6084 c.header_ = make(http.Header)
6085 }
6086 return c.header_
6087 }
6088
6089 func (c *ProjectsLocationsApisVersionsCreateCall) doRequest(alt string) (*http.Response, error) {
6090 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6091 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apiversion)
6092 if err != nil {
6093 return nil, err
6094 }
6095 c.urlParams_.Set("alt", alt)
6096 c.urlParams_.Set("prettyPrint", "false")
6097 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions")
6098 urls += "?" + c.urlParams_.Encode()
6099 req, err := http.NewRequest("POST", urls, body)
6100 if err != nil {
6101 return nil, err
6102 }
6103 req.Header = reqHeaders
6104 googleapi.Expand(req.URL, map[string]string{
6105 "parent": c.parent,
6106 })
6107 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.create", "request", internallog.HTTPRequest(req, body.Bytes()))
6108 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6109 }
6110
6111 // Do executes the "apigeeregistry.projects.locations.apis.versions.create" call.
6112 // Any non-2xx status code is an error. Response headers are in either
6113 // *ApiVersion.ServerResponse.Header or (if a response was returned at all) in
6114 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6115 // whether the returned error was because http.StatusNotModified was returned.
6116 func (c *ProjectsLocationsApisVersionsCreateCall) Do(opts ...googleapi.CallOption) (*ApiVersion, error) {
6117 gensupport.SetOptions(c.urlParams_, opts...)
6118 res, err := c.doRequest("json")
6119 if res != nil && res.StatusCode == http.StatusNotModified {
6120 if res.Body != nil {
6121 res.Body.Close()
6122 }
6123 return nil, gensupport.WrapError(&googleapi.Error{
6124 Code: res.StatusCode,
6125 Header: res.Header,
6126 })
6127 }
6128 if err != nil {
6129 return nil, err
6130 }
6131 defer googleapi.CloseBody(res)
6132 if err := googleapi.CheckResponse(res); err != nil {
6133 return nil, gensupport.WrapError(err)
6134 }
6135 ret := &ApiVersion{
6136 ServerResponse: googleapi.ServerResponse{
6137 Header: res.Header,
6138 HTTPStatusCode: res.StatusCode,
6139 },
6140 }
6141 target := &ret
6142 b, err := gensupport.DecodeResponseBytes(target, res)
6143 if err != nil {
6144 return nil, err
6145 }
6146 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.create", "response", internallog.HTTPResponse(res, b))
6147 return ret, nil
6148 }
6149
6150 type ProjectsLocationsApisVersionsDeleteCall struct {
6151 s *Service
6152 name string
6153 urlParams_ gensupport.URLParams
6154 ctx_ context.Context
6155 header_ http.Header
6156 }
6157
6158 // Delete: Removes a specified version and all of the resources that it owns.
6159 //
6160 // - name: The name of the version to delete. Format:
6161 // `projects/*/locations/*/apis/*/versions/*`.
6162 func (r *ProjectsLocationsApisVersionsService) Delete(name string) *ProjectsLocationsApisVersionsDeleteCall {
6163 c := &ProjectsLocationsApisVersionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6164 c.name = name
6165 return c
6166 }
6167
6168 // Force sets the optional parameter "force": If set to true, any child
6169 // resources will also be deleted. (Otherwise, the request will only work if
6170 // there are no child resources.)
6171 func (c *ProjectsLocationsApisVersionsDeleteCall) Force(force bool) *ProjectsLocationsApisVersionsDeleteCall {
6172 c.urlParams_.Set("force", fmt.Sprint(force))
6173 return c
6174 }
6175
6176 // Fields allows partial responses to be retrieved. See
6177 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6178 // details.
6179 func (c *ProjectsLocationsApisVersionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsDeleteCall {
6180 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6181 return c
6182 }
6183
6184 // Context sets the context to be used in this call's Do method.
6185 func (c *ProjectsLocationsApisVersionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsDeleteCall {
6186 c.ctx_ = ctx
6187 return c
6188 }
6189
6190 // Header returns a http.Header that can be modified by the caller to add
6191 // headers to the request.
6192 func (c *ProjectsLocationsApisVersionsDeleteCall) Header() http.Header {
6193 if c.header_ == nil {
6194 c.header_ = make(http.Header)
6195 }
6196 return c.header_
6197 }
6198
6199 func (c *ProjectsLocationsApisVersionsDeleteCall) doRequest(alt string) (*http.Response, error) {
6200 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6201 c.urlParams_.Set("alt", alt)
6202 c.urlParams_.Set("prettyPrint", "false")
6203 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6204 urls += "?" + c.urlParams_.Encode()
6205 req, err := http.NewRequest("DELETE", urls, nil)
6206 if err != nil {
6207 return nil, err
6208 }
6209 req.Header = reqHeaders
6210 googleapi.Expand(req.URL, map[string]string{
6211 "name": c.name,
6212 })
6213 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.delete", "request", internallog.HTTPRequest(req, nil))
6214 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6215 }
6216
6217 // Do executes the "apigeeregistry.projects.locations.apis.versions.delete" call.
6218 // Any non-2xx status code is an error. Response headers are in either
6219 // *Empty.ServerResponse.Header or (if a response was returned at all) in
6220 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6221 // whether the returned error was because http.StatusNotModified was returned.
6222 func (c *ProjectsLocationsApisVersionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
6223 gensupport.SetOptions(c.urlParams_, opts...)
6224 res, err := c.doRequest("json")
6225 if res != nil && res.StatusCode == http.StatusNotModified {
6226 if res.Body != nil {
6227 res.Body.Close()
6228 }
6229 return nil, gensupport.WrapError(&googleapi.Error{
6230 Code: res.StatusCode,
6231 Header: res.Header,
6232 })
6233 }
6234 if err != nil {
6235 return nil, err
6236 }
6237 defer googleapi.CloseBody(res)
6238 if err := googleapi.CheckResponse(res); err != nil {
6239 return nil, gensupport.WrapError(err)
6240 }
6241 ret := &Empty{
6242 ServerResponse: googleapi.ServerResponse{
6243 Header: res.Header,
6244 HTTPStatusCode: res.StatusCode,
6245 },
6246 }
6247 target := &ret
6248 b, err := gensupport.DecodeResponseBytes(target, res)
6249 if err != nil {
6250 return nil, err
6251 }
6252 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.delete", "response", internallog.HTTPResponse(res, b))
6253 return ret, nil
6254 }
6255
6256 type ProjectsLocationsApisVersionsGetCall struct {
6257 s *Service
6258 name string
6259 urlParams_ gensupport.URLParams
6260 ifNoneMatch_ string
6261 ctx_ context.Context
6262 header_ http.Header
6263 }
6264
6265 // Get: Returns a specified version.
6266 //
6267 // - name: The name of the version to retrieve. Format:
6268 // `projects/*/locations/*/apis/*/versions/*`.
6269 func (r *ProjectsLocationsApisVersionsService) Get(name string) *ProjectsLocationsApisVersionsGetCall {
6270 c := &ProjectsLocationsApisVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6271 c.name = name
6272 return c
6273 }
6274
6275 // Fields allows partial responses to be retrieved. See
6276 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6277 // details.
6278 func (c *ProjectsLocationsApisVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsGetCall {
6279 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6280 return c
6281 }
6282
6283 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6284 // object's ETag matches the given value. This is useful for getting updates
6285 // only after the object has changed since the last request.
6286 func (c *ProjectsLocationsApisVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsGetCall {
6287 c.ifNoneMatch_ = entityTag
6288 return c
6289 }
6290
6291 // Context sets the context to be used in this call's Do method.
6292 func (c *ProjectsLocationsApisVersionsGetCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsGetCall {
6293 c.ctx_ = ctx
6294 return c
6295 }
6296
6297 // Header returns a http.Header that can be modified by the caller to add
6298 // headers to the request.
6299 func (c *ProjectsLocationsApisVersionsGetCall) Header() http.Header {
6300 if c.header_ == nil {
6301 c.header_ = make(http.Header)
6302 }
6303 return c.header_
6304 }
6305
6306 func (c *ProjectsLocationsApisVersionsGetCall) doRequest(alt string) (*http.Response, error) {
6307 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6308 if c.ifNoneMatch_ != "" {
6309 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6310 }
6311 c.urlParams_.Set("alt", alt)
6312 c.urlParams_.Set("prettyPrint", "false")
6313 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6314 urls += "?" + c.urlParams_.Encode()
6315 req, err := http.NewRequest("GET", urls, nil)
6316 if err != nil {
6317 return nil, err
6318 }
6319 req.Header = reqHeaders
6320 googleapi.Expand(req.URL, map[string]string{
6321 "name": c.name,
6322 })
6323 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.get", "request", internallog.HTTPRequest(req, nil))
6324 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6325 }
6326
6327 // Do executes the "apigeeregistry.projects.locations.apis.versions.get" call.
6328 // Any non-2xx status code is an error. Response headers are in either
6329 // *ApiVersion.ServerResponse.Header or (if a response was returned at all) in
6330 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6331 // whether the returned error was because http.StatusNotModified was returned.
6332 func (c *ProjectsLocationsApisVersionsGetCall) Do(opts ...googleapi.CallOption) (*ApiVersion, error) {
6333 gensupport.SetOptions(c.urlParams_, opts...)
6334 res, err := c.doRequest("json")
6335 if res != nil && res.StatusCode == http.StatusNotModified {
6336 if res.Body != nil {
6337 res.Body.Close()
6338 }
6339 return nil, gensupport.WrapError(&googleapi.Error{
6340 Code: res.StatusCode,
6341 Header: res.Header,
6342 })
6343 }
6344 if err != nil {
6345 return nil, err
6346 }
6347 defer googleapi.CloseBody(res)
6348 if err := googleapi.CheckResponse(res); err != nil {
6349 return nil, gensupport.WrapError(err)
6350 }
6351 ret := &ApiVersion{
6352 ServerResponse: googleapi.ServerResponse{
6353 Header: res.Header,
6354 HTTPStatusCode: res.StatusCode,
6355 },
6356 }
6357 target := &ret
6358 b, err := gensupport.DecodeResponseBytes(target, res)
6359 if err != nil {
6360 return nil, err
6361 }
6362 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.get", "response", internallog.HTTPResponse(res, b))
6363 return ret, nil
6364 }
6365
6366 type ProjectsLocationsApisVersionsGetIamPolicyCall struct {
6367 s *Service
6368 resource string
6369 urlParams_ gensupport.URLParams
6370 ifNoneMatch_ string
6371 ctx_ context.Context
6372 header_ http.Header
6373 }
6374
6375 // GetIamPolicy: Gets the access control policy for a resource. Returns an
6376 // empty policy if the resource exists and does not have a policy set.
6377 //
6378 // - resource: REQUIRED: The resource for which the policy is being requested.
6379 // See Resource names (https://cloud.google.com/apis/design/resource_names)
6380 // for the appropriate value for this field.
6381 func (r *ProjectsLocationsApisVersionsService) GetIamPolicy(resource string) *ProjectsLocationsApisVersionsGetIamPolicyCall {
6382 c := &ProjectsLocationsApisVersionsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6383 c.resource = resource
6384 return c
6385 }
6386
6387 // OptionsRequestedPolicyVersion sets the optional parameter
6388 // "options.requestedPolicyVersion": The maximum policy version that will be
6389 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
6390 // an invalid value will be rejected. Requests for policies with any
6391 // conditional role bindings must specify version 3. Policies with no
6392 // conditional role bindings may specify any valid value or leave the field
6393 // unset. The policy in the response might use the policy version that you
6394 // specified, or it might use a lower policy version. For example, if you
6395 // specify version 3, but the policy has no conditional role bindings, the
6396 // response uses version 1. To learn which resources support conditions in
6397 // their IAM policies, see the IAM documentation
6398 // (https://cloud.google.com/iam/help/conditions/resource-policies).
6399 func (c *ProjectsLocationsApisVersionsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsApisVersionsGetIamPolicyCall {
6400 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
6401 return c
6402 }
6403
6404 // Fields allows partial responses to be retrieved. See
6405 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6406 // details.
6407 func (c *ProjectsLocationsApisVersionsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsGetIamPolicyCall {
6408 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6409 return c
6410 }
6411
6412 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6413 // object's ETag matches the given value. This is useful for getting updates
6414 // only after the object has changed since the last request.
6415 func (c *ProjectsLocationsApisVersionsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsGetIamPolicyCall {
6416 c.ifNoneMatch_ = entityTag
6417 return c
6418 }
6419
6420 // Context sets the context to be used in this call's Do method.
6421 func (c *ProjectsLocationsApisVersionsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsGetIamPolicyCall {
6422 c.ctx_ = ctx
6423 return c
6424 }
6425
6426 // Header returns a http.Header that can be modified by the caller to add
6427 // headers to the request.
6428 func (c *ProjectsLocationsApisVersionsGetIamPolicyCall) Header() http.Header {
6429 if c.header_ == nil {
6430 c.header_ = make(http.Header)
6431 }
6432 return c.header_
6433 }
6434
6435 func (c *ProjectsLocationsApisVersionsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
6436 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6437 if c.ifNoneMatch_ != "" {
6438 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6439 }
6440 c.urlParams_.Set("alt", alt)
6441 c.urlParams_.Set("prettyPrint", "false")
6442 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
6443 urls += "?" + c.urlParams_.Encode()
6444 req, err := http.NewRequest("GET", urls, nil)
6445 if err != nil {
6446 return nil, err
6447 }
6448 req.Header = reqHeaders
6449 googleapi.Expand(req.URL, map[string]string{
6450 "resource": c.resource,
6451 })
6452 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
6453 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6454 }
6455
6456 // Do executes the "apigeeregistry.projects.locations.apis.versions.getIamPolicy" call.
6457 // Any non-2xx status code is an error. Response headers are in either
6458 // *Policy.ServerResponse.Header or (if a response was returned at all) in
6459 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6460 // whether the returned error was because http.StatusNotModified was returned.
6461 func (c *ProjectsLocationsApisVersionsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
6462 gensupport.SetOptions(c.urlParams_, opts...)
6463 res, err := c.doRequest("json")
6464 if res != nil && res.StatusCode == http.StatusNotModified {
6465 if res.Body != nil {
6466 res.Body.Close()
6467 }
6468 return nil, gensupport.WrapError(&googleapi.Error{
6469 Code: res.StatusCode,
6470 Header: res.Header,
6471 })
6472 }
6473 if err != nil {
6474 return nil, err
6475 }
6476 defer googleapi.CloseBody(res)
6477 if err := googleapi.CheckResponse(res); err != nil {
6478 return nil, gensupport.WrapError(err)
6479 }
6480 ret := &Policy{
6481 ServerResponse: googleapi.ServerResponse{
6482 Header: res.Header,
6483 HTTPStatusCode: res.StatusCode,
6484 },
6485 }
6486 target := &ret
6487 b, err := gensupport.DecodeResponseBytes(target, res)
6488 if err != nil {
6489 return nil, err
6490 }
6491 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.getIamPolicy", "response", internallog.HTTPResponse(res, b))
6492 return ret, nil
6493 }
6494
6495 type ProjectsLocationsApisVersionsListCall struct {
6496 s *Service
6497 parent string
6498 urlParams_ gensupport.URLParams
6499 ifNoneMatch_ string
6500 ctx_ context.Context
6501 header_ http.Header
6502 }
6503
6504 // List: Returns matching versions.
6505 //
6506 // - parent: The parent, which owns this collection of versions. Format:
6507 // `projects/*/locations/*/apis/*`.
6508 func (r *ProjectsLocationsApisVersionsService) List(parent string) *ProjectsLocationsApisVersionsListCall {
6509 c := &ProjectsLocationsApisVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6510 c.parent = parent
6511 return c
6512 }
6513
6514 // Filter sets the optional parameter "filter": An expression that can be used
6515 // to filter the list. Filters use the Common Expression Language and can refer
6516 // to all message fields.
6517 func (c *ProjectsLocationsApisVersionsListCall) Filter(filter string) *ProjectsLocationsApisVersionsListCall {
6518 c.urlParams_.Set("filter", filter)
6519 return c
6520 }
6521
6522 // OrderBy sets the optional parameter "orderBy": A comma-separated list of
6523 // fields, e.g. "foo,bar" Fields can be sorted in descending order using the
6524 // "desc" identifier, e.g. "foo desc,bar"
6525 func (c *ProjectsLocationsApisVersionsListCall) OrderBy(orderBy string) *ProjectsLocationsApisVersionsListCall {
6526 c.urlParams_.Set("orderBy", orderBy)
6527 return c
6528 }
6529
6530 // PageSize sets the optional parameter "pageSize": The maximum number of
6531 // versions to return. The service may return fewer than this value. If
6532 // unspecified, at most 50 values will be returned. The maximum is 1000; values
6533 // above 1000 will be coerced to 1000.
6534 func (c *ProjectsLocationsApisVersionsListCall) PageSize(pageSize int64) *ProjectsLocationsApisVersionsListCall {
6535 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6536 return c
6537 }
6538
6539 // PageToken sets the optional parameter "pageToken": A page token, received
6540 // from a previous `ListApiVersions` call. Provide this to retrieve the
6541 // subsequent page. When paginating, all other parameters provided to
6542 // `ListApiVersions` must match the call that provided the page token.
6543 func (c *ProjectsLocationsApisVersionsListCall) PageToken(pageToken string) *ProjectsLocationsApisVersionsListCall {
6544 c.urlParams_.Set("pageToken", pageToken)
6545 return c
6546 }
6547
6548 // Fields allows partial responses to be retrieved. See
6549 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6550 // details.
6551 func (c *ProjectsLocationsApisVersionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsListCall {
6552 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6553 return c
6554 }
6555
6556 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6557 // object's ETag matches the given value. This is useful for getting updates
6558 // only after the object has changed since the last request.
6559 func (c *ProjectsLocationsApisVersionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsListCall {
6560 c.ifNoneMatch_ = entityTag
6561 return c
6562 }
6563
6564 // Context sets the context to be used in this call's Do method.
6565 func (c *ProjectsLocationsApisVersionsListCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsListCall {
6566 c.ctx_ = ctx
6567 return c
6568 }
6569
6570 // Header returns a http.Header that can be modified by the caller to add
6571 // headers to the request.
6572 func (c *ProjectsLocationsApisVersionsListCall) Header() http.Header {
6573 if c.header_ == nil {
6574 c.header_ = make(http.Header)
6575 }
6576 return c.header_
6577 }
6578
6579 func (c *ProjectsLocationsApisVersionsListCall) doRequest(alt string) (*http.Response, error) {
6580 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6581 if c.ifNoneMatch_ != "" {
6582 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6583 }
6584 c.urlParams_.Set("alt", alt)
6585 c.urlParams_.Set("prettyPrint", "false")
6586 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions")
6587 urls += "?" + c.urlParams_.Encode()
6588 req, err := http.NewRequest("GET", urls, nil)
6589 if err != nil {
6590 return nil, err
6591 }
6592 req.Header = reqHeaders
6593 googleapi.Expand(req.URL, map[string]string{
6594 "parent": c.parent,
6595 })
6596 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.list", "request", internallog.HTTPRequest(req, nil))
6597 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6598 }
6599
6600 // Do executes the "apigeeregistry.projects.locations.apis.versions.list" call.
6601 // Any non-2xx status code is an error. Response headers are in either
6602 // *ListApiVersionsResponse.ServerResponse.Header or (if a response was
6603 // returned at all) in error.(*googleapi.Error).Header. Use
6604 // googleapi.IsNotModified to check whether the returned error was because
6605 // http.StatusNotModified was returned.
6606 func (c *ProjectsLocationsApisVersionsListCall) Do(opts ...googleapi.CallOption) (*ListApiVersionsResponse, error) {
6607 gensupport.SetOptions(c.urlParams_, opts...)
6608 res, err := c.doRequest("json")
6609 if res != nil && res.StatusCode == http.StatusNotModified {
6610 if res.Body != nil {
6611 res.Body.Close()
6612 }
6613 return nil, gensupport.WrapError(&googleapi.Error{
6614 Code: res.StatusCode,
6615 Header: res.Header,
6616 })
6617 }
6618 if err != nil {
6619 return nil, err
6620 }
6621 defer googleapi.CloseBody(res)
6622 if err := googleapi.CheckResponse(res); err != nil {
6623 return nil, gensupport.WrapError(err)
6624 }
6625 ret := &ListApiVersionsResponse{
6626 ServerResponse: googleapi.ServerResponse{
6627 Header: res.Header,
6628 HTTPStatusCode: res.StatusCode,
6629 },
6630 }
6631 target := &ret
6632 b, err := gensupport.DecodeResponseBytes(target, res)
6633 if err != nil {
6634 return nil, err
6635 }
6636 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.list", "response", internallog.HTTPResponse(res, b))
6637 return ret, nil
6638 }
6639
6640 // Pages invokes f for each page of results.
6641 // A non-nil error returned from f will halt the iteration.
6642 // The provided context supersedes any context provided to the Context method.
6643 func (c *ProjectsLocationsApisVersionsListCall) Pages(ctx context.Context, f func(*ListApiVersionsResponse) error) error {
6644 c.ctx_ = ctx
6645 defer c.PageToken(c.urlParams_.Get("pageToken"))
6646 for {
6647 x, err := c.Do()
6648 if err != nil {
6649 return err
6650 }
6651 if err := f(x); err != nil {
6652 return err
6653 }
6654 if x.NextPageToken == "" {
6655 return nil
6656 }
6657 c.PageToken(x.NextPageToken)
6658 }
6659 }
6660
6661 type ProjectsLocationsApisVersionsPatchCall struct {
6662 s *Service
6663 name string
6664 apiversion *ApiVersion
6665 urlParams_ gensupport.URLParams
6666 ctx_ context.Context
6667 header_ http.Header
6668 }
6669
6670 // Patch: Used to modify a specified version.
6671 //
6672 // - name: Resource name.
6673 func (r *ProjectsLocationsApisVersionsService) Patch(name string, apiversion *ApiVersion) *ProjectsLocationsApisVersionsPatchCall {
6674 c := &ProjectsLocationsApisVersionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6675 c.name = name
6676 c.apiversion = apiversion
6677 return c
6678 }
6679
6680 // AllowMissing sets the optional parameter "allowMissing": If set to true, and
6681 // the version is not found, a new version will be created. In this situation,
6682 // `update_mask` is ignored.
6683 func (c *ProjectsLocationsApisVersionsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsApisVersionsPatchCall {
6684 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing))
6685 return c
6686 }
6687
6688 // UpdateMask sets the optional parameter "updateMask": The list of fields to
6689 // be updated. If omitted, all fields are updated that are set in the request
6690 // message (fields set to default values are ignored). If an asterisk "*" is
6691 // specified, all fields are updated, including fields that are
6692 // unspecified/default in the request.
6693 func (c *ProjectsLocationsApisVersionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsApisVersionsPatchCall {
6694 c.urlParams_.Set("updateMask", updateMask)
6695 return c
6696 }
6697
6698 // Fields allows partial responses to be retrieved. See
6699 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6700 // details.
6701 func (c *ProjectsLocationsApisVersionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsPatchCall {
6702 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6703 return c
6704 }
6705
6706 // Context sets the context to be used in this call's Do method.
6707 func (c *ProjectsLocationsApisVersionsPatchCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsPatchCall {
6708 c.ctx_ = ctx
6709 return c
6710 }
6711
6712 // Header returns a http.Header that can be modified by the caller to add
6713 // headers to the request.
6714 func (c *ProjectsLocationsApisVersionsPatchCall) Header() http.Header {
6715 if c.header_ == nil {
6716 c.header_ = make(http.Header)
6717 }
6718 return c.header_
6719 }
6720
6721 func (c *ProjectsLocationsApisVersionsPatchCall) doRequest(alt string) (*http.Response, error) {
6722 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6723 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apiversion)
6724 if err != nil {
6725 return nil, err
6726 }
6727 c.urlParams_.Set("alt", alt)
6728 c.urlParams_.Set("prettyPrint", "false")
6729 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6730 urls += "?" + c.urlParams_.Encode()
6731 req, err := http.NewRequest("PATCH", urls, body)
6732 if err != nil {
6733 return nil, err
6734 }
6735 req.Header = reqHeaders
6736 googleapi.Expand(req.URL, map[string]string{
6737 "name": c.name,
6738 })
6739 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
6740 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6741 }
6742
6743 // Do executes the "apigeeregistry.projects.locations.apis.versions.patch" call.
6744 // Any non-2xx status code is an error. Response headers are in either
6745 // *ApiVersion.ServerResponse.Header or (if a response was returned at all) in
6746 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6747 // whether the returned error was because http.StatusNotModified was returned.
6748 func (c *ProjectsLocationsApisVersionsPatchCall) Do(opts ...googleapi.CallOption) (*ApiVersion, error) {
6749 gensupport.SetOptions(c.urlParams_, opts...)
6750 res, err := c.doRequest("json")
6751 if res != nil && res.StatusCode == http.StatusNotModified {
6752 if res.Body != nil {
6753 res.Body.Close()
6754 }
6755 return nil, gensupport.WrapError(&googleapi.Error{
6756 Code: res.StatusCode,
6757 Header: res.Header,
6758 })
6759 }
6760 if err != nil {
6761 return nil, err
6762 }
6763 defer googleapi.CloseBody(res)
6764 if err := googleapi.CheckResponse(res); err != nil {
6765 return nil, gensupport.WrapError(err)
6766 }
6767 ret := &ApiVersion{
6768 ServerResponse: googleapi.ServerResponse{
6769 Header: res.Header,
6770 HTTPStatusCode: res.StatusCode,
6771 },
6772 }
6773 target := &ret
6774 b, err := gensupport.DecodeResponseBytes(target, res)
6775 if err != nil {
6776 return nil, err
6777 }
6778 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.patch", "response", internallog.HTTPResponse(res, b))
6779 return ret, nil
6780 }
6781
6782 type ProjectsLocationsApisVersionsSetIamPolicyCall struct {
6783 s *Service
6784 resource string
6785 setiampolicyrequest *SetIamPolicyRequest
6786 urlParams_ gensupport.URLParams
6787 ctx_ context.Context
6788 header_ http.Header
6789 }
6790
6791 // SetIamPolicy: Sets the access control policy on the specified resource.
6792 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
6793 // and `PERMISSION_DENIED` errors.
6794 //
6795 // - resource: REQUIRED: The resource for which the policy is being specified.
6796 // See Resource names (https://cloud.google.com/apis/design/resource_names)
6797 // for the appropriate value for this field.
6798 func (r *ProjectsLocationsApisVersionsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsApisVersionsSetIamPolicyCall {
6799 c := &ProjectsLocationsApisVersionsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6800 c.resource = resource
6801 c.setiampolicyrequest = setiampolicyrequest
6802 return c
6803 }
6804
6805 // Fields allows partial responses to be retrieved. See
6806 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6807 // details.
6808 func (c *ProjectsLocationsApisVersionsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSetIamPolicyCall {
6809 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6810 return c
6811 }
6812
6813 // Context sets the context to be used in this call's Do method.
6814 func (c *ProjectsLocationsApisVersionsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSetIamPolicyCall {
6815 c.ctx_ = ctx
6816 return c
6817 }
6818
6819 // Header returns a http.Header that can be modified by the caller to add
6820 // headers to the request.
6821 func (c *ProjectsLocationsApisVersionsSetIamPolicyCall) Header() http.Header {
6822 if c.header_ == nil {
6823 c.header_ = make(http.Header)
6824 }
6825 return c.header_
6826 }
6827
6828 func (c *ProjectsLocationsApisVersionsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
6829 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6830 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
6831 if err != nil {
6832 return nil, err
6833 }
6834 c.urlParams_.Set("alt", alt)
6835 c.urlParams_.Set("prettyPrint", "false")
6836 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
6837 urls += "?" + c.urlParams_.Encode()
6838 req, err := http.NewRequest("POST", urls, body)
6839 if err != nil {
6840 return nil, err
6841 }
6842 req.Header = reqHeaders
6843 googleapi.Expand(req.URL, map[string]string{
6844 "resource": c.resource,
6845 })
6846 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
6847 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6848 }
6849
6850 // Do executes the "apigeeregistry.projects.locations.apis.versions.setIamPolicy" call.
6851 // Any non-2xx status code is an error. Response headers are in either
6852 // *Policy.ServerResponse.Header or (if a response was returned at all) in
6853 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6854 // whether the returned error was because http.StatusNotModified was returned.
6855 func (c *ProjectsLocationsApisVersionsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
6856 gensupport.SetOptions(c.urlParams_, opts...)
6857 res, err := c.doRequest("json")
6858 if res != nil && res.StatusCode == http.StatusNotModified {
6859 if res.Body != nil {
6860 res.Body.Close()
6861 }
6862 return nil, gensupport.WrapError(&googleapi.Error{
6863 Code: res.StatusCode,
6864 Header: res.Header,
6865 })
6866 }
6867 if err != nil {
6868 return nil, err
6869 }
6870 defer googleapi.CloseBody(res)
6871 if err := googleapi.CheckResponse(res); err != nil {
6872 return nil, gensupport.WrapError(err)
6873 }
6874 ret := &Policy{
6875 ServerResponse: googleapi.ServerResponse{
6876 Header: res.Header,
6877 HTTPStatusCode: res.StatusCode,
6878 },
6879 }
6880 target := &ret
6881 b, err := gensupport.DecodeResponseBytes(target, res)
6882 if err != nil {
6883 return nil, err
6884 }
6885 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.setIamPolicy", "response", internallog.HTTPResponse(res, b))
6886 return ret, nil
6887 }
6888
6889 type ProjectsLocationsApisVersionsTestIamPermissionsCall struct {
6890 s *Service
6891 resource string
6892 testiampermissionsrequest *TestIamPermissionsRequest
6893 urlParams_ gensupport.URLParams
6894 ctx_ context.Context
6895 header_ http.Header
6896 }
6897
6898 // TestIamPermissions: Returns permissions that a caller has on the specified
6899 // resource. If the resource does not exist, this will return an empty set of
6900 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
6901 // used for building permission-aware UIs and command-line tools, not for
6902 // authorization checking. This operation may "fail open" without warning.
6903 //
6904 // - resource: REQUIRED: The resource for which the policy detail is being
6905 // requested. See Resource names
6906 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
6907 // value for this field.
6908 func (r *ProjectsLocationsApisVersionsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsApisVersionsTestIamPermissionsCall {
6909 c := &ProjectsLocationsApisVersionsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6910 c.resource = resource
6911 c.testiampermissionsrequest = testiampermissionsrequest
6912 return c
6913 }
6914
6915 // Fields allows partial responses to be retrieved. See
6916 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6917 // details.
6918 func (c *ProjectsLocationsApisVersionsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsTestIamPermissionsCall {
6919 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6920 return c
6921 }
6922
6923 // Context sets the context to be used in this call's Do method.
6924 func (c *ProjectsLocationsApisVersionsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsTestIamPermissionsCall {
6925 c.ctx_ = ctx
6926 return c
6927 }
6928
6929 // Header returns a http.Header that can be modified by the caller to add
6930 // headers to the request.
6931 func (c *ProjectsLocationsApisVersionsTestIamPermissionsCall) Header() http.Header {
6932 if c.header_ == nil {
6933 c.header_ = make(http.Header)
6934 }
6935 return c.header_
6936 }
6937
6938 func (c *ProjectsLocationsApisVersionsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
6939 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6940 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
6941 if err != nil {
6942 return nil, err
6943 }
6944 c.urlParams_.Set("alt", alt)
6945 c.urlParams_.Set("prettyPrint", "false")
6946 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
6947 urls += "?" + c.urlParams_.Encode()
6948 req, err := http.NewRequest("POST", urls, body)
6949 if err != nil {
6950 return nil, err
6951 }
6952 req.Header = reqHeaders
6953 googleapi.Expand(req.URL, map[string]string{
6954 "resource": c.resource,
6955 })
6956 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
6957 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6958 }
6959
6960 // Do executes the "apigeeregistry.projects.locations.apis.versions.testIamPermissions" call.
6961 // Any non-2xx status code is an error. Response headers are in either
6962 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
6963 // returned at all) in error.(*googleapi.Error).Header. Use
6964 // googleapi.IsNotModified to check whether the returned error was because
6965 // http.StatusNotModified was returned.
6966 func (c *ProjectsLocationsApisVersionsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
6967 gensupport.SetOptions(c.urlParams_, opts...)
6968 res, err := c.doRequest("json")
6969 if res != nil && res.StatusCode == http.StatusNotModified {
6970 if res.Body != nil {
6971 res.Body.Close()
6972 }
6973 return nil, gensupport.WrapError(&googleapi.Error{
6974 Code: res.StatusCode,
6975 Header: res.Header,
6976 })
6977 }
6978 if err != nil {
6979 return nil, err
6980 }
6981 defer googleapi.CloseBody(res)
6982 if err := googleapi.CheckResponse(res); err != nil {
6983 return nil, gensupport.WrapError(err)
6984 }
6985 ret := &TestIamPermissionsResponse{
6986 ServerResponse: googleapi.ServerResponse{
6987 Header: res.Header,
6988 HTTPStatusCode: res.StatusCode,
6989 },
6990 }
6991 target := &ret
6992 b, err := gensupport.DecodeResponseBytes(target, res)
6993 if err != nil {
6994 return nil, err
6995 }
6996 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.testIamPermissions", "response", internallog.HTTPResponse(res, b))
6997 return ret, nil
6998 }
6999
7000 type ProjectsLocationsApisVersionsArtifactsCreateCall struct {
7001 s *Service
7002 parent string
7003 artifact *Artifact
7004 urlParams_ gensupport.URLParams
7005 ctx_ context.Context
7006 header_ http.Header
7007 }
7008
7009 // Create: Creates a specified artifact.
7010 //
7011 // - parent: The parent, which owns this collection of artifacts. Format:
7012 // `{parent}`.
7013 func (r *ProjectsLocationsApisVersionsArtifactsService) Create(parent string, artifact *Artifact) *ProjectsLocationsApisVersionsArtifactsCreateCall {
7014 c := &ProjectsLocationsApisVersionsArtifactsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7015 c.parent = parent
7016 c.artifact = artifact
7017 return c
7018 }
7019
7020 // ArtifactId sets the optional parameter "artifactId": Required. The ID to use
7021 // for the artifact, which will become the final component of the artifact's
7022 // resource name. This value should be 4-63 characters, and valid characters
7023 // are /a-z-/. Following AIP-162, IDs must not have the form of a UUID.
7024 func (c *ProjectsLocationsApisVersionsArtifactsCreateCall) ArtifactId(artifactId string) *ProjectsLocationsApisVersionsArtifactsCreateCall {
7025 c.urlParams_.Set("artifactId", artifactId)
7026 return c
7027 }
7028
7029 // Fields allows partial responses to be retrieved. See
7030 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7031 // details.
7032 func (c *ProjectsLocationsApisVersionsArtifactsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsCreateCall {
7033 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7034 return c
7035 }
7036
7037 // Context sets the context to be used in this call's Do method.
7038 func (c *ProjectsLocationsApisVersionsArtifactsCreateCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsCreateCall {
7039 c.ctx_ = ctx
7040 return c
7041 }
7042
7043 // Header returns a http.Header that can be modified by the caller to add
7044 // headers to the request.
7045 func (c *ProjectsLocationsApisVersionsArtifactsCreateCall) Header() http.Header {
7046 if c.header_ == nil {
7047 c.header_ = make(http.Header)
7048 }
7049 return c.header_
7050 }
7051
7052 func (c *ProjectsLocationsApisVersionsArtifactsCreateCall) doRequest(alt string) (*http.Response, error) {
7053 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7054 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact)
7055 if err != nil {
7056 return nil, err
7057 }
7058 c.urlParams_.Set("alt", alt)
7059 c.urlParams_.Set("prettyPrint", "false")
7060 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
7061 urls += "?" + c.urlParams_.Encode()
7062 req, err := http.NewRequest("POST", urls, body)
7063 if err != nil {
7064 return nil, err
7065 }
7066 req.Header = reqHeaders
7067 googleapi.Expand(req.URL, map[string]string{
7068 "parent": c.parent,
7069 })
7070 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.create", "request", internallog.HTTPRequest(req, body.Bytes()))
7071 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7072 }
7073
7074 // Do executes the "apigeeregistry.projects.locations.apis.versions.artifacts.create" call.
7075 // Any non-2xx status code is an error. Response headers are in either
7076 // *Artifact.ServerResponse.Header or (if a response was returned at all) in
7077 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7078 // whether the returned error was because http.StatusNotModified was returned.
7079 func (c *ProjectsLocationsApisVersionsArtifactsCreateCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
7080 gensupport.SetOptions(c.urlParams_, opts...)
7081 res, err := c.doRequest("json")
7082 if res != nil && res.StatusCode == http.StatusNotModified {
7083 if res.Body != nil {
7084 res.Body.Close()
7085 }
7086 return nil, gensupport.WrapError(&googleapi.Error{
7087 Code: res.StatusCode,
7088 Header: res.Header,
7089 })
7090 }
7091 if err != nil {
7092 return nil, err
7093 }
7094 defer googleapi.CloseBody(res)
7095 if err := googleapi.CheckResponse(res); err != nil {
7096 return nil, gensupport.WrapError(err)
7097 }
7098 ret := &Artifact{
7099 ServerResponse: googleapi.ServerResponse{
7100 Header: res.Header,
7101 HTTPStatusCode: res.StatusCode,
7102 },
7103 }
7104 target := &ret
7105 b, err := gensupport.DecodeResponseBytes(target, res)
7106 if err != nil {
7107 return nil, err
7108 }
7109 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.create", "response", internallog.HTTPResponse(res, b))
7110 return ret, nil
7111 }
7112
7113 type ProjectsLocationsApisVersionsArtifactsDeleteCall struct {
7114 s *Service
7115 name string
7116 urlParams_ gensupport.URLParams
7117 ctx_ context.Context
7118 header_ http.Header
7119 }
7120
7121 // Delete: Removes a specified artifact.
7122 //
7123 // - name: The name of the artifact to delete. Format: `{parent}/artifacts/*`.
7124 func (r *ProjectsLocationsApisVersionsArtifactsService) Delete(name string) *ProjectsLocationsApisVersionsArtifactsDeleteCall {
7125 c := &ProjectsLocationsApisVersionsArtifactsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7126 c.name = name
7127 return c
7128 }
7129
7130 // Fields allows partial responses to be retrieved. See
7131 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7132 // details.
7133 func (c *ProjectsLocationsApisVersionsArtifactsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsDeleteCall {
7134 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7135 return c
7136 }
7137
7138 // Context sets the context to be used in this call's Do method.
7139 func (c *ProjectsLocationsApisVersionsArtifactsDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsDeleteCall {
7140 c.ctx_ = ctx
7141 return c
7142 }
7143
7144 // Header returns a http.Header that can be modified by the caller to add
7145 // headers to the request.
7146 func (c *ProjectsLocationsApisVersionsArtifactsDeleteCall) Header() http.Header {
7147 if c.header_ == nil {
7148 c.header_ = make(http.Header)
7149 }
7150 return c.header_
7151 }
7152
7153 func (c *ProjectsLocationsApisVersionsArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) {
7154 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7155 c.urlParams_.Set("alt", alt)
7156 c.urlParams_.Set("prettyPrint", "false")
7157 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7158 urls += "?" + c.urlParams_.Encode()
7159 req, err := http.NewRequest("DELETE", urls, nil)
7160 if err != nil {
7161 return nil, err
7162 }
7163 req.Header = reqHeaders
7164 googleapi.Expand(req.URL, map[string]string{
7165 "name": c.name,
7166 })
7167 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.delete", "request", internallog.HTTPRequest(req, nil))
7168 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7169 }
7170
7171 // Do executes the "apigeeregistry.projects.locations.apis.versions.artifacts.delete" call.
7172 // Any non-2xx status code is an error. Response headers are in either
7173 // *Empty.ServerResponse.Header or (if a response was returned at all) in
7174 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7175 // whether the returned error was because http.StatusNotModified was returned.
7176 func (c *ProjectsLocationsApisVersionsArtifactsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
7177 gensupport.SetOptions(c.urlParams_, opts...)
7178 res, err := c.doRequest("json")
7179 if res != nil && res.StatusCode == http.StatusNotModified {
7180 if res.Body != nil {
7181 res.Body.Close()
7182 }
7183 return nil, gensupport.WrapError(&googleapi.Error{
7184 Code: res.StatusCode,
7185 Header: res.Header,
7186 })
7187 }
7188 if err != nil {
7189 return nil, err
7190 }
7191 defer googleapi.CloseBody(res)
7192 if err := googleapi.CheckResponse(res); err != nil {
7193 return nil, gensupport.WrapError(err)
7194 }
7195 ret := &Empty{
7196 ServerResponse: googleapi.ServerResponse{
7197 Header: res.Header,
7198 HTTPStatusCode: res.StatusCode,
7199 },
7200 }
7201 target := &ret
7202 b, err := gensupport.DecodeResponseBytes(target, res)
7203 if err != nil {
7204 return nil, err
7205 }
7206 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.delete", "response", internallog.HTTPResponse(res, b))
7207 return ret, nil
7208 }
7209
7210 type ProjectsLocationsApisVersionsArtifactsGetCall struct {
7211 s *Service
7212 name string
7213 urlParams_ gensupport.URLParams
7214 ifNoneMatch_ string
7215 ctx_ context.Context
7216 header_ http.Header
7217 }
7218
7219 // Get: Returns a specified artifact.
7220 //
7221 // - name: The name of the artifact to retrieve. Format: `{parent}/artifacts/*`.
7222 func (r *ProjectsLocationsApisVersionsArtifactsService) Get(name string) *ProjectsLocationsApisVersionsArtifactsGetCall {
7223 c := &ProjectsLocationsApisVersionsArtifactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7224 c.name = name
7225 return c
7226 }
7227
7228 // Fields allows partial responses to be retrieved. See
7229 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7230 // details.
7231 func (c *ProjectsLocationsApisVersionsArtifactsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsGetCall {
7232 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7233 return c
7234 }
7235
7236 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7237 // object's ETag matches the given value. This is useful for getting updates
7238 // only after the object has changed since the last request.
7239 func (c *ProjectsLocationsApisVersionsArtifactsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsArtifactsGetCall {
7240 c.ifNoneMatch_ = entityTag
7241 return c
7242 }
7243
7244 // Context sets the context to be used in this call's Do method.
7245 func (c *ProjectsLocationsApisVersionsArtifactsGetCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsGetCall {
7246 c.ctx_ = ctx
7247 return c
7248 }
7249
7250 // Header returns a http.Header that can be modified by the caller to add
7251 // headers to the request.
7252 func (c *ProjectsLocationsApisVersionsArtifactsGetCall) Header() http.Header {
7253 if c.header_ == nil {
7254 c.header_ = make(http.Header)
7255 }
7256 return c.header_
7257 }
7258
7259 func (c *ProjectsLocationsApisVersionsArtifactsGetCall) doRequest(alt string) (*http.Response, error) {
7260 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7261 if c.ifNoneMatch_ != "" {
7262 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7263 }
7264 c.urlParams_.Set("alt", alt)
7265 c.urlParams_.Set("prettyPrint", "false")
7266 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7267 urls += "?" + c.urlParams_.Encode()
7268 req, err := http.NewRequest("GET", urls, nil)
7269 if err != nil {
7270 return nil, err
7271 }
7272 req.Header = reqHeaders
7273 googleapi.Expand(req.URL, map[string]string{
7274 "name": c.name,
7275 })
7276 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.get", "request", internallog.HTTPRequest(req, nil))
7277 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7278 }
7279
7280 // Do executes the "apigeeregistry.projects.locations.apis.versions.artifacts.get" call.
7281 // Any non-2xx status code is an error. Response headers are in either
7282 // *Artifact.ServerResponse.Header or (if a response was returned at all) in
7283 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7284 // whether the returned error was because http.StatusNotModified was returned.
7285 func (c *ProjectsLocationsApisVersionsArtifactsGetCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
7286 gensupport.SetOptions(c.urlParams_, opts...)
7287 res, err := c.doRequest("json")
7288 if res != nil && res.StatusCode == http.StatusNotModified {
7289 if res.Body != nil {
7290 res.Body.Close()
7291 }
7292 return nil, gensupport.WrapError(&googleapi.Error{
7293 Code: res.StatusCode,
7294 Header: res.Header,
7295 })
7296 }
7297 if err != nil {
7298 return nil, err
7299 }
7300 defer googleapi.CloseBody(res)
7301 if err := googleapi.CheckResponse(res); err != nil {
7302 return nil, gensupport.WrapError(err)
7303 }
7304 ret := &Artifact{
7305 ServerResponse: googleapi.ServerResponse{
7306 Header: res.Header,
7307 HTTPStatusCode: res.StatusCode,
7308 },
7309 }
7310 target := &ret
7311 b, err := gensupport.DecodeResponseBytes(target, res)
7312 if err != nil {
7313 return nil, err
7314 }
7315 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.get", "response", internallog.HTTPResponse(res, b))
7316 return ret, nil
7317 }
7318
7319 type ProjectsLocationsApisVersionsArtifactsGetContentsCall struct {
7320 s *Service
7321 name string
7322 urlParams_ gensupport.URLParams
7323 ifNoneMatch_ string
7324 ctx_ context.Context
7325 header_ http.Header
7326 }
7327
7328 // GetContents: Returns the contents of a specified artifact. If artifacts are
7329 // stored with GZip compression, the default behavior is to return the artifact
7330 // uncompressed (the mime_type response field indicates the exact format
7331 // returned).
7332 //
7333 // - name: The name of the artifact whose contents should be retrieved. Format:
7334 // `{parent}/artifacts/*`.
7335 func (r *ProjectsLocationsApisVersionsArtifactsService) GetContents(name string) *ProjectsLocationsApisVersionsArtifactsGetContentsCall {
7336 c := &ProjectsLocationsApisVersionsArtifactsGetContentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7337 c.name = name
7338 return c
7339 }
7340
7341 // Fields allows partial responses to be retrieved. See
7342 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7343 // details.
7344 func (c *ProjectsLocationsApisVersionsArtifactsGetContentsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsGetContentsCall {
7345 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7346 return c
7347 }
7348
7349 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7350 // object's ETag matches the given value. This is useful for getting updates
7351 // only after the object has changed since the last request.
7352 func (c *ProjectsLocationsApisVersionsArtifactsGetContentsCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsArtifactsGetContentsCall {
7353 c.ifNoneMatch_ = entityTag
7354 return c
7355 }
7356
7357 // Context sets the context to be used in this call's Do method.
7358 func (c *ProjectsLocationsApisVersionsArtifactsGetContentsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsGetContentsCall {
7359 c.ctx_ = ctx
7360 return c
7361 }
7362
7363 // Header returns a http.Header that can be modified by the caller to add
7364 // headers to the request.
7365 func (c *ProjectsLocationsApisVersionsArtifactsGetContentsCall) Header() http.Header {
7366 if c.header_ == nil {
7367 c.header_ = make(http.Header)
7368 }
7369 return c.header_
7370 }
7371
7372 func (c *ProjectsLocationsApisVersionsArtifactsGetContentsCall) doRequest(alt string) (*http.Response, error) {
7373 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7374 if c.ifNoneMatch_ != "" {
7375 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7376 }
7377 c.urlParams_.Set("alt", alt)
7378 c.urlParams_.Set("prettyPrint", "false")
7379 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents")
7380 urls += "?" + c.urlParams_.Encode()
7381 req, err := http.NewRequest("GET", urls, nil)
7382 if err != nil {
7383 return nil, err
7384 }
7385 req.Header = reqHeaders
7386 googleapi.Expand(req.URL, map[string]string{
7387 "name": c.name,
7388 })
7389 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.getContents", "request", internallog.HTTPRequest(req, nil))
7390 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7391 }
7392
7393 // Do executes the "apigeeregistry.projects.locations.apis.versions.artifacts.getContents" call.
7394 // Any non-2xx status code is an error. Response headers are in either
7395 // *HttpBody.ServerResponse.Header or (if a response was returned at all) in
7396 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7397 // whether the returned error was because http.StatusNotModified was returned.
7398 func (c *ProjectsLocationsApisVersionsArtifactsGetContentsCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
7399 gensupport.SetOptions(c.urlParams_, opts...)
7400 res, err := c.doRequest("json")
7401 if res != nil && res.StatusCode == http.StatusNotModified {
7402 if res.Body != nil {
7403 res.Body.Close()
7404 }
7405 return nil, gensupport.WrapError(&googleapi.Error{
7406 Code: res.StatusCode,
7407 Header: res.Header,
7408 })
7409 }
7410 if err != nil {
7411 return nil, err
7412 }
7413 defer googleapi.CloseBody(res)
7414 if err := googleapi.CheckResponse(res); err != nil {
7415 return nil, gensupport.WrapError(err)
7416 }
7417 ret := &HttpBody{
7418 ServerResponse: googleapi.ServerResponse{
7419 Header: res.Header,
7420 HTTPStatusCode: res.StatusCode,
7421 },
7422 }
7423 target := &ret
7424 b, err := gensupport.DecodeResponseBytes(target, res)
7425 if err != nil {
7426 return nil, err
7427 }
7428 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.getContents", "response", internallog.HTTPResponse(res, b))
7429 return ret, nil
7430 }
7431
7432 type ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall struct {
7433 s *Service
7434 resource string
7435 urlParams_ gensupport.URLParams
7436 ifNoneMatch_ string
7437 ctx_ context.Context
7438 header_ http.Header
7439 }
7440
7441 // GetIamPolicy: Gets the access control policy for a resource. Returns an
7442 // empty policy if the resource exists and does not have a policy set.
7443 //
7444 // - resource: REQUIRED: The resource for which the policy is being requested.
7445 // See Resource names (https://cloud.google.com/apis/design/resource_names)
7446 // for the appropriate value for this field.
7447 func (r *ProjectsLocationsApisVersionsArtifactsService) GetIamPolicy(resource string) *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall {
7448 c := &ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7449 c.resource = resource
7450 return c
7451 }
7452
7453 // OptionsRequestedPolicyVersion sets the optional parameter
7454 // "options.requestedPolicyVersion": The maximum policy version that will be
7455 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
7456 // an invalid value will be rejected. Requests for policies with any
7457 // conditional role bindings must specify version 3. Policies with no
7458 // conditional role bindings may specify any valid value or leave the field
7459 // unset. The policy in the response might use the policy version that you
7460 // specified, or it might use a lower policy version. For example, if you
7461 // specify version 3, but the policy has no conditional role bindings, the
7462 // response uses version 1. To learn which resources support conditions in
7463 // their IAM policies, see the IAM documentation
7464 // (https://cloud.google.com/iam/help/conditions/resource-policies).
7465 func (c *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall {
7466 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
7467 return c
7468 }
7469
7470 // Fields allows partial responses to be retrieved. See
7471 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7472 // details.
7473 func (c *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall {
7474 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7475 return c
7476 }
7477
7478 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7479 // object's ETag matches the given value. This is useful for getting updates
7480 // only after the object has changed since the last request.
7481 func (c *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall {
7482 c.ifNoneMatch_ = entityTag
7483 return c
7484 }
7485
7486 // Context sets the context to be used in this call's Do method.
7487 func (c *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall {
7488 c.ctx_ = ctx
7489 return c
7490 }
7491
7492 // Header returns a http.Header that can be modified by the caller to add
7493 // headers to the request.
7494 func (c *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall) Header() http.Header {
7495 if c.header_ == nil {
7496 c.header_ = make(http.Header)
7497 }
7498 return c.header_
7499 }
7500
7501 func (c *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
7502 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7503 if c.ifNoneMatch_ != "" {
7504 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7505 }
7506 c.urlParams_.Set("alt", alt)
7507 c.urlParams_.Set("prettyPrint", "false")
7508 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
7509 urls += "?" + c.urlParams_.Encode()
7510 req, err := http.NewRequest("GET", urls, nil)
7511 if err != nil {
7512 return nil, err
7513 }
7514 req.Header = reqHeaders
7515 googleapi.Expand(req.URL, map[string]string{
7516 "resource": c.resource,
7517 })
7518 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
7519 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7520 }
7521
7522 // Do executes the "apigeeregistry.projects.locations.apis.versions.artifacts.getIamPolicy" call.
7523 // Any non-2xx status code is an error. Response headers are in either
7524 // *Policy.ServerResponse.Header or (if a response was returned at all) in
7525 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7526 // whether the returned error was because http.StatusNotModified was returned.
7527 func (c *ProjectsLocationsApisVersionsArtifactsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
7528 gensupport.SetOptions(c.urlParams_, opts...)
7529 res, err := c.doRequest("json")
7530 if res != nil && res.StatusCode == http.StatusNotModified {
7531 if res.Body != nil {
7532 res.Body.Close()
7533 }
7534 return nil, gensupport.WrapError(&googleapi.Error{
7535 Code: res.StatusCode,
7536 Header: res.Header,
7537 })
7538 }
7539 if err != nil {
7540 return nil, err
7541 }
7542 defer googleapi.CloseBody(res)
7543 if err := googleapi.CheckResponse(res); err != nil {
7544 return nil, gensupport.WrapError(err)
7545 }
7546 ret := &Policy{
7547 ServerResponse: googleapi.ServerResponse{
7548 Header: res.Header,
7549 HTTPStatusCode: res.StatusCode,
7550 },
7551 }
7552 target := &ret
7553 b, err := gensupport.DecodeResponseBytes(target, res)
7554 if err != nil {
7555 return nil, err
7556 }
7557 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.getIamPolicy", "response", internallog.HTTPResponse(res, b))
7558 return ret, nil
7559 }
7560
7561 type ProjectsLocationsApisVersionsArtifactsListCall struct {
7562 s *Service
7563 parent string
7564 urlParams_ gensupport.URLParams
7565 ifNoneMatch_ string
7566 ctx_ context.Context
7567 header_ http.Header
7568 }
7569
7570 // List: Returns matching artifacts.
7571 //
7572 // - parent: The parent, which owns this collection of artifacts. Format:
7573 // `{parent}`.
7574 func (r *ProjectsLocationsApisVersionsArtifactsService) List(parent string) *ProjectsLocationsApisVersionsArtifactsListCall {
7575 c := &ProjectsLocationsApisVersionsArtifactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7576 c.parent = parent
7577 return c
7578 }
7579
7580 // Filter sets the optional parameter "filter": An expression that can be used
7581 // to filter the list. Filters use the Common Expression Language and can refer
7582 // to all message fields except contents.
7583 func (c *ProjectsLocationsApisVersionsArtifactsListCall) Filter(filter string) *ProjectsLocationsApisVersionsArtifactsListCall {
7584 c.urlParams_.Set("filter", filter)
7585 return c
7586 }
7587
7588 // OrderBy sets the optional parameter "orderBy": A comma-separated list of
7589 // fields, e.g. "foo,bar" Fields can be sorted in descending order using the
7590 // "desc" identifier, e.g. "foo desc,bar"
7591 func (c *ProjectsLocationsApisVersionsArtifactsListCall) OrderBy(orderBy string) *ProjectsLocationsApisVersionsArtifactsListCall {
7592 c.urlParams_.Set("orderBy", orderBy)
7593 return c
7594 }
7595
7596 // PageSize sets the optional parameter "pageSize": The maximum number of
7597 // artifacts to return. The service may return fewer than this value. If
7598 // unspecified, at most 50 values will be returned. The maximum is 1000; values
7599 // above 1000 will be coerced to 1000.
7600 func (c *ProjectsLocationsApisVersionsArtifactsListCall) PageSize(pageSize int64) *ProjectsLocationsApisVersionsArtifactsListCall {
7601 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7602 return c
7603 }
7604
7605 // PageToken sets the optional parameter "pageToken": A page token, received
7606 // from a previous `ListArtifacts` call. Provide this to retrieve the
7607 // subsequent page. When paginating, all other parameters provided to
7608 // `ListArtifacts` must match the call that provided the page token.
7609 func (c *ProjectsLocationsApisVersionsArtifactsListCall) PageToken(pageToken string) *ProjectsLocationsApisVersionsArtifactsListCall {
7610 c.urlParams_.Set("pageToken", pageToken)
7611 return c
7612 }
7613
7614 // Fields allows partial responses to be retrieved. See
7615 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7616 // details.
7617 func (c *ProjectsLocationsApisVersionsArtifactsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsListCall {
7618 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7619 return c
7620 }
7621
7622 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7623 // object's ETag matches the given value. This is useful for getting updates
7624 // only after the object has changed since the last request.
7625 func (c *ProjectsLocationsApisVersionsArtifactsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsArtifactsListCall {
7626 c.ifNoneMatch_ = entityTag
7627 return c
7628 }
7629
7630 // Context sets the context to be used in this call's Do method.
7631 func (c *ProjectsLocationsApisVersionsArtifactsListCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsListCall {
7632 c.ctx_ = ctx
7633 return c
7634 }
7635
7636 // Header returns a http.Header that can be modified by the caller to add
7637 // headers to the request.
7638 func (c *ProjectsLocationsApisVersionsArtifactsListCall) Header() http.Header {
7639 if c.header_ == nil {
7640 c.header_ = make(http.Header)
7641 }
7642 return c.header_
7643 }
7644
7645 func (c *ProjectsLocationsApisVersionsArtifactsListCall) doRequest(alt string) (*http.Response, error) {
7646 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7647 if c.ifNoneMatch_ != "" {
7648 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7649 }
7650 c.urlParams_.Set("alt", alt)
7651 c.urlParams_.Set("prettyPrint", "false")
7652 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
7653 urls += "?" + c.urlParams_.Encode()
7654 req, err := http.NewRequest("GET", urls, nil)
7655 if err != nil {
7656 return nil, err
7657 }
7658 req.Header = reqHeaders
7659 googleapi.Expand(req.URL, map[string]string{
7660 "parent": c.parent,
7661 })
7662 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.list", "request", internallog.HTTPRequest(req, nil))
7663 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7664 }
7665
7666 // Do executes the "apigeeregistry.projects.locations.apis.versions.artifacts.list" call.
7667 // Any non-2xx status code is an error. Response headers are in either
7668 // *ListArtifactsResponse.ServerResponse.Header or (if a response was returned
7669 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7670 // check whether the returned error was because http.StatusNotModified was
7671 // returned.
7672 func (c *ProjectsLocationsApisVersionsArtifactsListCall) Do(opts ...googleapi.CallOption) (*ListArtifactsResponse, error) {
7673 gensupport.SetOptions(c.urlParams_, opts...)
7674 res, err := c.doRequest("json")
7675 if res != nil && res.StatusCode == http.StatusNotModified {
7676 if res.Body != nil {
7677 res.Body.Close()
7678 }
7679 return nil, gensupport.WrapError(&googleapi.Error{
7680 Code: res.StatusCode,
7681 Header: res.Header,
7682 })
7683 }
7684 if err != nil {
7685 return nil, err
7686 }
7687 defer googleapi.CloseBody(res)
7688 if err := googleapi.CheckResponse(res); err != nil {
7689 return nil, gensupport.WrapError(err)
7690 }
7691 ret := &ListArtifactsResponse{
7692 ServerResponse: googleapi.ServerResponse{
7693 Header: res.Header,
7694 HTTPStatusCode: res.StatusCode,
7695 },
7696 }
7697 target := &ret
7698 b, err := gensupport.DecodeResponseBytes(target, res)
7699 if err != nil {
7700 return nil, err
7701 }
7702 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.list", "response", internallog.HTTPResponse(res, b))
7703 return ret, nil
7704 }
7705
7706 // Pages invokes f for each page of results.
7707 // A non-nil error returned from f will halt the iteration.
7708 // The provided context supersedes any context provided to the Context method.
7709 func (c *ProjectsLocationsApisVersionsArtifactsListCall) Pages(ctx context.Context, f func(*ListArtifactsResponse) error) error {
7710 c.ctx_ = ctx
7711 defer c.PageToken(c.urlParams_.Get("pageToken"))
7712 for {
7713 x, err := c.Do()
7714 if err != nil {
7715 return err
7716 }
7717 if err := f(x); err != nil {
7718 return err
7719 }
7720 if x.NextPageToken == "" {
7721 return nil
7722 }
7723 c.PageToken(x.NextPageToken)
7724 }
7725 }
7726
7727 type ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall struct {
7728 s *Service
7729 name string
7730 artifact *Artifact
7731 urlParams_ gensupport.URLParams
7732 ctx_ context.Context
7733 header_ http.Header
7734 }
7735
7736 // ReplaceArtifact: Used to replace a specified artifact.
7737 //
7738 // - name: Resource name.
7739 func (r *ProjectsLocationsApisVersionsArtifactsService) ReplaceArtifact(name string, artifact *Artifact) *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall {
7740 c := &ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7741 c.name = name
7742 c.artifact = artifact
7743 return c
7744 }
7745
7746 // Fields allows partial responses to be retrieved. See
7747 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7748 // details.
7749 func (c *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall {
7750 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7751 return c
7752 }
7753
7754 // Context sets the context to be used in this call's Do method.
7755 func (c *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall {
7756 c.ctx_ = ctx
7757 return c
7758 }
7759
7760 // Header returns a http.Header that can be modified by the caller to add
7761 // headers to the request.
7762 func (c *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall) Header() http.Header {
7763 if c.header_ == nil {
7764 c.header_ = make(http.Header)
7765 }
7766 return c.header_
7767 }
7768
7769 func (c *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall) doRequest(alt string) (*http.Response, error) {
7770 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7771 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact)
7772 if err != nil {
7773 return nil, err
7774 }
7775 c.urlParams_.Set("alt", alt)
7776 c.urlParams_.Set("prettyPrint", "false")
7777 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7778 urls += "?" + c.urlParams_.Encode()
7779 req, err := http.NewRequest("PUT", urls, body)
7780 if err != nil {
7781 return nil, err
7782 }
7783 req.Header = reqHeaders
7784 googleapi.Expand(req.URL, map[string]string{
7785 "name": c.name,
7786 })
7787 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.replaceArtifact", "request", internallog.HTTPRequest(req, body.Bytes()))
7788 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7789 }
7790
7791 // Do executes the "apigeeregistry.projects.locations.apis.versions.artifacts.replaceArtifact" call.
7792 // Any non-2xx status code is an error. Response headers are in either
7793 // *Artifact.ServerResponse.Header or (if a response was returned at all) in
7794 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7795 // whether the returned error was because http.StatusNotModified was returned.
7796 func (c *ProjectsLocationsApisVersionsArtifactsReplaceArtifactCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
7797 gensupport.SetOptions(c.urlParams_, opts...)
7798 res, err := c.doRequest("json")
7799 if res != nil && res.StatusCode == http.StatusNotModified {
7800 if res.Body != nil {
7801 res.Body.Close()
7802 }
7803 return nil, gensupport.WrapError(&googleapi.Error{
7804 Code: res.StatusCode,
7805 Header: res.Header,
7806 })
7807 }
7808 if err != nil {
7809 return nil, err
7810 }
7811 defer googleapi.CloseBody(res)
7812 if err := googleapi.CheckResponse(res); err != nil {
7813 return nil, gensupport.WrapError(err)
7814 }
7815 ret := &Artifact{
7816 ServerResponse: googleapi.ServerResponse{
7817 Header: res.Header,
7818 HTTPStatusCode: res.StatusCode,
7819 },
7820 }
7821 target := &ret
7822 b, err := gensupport.DecodeResponseBytes(target, res)
7823 if err != nil {
7824 return nil, err
7825 }
7826 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.replaceArtifact", "response", internallog.HTTPResponse(res, b))
7827 return ret, nil
7828 }
7829
7830 type ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall struct {
7831 s *Service
7832 resource string
7833 setiampolicyrequest *SetIamPolicyRequest
7834 urlParams_ gensupport.URLParams
7835 ctx_ context.Context
7836 header_ http.Header
7837 }
7838
7839 // SetIamPolicy: Sets the access control policy on the specified resource.
7840 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
7841 // and `PERMISSION_DENIED` errors.
7842 //
7843 // - resource: REQUIRED: The resource for which the policy is being specified.
7844 // See Resource names (https://cloud.google.com/apis/design/resource_names)
7845 // for the appropriate value for this field.
7846 func (r *ProjectsLocationsApisVersionsArtifactsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall {
7847 c := &ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7848 c.resource = resource
7849 c.setiampolicyrequest = setiampolicyrequest
7850 return c
7851 }
7852
7853 // Fields allows partial responses to be retrieved. See
7854 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7855 // details.
7856 func (c *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall {
7857 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7858 return c
7859 }
7860
7861 // Context sets the context to be used in this call's Do method.
7862 func (c *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall {
7863 c.ctx_ = ctx
7864 return c
7865 }
7866
7867 // Header returns a http.Header that can be modified by the caller to add
7868 // headers to the request.
7869 func (c *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall) Header() http.Header {
7870 if c.header_ == nil {
7871 c.header_ = make(http.Header)
7872 }
7873 return c.header_
7874 }
7875
7876 func (c *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
7877 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7878 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
7879 if err != nil {
7880 return nil, err
7881 }
7882 c.urlParams_.Set("alt", alt)
7883 c.urlParams_.Set("prettyPrint", "false")
7884 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
7885 urls += "?" + c.urlParams_.Encode()
7886 req, err := http.NewRequest("POST", urls, body)
7887 if err != nil {
7888 return nil, err
7889 }
7890 req.Header = reqHeaders
7891 googleapi.Expand(req.URL, map[string]string{
7892 "resource": c.resource,
7893 })
7894 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
7895 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7896 }
7897
7898 // Do executes the "apigeeregistry.projects.locations.apis.versions.artifacts.setIamPolicy" call.
7899 // Any non-2xx status code is an error. Response headers are in either
7900 // *Policy.ServerResponse.Header or (if a response was returned at all) in
7901 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7902 // whether the returned error was because http.StatusNotModified was returned.
7903 func (c *ProjectsLocationsApisVersionsArtifactsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
7904 gensupport.SetOptions(c.urlParams_, opts...)
7905 res, err := c.doRequest("json")
7906 if res != nil && res.StatusCode == http.StatusNotModified {
7907 if res.Body != nil {
7908 res.Body.Close()
7909 }
7910 return nil, gensupport.WrapError(&googleapi.Error{
7911 Code: res.StatusCode,
7912 Header: res.Header,
7913 })
7914 }
7915 if err != nil {
7916 return nil, err
7917 }
7918 defer googleapi.CloseBody(res)
7919 if err := googleapi.CheckResponse(res); err != nil {
7920 return nil, gensupport.WrapError(err)
7921 }
7922 ret := &Policy{
7923 ServerResponse: googleapi.ServerResponse{
7924 Header: res.Header,
7925 HTTPStatusCode: res.StatusCode,
7926 },
7927 }
7928 target := &ret
7929 b, err := gensupport.DecodeResponseBytes(target, res)
7930 if err != nil {
7931 return nil, err
7932 }
7933 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.setIamPolicy", "response", internallog.HTTPResponse(res, b))
7934 return ret, nil
7935 }
7936
7937 type ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall struct {
7938 s *Service
7939 resource string
7940 testiampermissionsrequest *TestIamPermissionsRequest
7941 urlParams_ gensupport.URLParams
7942 ctx_ context.Context
7943 header_ http.Header
7944 }
7945
7946 // TestIamPermissions: Returns permissions that a caller has on the specified
7947 // resource. If the resource does not exist, this will return an empty set of
7948 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
7949 // used for building permission-aware UIs and command-line tools, not for
7950 // authorization checking. This operation may "fail open" without warning.
7951 //
7952 // - resource: REQUIRED: The resource for which the policy detail is being
7953 // requested. See Resource names
7954 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
7955 // value for this field.
7956 func (r *ProjectsLocationsApisVersionsArtifactsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall {
7957 c := &ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7958 c.resource = resource
7959 c.testiampermissionsrequest = testiampermissionsrequest
7960 return c
7961 }
7962
7963 // Fields allows partial responses to be retrieved. See
7964 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7965 // details.
7966 func (c *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall {
7967 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7968 return c
7969 }
7970
7971 // Context sets the context to be used in this call's Do method.
7972 func (c *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall {
7973 c.ctx_ = ctx
7974 return c
7975 }
7976
7977 // Header returns a http.Header that can be modified by the caller to add
7978 // headers to the request.
7979 func (c *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall) Header() http.Header {
7980 if c.header_ == nil {
7981 c.header_ = make(http.Header)
7982 }
7983 return c.header_
7984 }
7985
7986 func (c *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
7987 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7988 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
7989 if err != nil {
7990 return nil, err
7991 }
7992 c.urlParams_.Set("alt", alt)
7993 c.urlParams_.Set("prettyPrint", "false")
7994 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
7995 urls += "?" + c.urlParams_.Encode()
7996 req, err := http.NewRequest("POST", urls, body)
7997 if err != nil {
7998 return nil, err
7999 }
8000 req.Header = reqHeaders
8001 googleapi.Expand(req.URL, map[string]string{
8002 "resource": c.resource,
8003 })
8004 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
8005 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8006 }
8007
8008 // Do executes the "apigeeregistry.projects.locations.apis.versions.artifacts.testIamPermissions" call.
8009 // Any non-2xx status code is an error. Response headers are in either
8010 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
8011 // returned at all) in error.(*googleapi.Error).Header. Use
8012 // googleapi.IsNotModified to check whether the returned error was because
8013 // http.StatusNotModified was returned.
8014 func (c *ProjectsLocationsApisVersionsArtifactsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
8015 gensupport.SetOptions(c.urlParams_, opts...)
8016 res, err := c.doRequest("json")
8017 if res != nil && res.StatusCode == http.StatusNotModified {
8018 if res.Body != nil {
8019 res.Body.Close()
8020 }
8021 return nil, gensupport.WrapError(&googleapi.Error{
8022 Code: res.StatusCode,
8023 Header: res.Header,
8024 })
8025 }
8026 if err != nil {
8027 return nil, err
8028 }
8029 defer googleapi.CloseBody(res)
8030 if err := googleapi.CheckResponse(res); err != nil {
8031 return nil, gensupport.WrapError(err)
8032 }
8033 ret := &TestIamPermissionsResponse{
8034 ServerResponse: googleapi.ServerResponse{
8035 Header: res.Header,
8036 HTTPStatusCode: res.StatusCode,
8037 },
8038 }
8039 target := &ret
8040 b, err := gensupport.DecodeResponseBytes(target, res)
8041 if err != nil {
8042 return nil, err
8043 }
8044 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.artifacts.testIamPermissions", "response", internallog.HTTPResponse(res, b))
8045 return ret, nil
8046 }
8047
8048 type ProjectsLocationsApisVersionsSpecsCreateCall struct {
8049 s *Service
8050 parent string
8051 apispec *ApiSpec
8052 urlParams_ gensupport.URLParams
8053 ctx_ context.Context
8054 header_ http.Header
8055 }
8056
8057 // Create: Creates a specified spec.
8058 //
8059 // - parent: The parent, which owns this collection of specs. Format:
8060 // `projects/*/locations/*/apis/*/versions/*`.
8061 func (r *ProjectsLocationsApisVersionsSpecsService) Create(parent string, apispec *ApiSpec) *ProjectsLocationsApisVersionsSpecsCreateCall {
8062 c := &ProjectsLocationsApisVersionsSpecsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8063 c.parent = parent
8064 c.apispec = apispec
8065 return c
8066 }
8067
8068 // ApiSpecId sets the optional parameter "apiSpecId": Required. The ID to use
8069 // for the spec, which will become the final component of the spec's resource
8070 // name. This value should be 4-63 characters, and valid characters are /a-z-/.
8071 // Following AIP-162, IDs must not have the form of a UUID.
8072 func (c *ProjectsLocationsApisVersionsSpecsCreateCall) ApiSpecId(apiSpecId string) *ProjectsLocationsApisVersionsSpecsCreateCall {
8073 c.urlParams_.Set("apiSpecId", apiSpecId)
8074 return c
8075 }
8076
8077 // Fields allows partial responses to be retrieved. See
8078 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8079 // details.
8080 func (c *ProjectsLocationsApisVersionsSpecsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsCreateCall {
8081 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8082 return c
8083 }
8084
8085 // Context sets the context to be used in this call's Do method.
8086 func (c *ProjectsLocationsApisVersionsSpecsCreateCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsCreateCall {
8087 c.ctx_ = ctx
8088 return c
8089 }
8090
8091 // Header returns a http.Header that can be modified by the caller to add
8092 // headers to the request.
8093 func (c *ProjectsLocationsApisVersionsSpecsCreateCall) Header() http.Header {
8094 if c.header_ == nil {
8095 c.header_ = make(http.Header)
8096 }
8097 return c.header_
8098 }
8099
8100 func (c *ProjectsLocationsApisVersionsSpecsCreateCall) doRequest(alt string) (*http.Response, error) {
8101 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8102 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apispec)
8103 if err != nil {
8104 return nil, err
8105 }
8106 c.urlParams_.Set("alt", alt)
8107 c.urlParams_.Set("prettyPrint", "false")
8108 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/specs")
8109 urls += "?" + c.urlParams_.Encode()
8110 req, err := http.NewRequest("POST", urls, body)
8111 if err != nil {
8112 return nil, err
8113 }
8114 req.Header = reqHeaders
8115 googleapi.Expand(req.URL, map[string]string{
8116 "parent": c.parent,
8117 })
8118 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.create", "request", internallog.HTTPRequest(req, body.Bytes()))
8119 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8120 }
8121
8122 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.create" call.
8123 // Any non-2xx status code is an error. Response headers are in either
8124 // *ApiSpec.ServerResponse.Header or (if a response was returned at all) in
8125 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8126 // whether the returned error was because http.StatusNotModified was returned.
8127 func (c *ProjectsLocationsApisVersionsSpecsCreateCall) Do(opts ...googleapi.CallOption) (*ApiSpec, error) {
8128 gensupport.SetOptions(c.urlParams_, opts...)
8129 res, err := c.doRequest("json")
8130 if res != nil && res.StatusCode == http.StatusNotModified {
8131 if res.Body != nil {
8132 res.Body.Close()
8133 }
8134 return nil, gensupport.WrapError(&googleapi.Error{
8135 Code: res.StatusCode,
8136 Header: res.Header,
8137 })
8138 }
8139 if err != nil {
8140 return nil, err
8141 }
8142 defer googleapi.CloseBody(res)
8143 if err := googleapi.CheckResponse(res); err != nil {
8144 return nil, gensupport.WrapError(err)
8145 }
8146 ret := &ApiSpec{
8147 ServerResponse: googleapi.ServerResponse{
8148 Header: res.Header,
8149 HTTPStatusCode: res.StatusCode,
8150 },
8151 }
8152 target := &ret
8153 b, err := gensupport.DecodeResponseBytes(target, res)
8154 if err != nil {
8155 return nil, err
8156 }
8157 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.create", "response", internallog.HTTPResponse(res, b))
8158 return ret, nil
8159 }
8160
8161 type ProjectsLocationsApisVersionsSpecsDeleteCall struct {
8162 s *Service
8163 name string
8164 urlParams_ gensupport.URLParams
8165 ctx_ context.Context
8166 header_ http.Header
8167 }
8168
8169 // Delete: Removes a specified spec, all revisions, and all child resources
8170 // (e.g., artifacts).
8171 //
8172 // - name: The name of the spec to delete. Format:
8173 // `projects/*/locations/*/apis/*/versions/*/specs/*`.
8174 func (r *ProjectsLocationsApisVersionsSpecsService) Delete(name string) *ProjectsLocationsApisVersionsSpecsDeleteCall {
8175 c := &ProjectsLocationsApisVersionsSpecsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8176 c.name = name
8177 return c
8178 }
8179
8180 // Force sets the optional parameter "force": If set to true, any child
8181 // resources will also be deleted. (Otherwise, the request will only work if
8182 // there are no child resources.)
8183 func (c *ProjectsLocationsApisVersionsSpecsDeleteCall) Force(force bool) *ProjectsLocationsApisVersionsSpecsDeleteCall {
8184 c.urlParams_.Set("force", fmt.Sprint(force))
8185 return c
8186 }
8187
8188 // Fields allows partial responses to be retrieved. See
8189 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8190 // details.
8191 func (c *ProjectsLocationsApisVersionsSpecsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsDeleteCall {
8192 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8193 return c
8194 }
8195
8196 // Context sets the context to be used in this call's Do method.
8197 func (c *ProjectsLocationsApisVersionsSpecsDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsDeleteCall {
8198 c.ctx_ = ctx
8199 return c
8200 }
8201
8202 // Header returns a http.Header that can be modified by the caller to add
8203 // headers to the request.
8204 func (c *ProjectsLocationsApisVersionsSpecsDeleteCall) Header() http.Header {
8205 if c.header_ == nil {
8206 c.header_ = make(http.Header)
8207 }
8208 return c.header_
8209 }
8210
8211 func (c *ProjectsLocationsApisVersionsSpecsDeleteCall) doRequest(alt string) (*http.Response, error) {
8212 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8213 c.urlParams_.Set("alt", alt)
8214 c.urlParams_.Set("prettyPrint", "false")
8215 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
8216 urls += "?" + c.urlParams_.Encode()
8217 req, err := http.NewRequest("DELETE", urls, nil)
8218 if err != nil {
8219 return nil, err
8220 }
8221 req.Header = reqHeaders
8222 googleapi.Expand(req.URL, map[string]string{
8223 "name": c.name,
8224 })
8225 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.delete", "request", internallog.HTTPRequest(req, nil))
8226 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8227 }
8228
8229 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.delete" call.
8230 // Any non-2xx status code is an error. Response headers are in either
8231 // *Empty.ServerResponse.Header or (if a response was returned at all) in
8232 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8233 // whether the returned error was because http.StatusNotModified was returned.
8234 func (c *ProjectsLocationsApisVersionsSpecsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
8235 gensupport.SetOptions(c.urlParams_, opts...)
8236 res, err := c.doRequest("json")
8237 if res != nil && res.StatusCode == http.StatusNotModified {
8238 if res.Body != nil {
8239 res.Body.Close()
8240 }
8241 return nil, gensupport.WrapError(&googleapi.Error{
8242 Code: res.StatusCode,
8243 Header: res.Header,
8244 })
8245 }
8246 if err != nil {
8247 return nil, err
8248 }
8249 defer googleapi.CloseBody(res)
8250 if err := googleapi.CheckResponse(res); err != nil {
8251 return nil, gensupport.WrapError(err)
8252 }
8253 ret := &Empty{
8254 ServerResponse: googleapi.ServerResponse{
8255 Header: res.Header,
8256 HTTPStatusCode: res.StatusCode,
8257 },
8258 }
8259 target := &ret
8260 b, err := gensupport.DecodeResponseBytes(target, res)
8261 if err != nil {
8262 return nil, err
8263 }
8264 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.delete", "response", internallog.HTTPResponse(res, b))
8265 return ret, nil
8266 }
8267
8268 type ProjectsLocationsApisVersionsSpecsDeleteRevisionCall struct {
8269 s *Service
8270 name string
8271 urlParams_ gensupport.URLParams
8272 ctx_ context.Context
8273 header_ http.Header
8274 }
8275
8276 // DeleteRevision: Deletes a revision of a spec.
8277 //
8278 // - name: The name of the spec revision to be deleted, with a revision ID
8279 // explicitly included. Example:
8280 // `projects/sample/locations/global/apis/petstore/versions/1.0.0/specs/openap
8281 // i.yaml@c7cfa2a8`.
8282 func (r *ProjectsLocationsApisVersionsSpecsService) DeleteRevision(name string) *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall {
8283 c := &ProjectsLocationsApisVersionsSpecsDeleteRevisionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8284 c.name = name
8285 return c
8286 }
8287
8288 // Fields allows partial responses to be retrieved. See
8289 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8290 // details.
8291 func (c *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall {
8292 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8293 return c
8294 }
8295
8296 // Context sets the context to be used in this call's Do method.
8297 func (c *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall {
8298 c.ctx_ = ctx
8299 return c
8300 }
8301
8302 // Header returns a http.Header that can be modified by the caller to add
8303 // headers to the request.
8304 func (c *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall) Header() http.Header {
8305 if c.header_ == nil {
8306 c.header_ = make(http.Header)
8307 }
8308 return c.header_
8309 }
8310
8311 func (c *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall) doRequest(alt string) (*http.Response, error) {
8312 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8313 c.urlParams_.Set("alt", alt)
8314 c.urlParams_.Set("prettyPrint", "false")
8315 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:deleteRevision")
8316 urls += "?" + c.urlParams_.Encode()
8317 req, err := http.NewRequest("DELETE", urls, nil)
8318 if err != nil {
8319 return nil, err
8320 }
8321 req.Header = reqHeaders
8322 googleapi.Expand(req.URL, map[string]string{
8323 "name": c.name,
8324 })
8325 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.deleteRevision", "request", internallog.HTTPRequest(req, nil))
8326 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8327 }
8328
8329 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.deleteRevision" call.
8330 // Any non-2xx status code is an error. Response headers are in either
8331 // *ApiSpec.ServerResponse.Header or (if a response was returned at all) in
8332 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8333 // whether the returned error was because http.StatusNotModified was returned.
8334 func (c *ProjectsLocationsApisVersionsSpecsDeleteRevisionCall) Do(opts ...googleapi.CallOption) (*ApiSpec, error) {
8335 gensupport.SetOptions(c.urlParams_, opts...)
8336 res, err := c.doRequest("json")
8337 if res != nil && res.StatusCode == http.StatusNotModified {
8338 if res.Body != nil {
8339 res.Body.Close()
8340 }
8341 return nil, gensupport.WrapError(&googleapi.Error{
8342 Code: res.StatusCode,
8343 Header: res.Header,
8344 })
8345 }
8346 if err != nil {
8347 return nil, err
8348 }
8349 defer googleapi.CloseBody(res)
8350 if err := googleapi.CheckResponse(res); err != nil {
8351 return nil, gensupport.WrapError(err)
8352 }
8353 ret := &ApiSpec{
8354 ServerResponse: googleapi.ServerResponse{
8355 Header: res.Header,
8356 HTTPStatusCode: res.StatusCode,
8357 },
8358 }
8359 target := &ret
8360 b, err := gensupport.DecodeResponseBytes(target, res)
8361 if err != nil {
8362 return nil, err
8363 }
8364 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.deleteRevision", "response", internallog.HTTPResponse(res, b))
8365 return ret, nil
8366 }
8367
8368 type ProjectsLocationsApisVersionsSpecsGetCall struct {
8369 s *Service
8370 name string
8371 urlParams_ gensupport.URLParams
8372 ifNoneMatch_ string
8373 ctx_ context.Context
8374 header_ http.Header
8375 }
8376
8377 // Get: Returns a specified spec.
8378 //
8379 // - name: The name of the spec to retrieve. Format:
8380 // `projects/*/locations/*/apis/*/versions/*/specs/*`.
8381 func (r *ProjectsLocationsApisVersionsSpecsService) Get(name string) *ProjectsLocationsApisVersionsSpecsGetCall {
8382 c := &ProjectsLocationsApisVersionsSpecsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8383 c.name = name
8384 return c
8385 }
8386
8387 // Fields allows partial responses to be retrieved. See
8388 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8389 // details.
8390 func (c *ProjectsLocationsApisVersionsSpecsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsGetCall {
8391 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8392 return c
8393 }
8394
8395 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8396 // object's ETag matches the given value. This is useful for getting updates
8397 // only after the object has changed since the last request.
8398 func (c *ProjectsLocationsApisVersionsSpecsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsGetCall {
8399 c.ifNoneMatch_ = entityTag
8400 return c
8401 }
8402
8403 // Context sets the context to be used in this call's Do method.
8404 func (c *ProjectsLocationsApisVersionsSpecsGetCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsGetCall {
8405 c.ctx_ = ctx
8406 return c
8407 }
8408
8409 // Header returns a http.Header that can be modified by the caller to add
8410 // headers to the request.
8411 func (c *ProjectsLocationsApisVersionsSpecsGetCall) Header() http.Header {
8412 if c.header_ == nil {
8413 c.header_ = make(http.Header)
8414 }
8415 return c.header_
8416 }
8417
8418 func (c *ProjectsLocationsApisVersionsSpecsGetCall) doRequest(alt string) (*http.Response, error) {
8419 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8420 if c.ifNoneMatch_ != "" {
8421 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8422 }
8423 c.urlParams_.Set("alt", alt)
8424 c.urlParams_.Set("prettyPrint", "false")
8425 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
8426 urls += "?" + c.urlParams_.Encode()
8427 req, err := http.NewRequest("GET", urls, nil)
8428 if err != nil {
8429 return nil, err
8430 }
8431 req.Header = reqHeaders
8432 googleapi.Expand(req.URL, map[string]string{
8433 "name": c.name,
8434 })
8435 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.get", "request", internallog.HTTPRequest(req, nil))
8436 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8437 }
8438
8439 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.get" call.
8440 // Any non-2xx status code is an error. Response headers are in either
8441 // *ApiSpec.ServerResponse.Header or (if a response was returned at all) in
8442 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8443 // whether the returned error was because http.StatusNotModified was returned.
8444 func (c *ProjectsLocationsApisVersionsSpecsGetCall) Do(opts ...googleapi.CallOption) (*ApiSpec, error) {
8445 gensupport.SetOptions(c.urlParams_, opts...)
8446 res, err := c.doRequest("json")
8447 if res != nil && res.StatusCode == http.StatusNotModified {
8448 if res.Body != nil {
8449 res.Body.Close()
8450 }
8451 return nil, gensupport.WrapError(&googleapi.Error{
8452 Code: res.StatusCode,
8453 Header: res.Header,
8454 })
8455 }
8456 if err != nil {
8457 return nil, err
8458 }
8459 defer googleapi.CloseBody(res)
8460 if err := googleapi.CheckResponse(res); err != nil {
8461 return nil, gensupport.WrapError(err)
8462 }
8463 ret := &ApiSpec{
8464 ServerResponse: googleapi.ServerResponse{
8465 Header: res.Header,
8466 HTTPStatusCode: res.StatusCode,
8467 },
8468 }
8469 target := &ret
8470 b, err := gensupport.DecodeResponseBytes(target, res)
8471 if err != nil {
8472 return nil, err
8473 }
8474 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.get", "response", internallog.HTTPResponse(res, b))
8475 return ret, nil
8476 }
8477
8478 type ProjectsLocationsApisVersionsSpecsGetContentsCall struct {
8479 s *Service
8480 name string
8481 urlParams_ gensupport.URLParams
8482 ifNoneMatch_ string
8483 ctx_ context.Context
8484 header_ http.Header
8485 }
8486
8487 // GetContents: Returns the contents of a specified spec. If specs are stored
8488 // with GZip compression, the default behavior is to return the spec
8489 // uncompressed (the mime_type response field indicates the exact format
8490 // returned).
8491 //
8492 // - name: The name of the spec whose contents should be retrieved. Format:
8493 // `projects/*/locations/*/apis/*/versions/*/specs/*`.
8494 func (r *ProjectsLocationsApisVersionsSpecsService) GetContents(name string) *ProjectsLocationsApisVersionsSpecsGetContentsCall {
8495 c := &ProjectsLocationsApisVersionsSpecsGetContentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8496 c.name = name
8497 return c
8498 }
8499
8500 // Fields allows partial responses to be retrieved. See
8501 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8502 // details.
8503 func (c *ProjectsLocationsApisVersionsSpecsGetContentsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsGetContentsCall {
8504 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8505 return c
8506 }
8507
8508 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8509 // object's ETag matches the given value. This is useful for getting updates
8510 // only after the object has changed since the last request.
8511 func (c *ProjectsLocationsApisVersionsSpecsGetContentsCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsGetContentsCall {
8512 c.ifNoneMatch_ = entityTag
8513 return c
8514 }
8515
8516 // Context sets the context to be used in this call's Do method.
8517 func (c *ProjectsLocationsApisVersionsSpecsGetContentsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsGetContentsCall {
8518 c.ctx_ = ctx
8519 return c
8520 }
8521
8522 // Header returns a http.Header that can be modified by the caller to add
8523 // headers to the request.
8524 func (c *ProjectsLocationsApisVersionsSpecsGetContentsCall) Header() http.Header {
8525 if c.header_ == nil {
8526 c.header_ = make(http.Header)
8527 }
8528 return c.header_
8529 }
8530
8531 func (c *ProjectsLocationsApisVersionsSpecsGetContentsCall) doRequest(alt string) (*http.Response, error) {
8532 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8533 if c.ifNoneMatch_ != "" {
8534 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8535 }
8536 c.urlParams_.Set("alt", alt)
8537 c.urlParams_.Set("prettyPrint", "false")
8538 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents")
8539 urls += "?" + c.urlParams_.Encode()
8540 req, err := http.NewRequest("GET", urls, nil)
8541 if err != nil {
8542 return nil, err
8543 }
8544 req.Header = reqHeaders
8545 googleapi.Expand(req.URL, map[string]string{
8546 "name": c.name,
8547 })
8548 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.getContents", "request", internallog.HTTPRequest(req, nil))
8549 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8550 }
8551
8552 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.getContents" call.
8553 // Any non-2xx status code is an error. Response headers are in either
8554 // *HttpBody.ServerResponse.Header or (if a response was returned at all) in
8555 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8556 // whether the returned error was because http.StatusNotModified was returned.
8557 func (c *ProjectsLocationsApisVersionsSpecsGetContentsCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
8558 gensupport.SetOptions(c.urlParams_, opts...)
8559 res, err := c.doRequest("json")
8560 if res != nil && res.StatusCode == http.StatusNotModified {
8561 if res.Body != nil {
8562 res.Body.Close()
8563 }
8564 return nil, gensupport.WrapError(&googleapi.Error{
8565 Code: res.StatusCode,
8566 Header: res.Header,
8567 })
8568 }
8569 if err != nil {
8570 return nil, err
8571 }
8572 defer googleapi.CloseBody(res)
8573 if err := googleapi.CheckResponse(res); err != nil {
8574 return nil, gensupport.WrapError(err)
8575 }
8576 ret := &HttpBody{
8577 ServerResponse: googleapi.ServerResponse{
8578 Header: res.Header,
8579 HTTPStatusCode: res.StatusCode,
8580 },
8581 }
8582 target := &ret
8583 b, err := gensupport.DecodeResponseBytes(target, res)
8584 if err != nil {
8585 return nil, err
8586 }
8587 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.getContents", "response", internallog.HTTPResponse(res, b))
8588 return ret, nil
8589 }
8590
8591 type ProjectsLocationsApisVersionsSpecsGetIamPolicyCall struct {
8592 s *Service
8593 resource string
8594 urlParams_ gensupport.URLParams
8595 ifNoneMatch_ string
8596 ctx_ context.Context
8597 header_ http.Header
8598 }
8599
8600 // GetIamPolicy: Gets the access control policy for a resource. Returns an
8601 // empty policy if the resource exists and does not have a policy set.
8602 //
8603 // - resource: REQUIRED: The resource for which the policy is being requested.
8604 // See Resource names (https://cloud.google.com/apis/design/resource_names)
8605 // for the appropriate value for this field.
8606 func (r *ProjectsLocationsApisVersionsSpecsService) GetIamPolicy(resource string) *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall {
8607 c := &ProjectsLocationsApisVersionsSpecsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8608 c.resource = resource
8609 return c
8610 }
8611
8612 // OptionsRequestedPolicyVersion sets the optional parameter
8613 // "options.requestedPolicyVersion": The maximum policy version that will be
8614 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
8615 // an invalid value will be rejected. Requests for policies with any
8616 // conditional role bindings must specify version 3. Policies with no
8617 // conditional role bindings may specify any valid value or leave the field
8618 // unset. The policy in the response might use the policy version that you
8619 // specified, or it might use a lower policy version. For example, if you
8620 // specify version 3, but the policy has no conditional role bindings, the
8621 // response uses version 1. To learn which resources support conditions in
8622 // their IAM policies, see the IAM documentation
8623 // (https://cloud.google.com/iam/help/conditions/resource-policies).
8624 func (c *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall {
8625 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
8626 return c
8627 }
8628
8629 // Fields allows partial responses to be retrieved. See
8630 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8631 // details.
8632 func (c *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall {
8633 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8634 return c
8635 }
8636
8637 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8638 // object's ETag matches the given value. This is useful for getting updates
8639 // only after the object has changed since the last request.
8640 func (c *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall {
8641 c.ifNoneMatch_ = entityTag
8642 return c
8643 }
8644
8645 // Context sets the context to be used in this call's Do method.
8646 func (c *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall {
8647 c.ctx_ = ctx
8648 return c
8649 }
8650
8651 // Header returns a http.Header that can be modified by the caller to add
8652 // headers to the request.
8653 func (c *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall) Header() http.Header {
8654 if c.header_ == nil {
8655 c.header_ = make(http.Header)
8656 }
8657 return c.header_
8658 }
8659
8660 func (c *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
8661 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8662 if c.ifNoneMatch_ != "" {
8663 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8664 }
8665 c.urlParams_.Set("alt", alt)
8666 c.urlParams_.Set("prettyPrint", "false")
8667 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
8668 urls += "?" + c.urlParams_.Encode()
8669 req, err := http.NewRequest("GET", urls, nil)
8670 if err != nil {
8671 return nil, err
8672 }
8673 req.Header = reqHeaders
8674 googleapi.Expand(req.URL, map[string]string{
8675 "resource": c.resource,
8676 })
8677 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
8678 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8679 }
8680
8681 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.getIamPolicy" call.
8682 // Any non-2xx status code is an error. Response headers are in either
8683 // *Policy.ServerResponse.Header or (if a response was returned at all) in
8684 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8685 // whether the returned error was because http.StatusNotModified was returned.
8686 func (c *ProjectsLocationsApisVersionsSpecsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
8687 gensupport.SetOptions(c.urlParams_, opts...)
8688 res, err := c.doRequest("json")
8689 if res != nil && res.StatusCode == http.StatusNotModified {
8690 if res.Body != nil {
8691 res.Body.Close()
8692 }
8693 return nil, gensupport.WrapError(&googleapi.Error{
8694 Code: res.StatusCode,
8695 Header: res.Header,
8696 })
8697 }
8698 if err != nil {
8699 return nil, err
8700 }
8701 defer googleapi.CloseBody(res)
8702 if err := googleapi.CheckResponse(res); err != nil {
8703 return nil, gensupport.WrapError(err)
8704 }
8705 ret := &Policy{
8706 ServerResponse: googleapi.ServerResponse{
8707 Header: res.Header,
8708 HTTPStatusCode: res.StatusCode,
8709 },
8710 }
8711 target := &ret
8712 b, err := gensupport.DecodeResponseBytes(target, res)
8713 if err != nil {
8714 return nil, err
8715 }
8716 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.getIamPolicy", "response", internallog.HTTPResponse(res, b))
8717 return ret, nil
8718 }
8719
8720 type ProjectsLocationsApisVersionsSpecsListCall struct {
8721 s *Service
8722 parent string
8723 urlParams_ gensupport.URLParams
8724 ifNoneMatch_ string
8725 ctx_ context.Context
8726 header_ http.Header
8727 }
8728
8729 // List: Returns matching specs.
8730 //
8731 // - parent: The parent, which owns this collection of specs. Format:
8732 // `projects/*/locations/*/apis/*/versions/*`.
8733 func (r *ProjectsLocationsApisVersionsSpecsService) List(parent string) *ProjectsLocationsApisVersionsSpecsListCall {
8734 c := &ProjectsLocationsApisVersionsSpecsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8735 c.parent = parent
8736 return c
8737 }
8738
8739 // Filter sets the optional parameter "filter": An expression that can be used
8740 // to filter the list. Filters use the Common Expression Language and can refer
8741 // to all message fields except contents.
8742 func (c *ProjectsLocationsApisVersionsSpecsListCall) Filter(filter string) *ProjectsLocationsApisVersionsSpecsListCall {
8743 c.urlParams_.Set("filter", filter)
8744 return c
8745 }
8746
8747 // OrderBy sets the optional parameter "orderBy": A comma-separated list of
8748 // fields, e.g. "foo,bar" Fields can be sorted in descending order using the
8749 // "desc" identifier, e.g. "foo desc,bar"
8750 func (c *ProjectsLocationsApisVersionsSpecsListCall) OrderBy(orderBy string) *ProjectsLocationsApisVersionsSpecsListCall {
8751 c.urlParams_.Set("orderBy", orderBy)
8752 return c
8753 }
8754
8755 // PageSize sets the optional parameter "pageSize": The maximum number of specs
8756 // to return. The service may return fewer than this value. If unspecified, at
8757 // most 50 values will be returned. The maximum is 1000; values above 1000 will
8758 // be coerced to 1000.
8759 func (c *ProjectsLocationsApisVersionsSpecsListCall) PageSize(pageSize int64) *ProjectsLocationsApisVersionsSpecsListCall {
8760 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8761 return c
8762 }
8763
8764 // PageToken sets the optional parameter "pageToken": A page token, received
8765 // from a previous `ListApiSpecs` call. Provide this to retrieve the subsequent
8766 // page. When paginating, all other parameters provided to `ListApiSpecs` must
8767 // match the call that provided the page token.
8768 func (c *ProjectsLocationsApisVersionsSpecsListCall) PageToken(pageToken string) *ProjectsLocationsApisVersionsSpecsListCall {
8769 c.urlParams_.Set("pageToken", pageToken)
8770 return c
8771 }
8772
8773 // Fields allows partial responses to be retrieved. See
8774 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8775 // details.
8776 func (c *ProjectsLocationsApisVersionsSpecsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsListCall {
8777 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8778 return c
8779 }
8780
8781 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8782 // object's ETag matches the given value. This is useful for getting updates
8783 // only after the object has changed since the last request.
8784 func (c *ProjectsLocationsApisVersionsSpecsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsListCall {
8785 c.ifNoneMatch_ = entityTag
8786 return c
8787 }
8788
8789 // Context sets the context to be used in this call's Do method.
8790 func (c *ProjectsLocationsApisVersionsSpecsListCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsListCall {
8791 c.ctx_ = ctx
8792 return c
8793 }
8794
8795 // Header returns a http.Header that can be modified by the caller to add
8796 // headers to the request.
8797 func (c *ProjectsLocationsApisVersionsSpecsListCall) Header() http.Header {
8798 if c.header_ == nil {
8799 c.header_ = make(http.Header)
8800 }
8801 return c.header_
8802 }
8803
8804 func (c *ProjectsLocationsApisVersionsSpecsListCall) doRequest(alt string) (*http.Response, error) {
8805 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8806 if c.ifNoneMatch_ != "" {
8807 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8808 }
8809 c.urlParams_.Set("alt", alt)
8810 c.urlParams_.Set("prettyPrint", "false")
8811 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/specs")
8812 urls += "?" + c.urlParams_.Encode()
8813 req, err := http.NewRequest("GET", urls, nil)
8814 if err != nil {
8815 return nil, err
8816 }
8817 req.Header = reqHeaders
8818 googleapi.Expand(req.URL, map[string]string{
8819 "parent": c.parent,
8820 })
8821 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.list", "request", internallog.HTTPRequest(req, nil))
8822 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8823 }
8824
8825 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.list" call.
8826 // Any non-2xx status code is an error. Response headers are in either
8827 // *ListApiSpecsResponse.ServerResponse.Header or (if a response was returned
8828 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8829 // check whether the returned error was because http.StatusNotModified was
8830 // returned.
8831 func (c *ProjectsLocationsApisVersionsSpecsListCall) Do(opts ...googleapi.CallOption) (*ListApiSpecsResponse, error) {
8832 gensupport.SetOptions(c.urlParams_, opts...)
8833 res, err := c.doRequest("json")
8834 if res != nil && res.StatusCode == http.StatusNotModified {
8835 if res.Body != nil {
8836 res.Body.Close()
8837 }
8838 return nil, gensupport.WrapError(&googleapi.Error{
8839 Code: res.StatusCode,
8840 Header: res.Header,
8841 })
8842 }
8843 if err != nil {
8844 return nil, err
8845 }
8846 defer googleapi.CloseBody(res)
8847 if err := googleapi.CheckResponse(res); err != nil {
8848 return nil, gensupport.WrapError(err)
8849 }
8850 ret := &ListApiSpecsResponse{
8851 ServerResponse: googleapi.ServerResponse{
8852 Header: res.Header,
8853 HTTPStatusCode: res.StatusCode,
8854 },
8855 }
8856 target := &ret
8857 b, err := gensupport.DecodeResponseBytes(target, res)
8858 if err != nil {
8859 return nil, err
8860 }
8861 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.list", "response", internallog.HTTPResponse(res, b))
8862 return ret, nil
8863 }
8864
8865 // Pages invokes f for each page of results.
8866 // A non-nil error returned from f will halt the iteration.
8867 // The provided context supersedes any context provided to the Context method.
8868 func (c *ProjectsLocationsApisVersionsSpecsListCall) Pages(ctx context.Context, f func(*ListApiSpecsResponse) error) error {
8869 c.ctx_ = ctx
8870 defer c.PageToken(c.urlParams_.Get("pageToken"))
8871 for {
8872 x, err := c.Do()
8873 if err != nil {
8874 return err
8875 }
8876 if err := f(x); err != nil {
8877 return err
8878 }
8879 if x.NextPageToken == "" {
8880 return nil
8881 }
8882 c.PageToken(x.NextPageToken)
8883 }
8884 }
8885
8886 type ProjectsLocationsApisVersionsSpecsListRevisionsCall struct {
8887 s *Service
8888 name string
8889 urlParams_ gensupport.URLParams
8890 ifNoneMatch_ string
8891 ctx_ context.Context
8892 header_ http.Header
8893 }
8894
8895 // ListRevisions: Lists all revisions of a spec. Revisions are returned in
8896 // descending order of revision creation time.
8897 //
8898 // - name: The name of the spec to list revisions for.
8899 func (r *ProjectsLocationsApisVersionsSpecsService) ListRevisions(name string) *ProjectsLocationsApisVersionsSpecsListRevisionsCall {
8900 c := &ProjectsLocationsApisVersionsSpecsListRevisionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8901 c.name = name
8902 return c
8903 }
8904
8905 // Filter sets the optional parameter "filter": An expression that can be used
8906 // to filter the list. Filters use the Common Expression Language and can refer
8907 // to all message fields.
8908 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) Filter(filter string) *ProjectsLocationsApisVersionsSpecsListRevisionsCall {
8909 c.urlParams_.Set("filter", filter)
8910 return c
8911 }
8912
8913 // PageSize sets the optional parameter "pageSize": The maximum number of
8914 // revisions to return per page.
8915 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) PageSize(pageSize int64) *ProjectsLocationsApisVersionsSpecsListRevisionsCall {
8916 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8917 return c
8918 }
8919
8920 // PageToken sets the optional parameter "pageToken": The page token, received
8921 // from a previous ListApiSpecRevisions call. Provide this to retrieve the
8922 // subsequent page.
8923 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) PageToken(pageToken string) *ProjectsLocationsApisVersionsSpecsListRevisionsCall {
8924 c.urlParams_.Set("pageToken", pageToken)
8925 return c
8926 }
8927
8928 // Fields allows partial responses to be retrieved. See
8929 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8930 // details.
8931 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsListRevisionsCall {
8932 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8933 return c
8934 }
8935
8936 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8937 // object's ETag matches the given value. This is useful for getting updates
8938 // only after the object has changed since the last request.
8939 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsListRevisionsCall {
8940 c.ifNoneMatch_ = entityTag
8941 return c
8942 }
8943
8944 // Context sets the context to be used in this call's Do method.
8945 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsListRevisionsCall {
8946 c.ctx_ = ctx
8947 return c
8948 }
8949
8950 // Header returns a http.Header that can be modified by the caller to add
8951 // headers to the request.
8952 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) Header() http.Header {
8953 if c.header_ == nil {
8954 c.header_ = make(http.Header)
8955 }
8956 return c.header_
8957 }
8958
8959 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) doRequest(alt string) (*http.Response, error) {
8960 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8961 if c.ifNoneMatch_ != "" {
8962 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8963 }
8964 c.urlParams_.Set("alt", alt)
8965 c.urlParams_.Set("prettyPrint", "false")
8966 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:listRevisions")
8967 urls += "?" + c.urlParams_.Encode()
8968 req, err := http.NewRequest("GET", urls, nil)
8969 if err != nil {
8970 return nil, err
8971 }
8972 req.Header = reqHeaders
8973 googleapi.Expand(req.URL, map[string]string{
8974 "name": c.name,
8975 })
8976 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.listRevisions", "request", internallog.HTTPRequest(req, nil))
8977 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8978 }
8979
8980 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.listRevisions" call.
8981 // Any non-2xx status code is an error. Response headers are in either
8982 // *ListApiSpecRevisionsResponse.ServerResponse.Header or (if a response was
8983 // returned at all) in error.(*googleapi.Error).Header. Use
8984 // googleapi.IsNotModified to check whether the returned error was because
8985 // http.StatusNotModified was returned.
8986 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) Do(opts ...googleapi.CallOption) (*ListApiSpecRevisionsResponse, error) {
8987 gensupport.SetOptions(c.urlParams_, opts...)
8988 res, err := c.doRequest("json")
8989 if res != nil && res.StatusCode == http.StatusNotModified {
8990 if res.Body != nil {
8991 res.Body.Close()
8992 }
8993 return nil, gensupport.WrapError(&googleapi.Error{
8994 Code: res.StatusCode,
8995 Header: res.Header,
8996 })
8997 }
8998 if err != nil {
8999 return nil, err
9000 }
9001 defer googleapi.CloseBody(res)
9002 if err := googleapi.CheckResponse(res); err != nil {
9003 return nil, gensupport.WrapError(err)
9004 }
9005 ret := &ListApiSpecRevisionsResponse{
9006 ServerResponse: googleapi.ServerResponse{
9007 Header: res.Header,
9008 HTTPStatusCode: res.StatusCode,
9009 },
9010 }
9011 target := &ret
9012 b, err := gensupport.DecodeResponseBytes(target, res)
9013 if err != nil {
9014 return nil, err
9015 }
9016 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.listRevisions", "response", internallog.HTTPResponse(res, b))
9017 return ret, nil
9018 }
9019
9020 // Pages invokes f for each page of results.
9021 // A non-nil error returned from f will halt the iteration.
9022 // The provided context supersedes any context provided to the Context method.
9023 func (c *ProjectsLocationsApisVersionsSpecsListRevisionsCall) Pages(ctx context.Context, f func(*ListApiSpecRevisionsResponse) error) error {
9024 c.ctx_ = ctx
9025 defer c.PageToken(c.urlParams_.Get("pageToken"))
9026 for {
9027 x, err := c.Do()
9028 if err != nil {
9029 return err
9030 }
9031 if err := f(x); err != nil {
9032 return err
9033 }
9034 if x.NextPageToken == "" {
9035 return nil
9036 }
9037 c.PageToken(x.NextPageToken)
9038 }
9039 }
9040
9041 type ProjectsLocationsApisVersionsSpecsPatchCall struct {
9042 s *Service
9043 name string
9044 apispec *ApiSpec
9045 urlParams_ gensupport.URLParams
9046 ctx_ context.Context
9047 header_ http.Header
9048 }
9049
9050 // Patch: Used to modify a specified spec.
9051 //
9052 // - name: Resource name.
9053 func (r *ProjectsLocationsApisVersionsSpecsService) Patch(name string, apispec *ApiSpec) *ProjectsLocationsApisVersionsSpecsPatchCall {
9054 c := &ProjectsLocationsApisVersionsSpecsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9055 c.name = name
9056 c.apispec = apispec
9057 return c
9058 }
9059
9060 // AllowMissing sets the optional parameter "allowMissing": If set to true, and
9061 // the spec is not found, a new spec will be created. In this situation,
9062 // `update_mask` is ignored.
9063 func (c *ProjectsLocationsApisVersionsSpecsPatchCall) AllowMissing(allowMissing bool) *ProjectsLocationsApisVersionsSpecsPatchCall {
9064 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing))
9065 return c
9066 }
9067
9068 // UpdateMask sets the optional parameter "updateMask": The list of fields to
9069 // be updated. If omitted, all fields are updated that are set in the request
9070 // message (fields set to default values are ignored). If an asterisk "*" is
9071 // specified, all fields are updated, including fields that are
9072 // unspecified/default in the request.
9073 func (c *ProjectsLocationsApisVersionsSpecsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsApisVersionsSpecsPatchCall {
9074 c.urlParams_.Set("updateMask", updateMask)
9075 return c
9076 }
9077
9078 // Fields allows partial responses to be retrieved. See
9079 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9080 // details.
9081 func (c *ProjectsLocationsApisVersionsSpecsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsPatchCall {
9082 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9083 return c
9084 }
9085
9086 // Context sets the context to be used in this call's Do method.
9087 func (c *ProjectsLocationsApisVersionsSpecsPatchCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsPatchCall {
9088 c.ctx_ = ctx
9089 return c
9090 }
9091
9092 // Header returns a http.Header that can be modified by the caller to add
9093 // headers to the request.
9094 func (c *ProjectsLocationsApisVersionsSpecsPatchCall) Header() http.Header {
9095 if c.header_ == nil {
9096 c.header_ = make(http.Header)
9097 }
9098 return c.header_
9099 }
9100
9101 func (c *ProjectsLocationsApisVersionsSpecsPatchCall) doRequest(alt string) (*http.Response, error) {
9102 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9103 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.apispec)
9104 if err != nil {
9105 return nil, err
9106 }
9107 c.urlParams_.Set("alt", alt)
9108 c.urlParams_.Set("prettyPrint", "false")
9109 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
9110 urls += "?" + c.urlParams_.Encode()
9111 req, err := http.NewRequest("PATCH", urls, body)
9112 if err != nil {
9113 return nil, err
9114 }
9115 req.Header = reqHeaders
9116 googleapi.Expand(req.URL, map[string]string{
9117 "name": c.name,
9118 })
9119 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
9120 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9121 }
9122
9123 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.patch" call.
9124 // Any non-2xx status code is an error. Response headers are in either
9125 // *ApiSpec.ServerResponse.Header or (if a response was returned at all) in
9126 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9127 // whether the returned error was because http.StatusNotModified was returned.
9128 func (c *ProjectsLocationsApisVersionsSpecsPatchCall) Do(opts ...googleapi.CallOption) (*ApiSpec, error) {
9129 gensupport.SetOptions(c.urlParams_, opts...)
9130 res, err := c.doRequest("json")
9131 if res != nil && res.StatusCode == http.StatusNotModified {
9132 if res.Body != nil {
9133 res.Body.Close()
9134 }
9135 return nil, gensupport.WrapError(&googleapi.Error{
9136 Code: res.StatusCode,
9137 Header: res.Header,
9138 })
9139 }
9140 if err != nil {
9141 return nil, err
9142 }
9143 defer googleapi.CloseBody(res)
9144 if err := googleapi.CheckResponse(res); err != nil {
9145 return nil, gensupport.WrapError(err)
9146 }
9147 ret := &ApiSpec{
9148 ServerResponse: googleapi.ServerResponse{
9149 Header: res.Header,
9150 HTTPStatusCode: res.StatusCode,
9151 },
9152 }
9153 target := &ret
9154 b, err := gensupport.DecodeResponseBytes(target, res)
9155 if err != nil {
9156 return nil, err
9157 }
9158 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.patch", "response", internallog.HTTPResponse(res, b))
9159 return ret, nil
9160 }
9161
9162 type ProjectsLocationsApisVersionsSpecsRollbackCall struct {
9163 s *Service
9164 name string
9165 rollbackapispecrequest *RollbackApiSpecRequest
9166 urlParams_ gensupport.URLParams
9167 ctx_ context.Context
9168 header_ http.Header
9169 }
9170
9171 // Rollback: Sets the current revision to a specified prior revision. Note that
9172 // this creates a new revision with a new revision ID.
9173 //
9174 // - name: The spec being rolled back.
9175 func (r *ProjectsLocationsApisVersionsSpecsService) Rollback(name string, rollbackapispecrequest *RollbackApiSpecRequest) *ProjectsLocationsApisVersionsSpecsRollbackCall {
9176 c := &ProjectsLocationsApisVersionsSpecsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9177 c.name = name
9178 c.rollbackapispecrequest = rollbackapispecrequest
9179 return c
9180 }
9181
9182 // Fields allows partial responses to be retrieved. See
9183 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9184 // details.
9185 func (c *ProjectsLocationsApisVersionsSpecsRollbackCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsRollbackCall {
9186 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9187 return c
9188 }
9189
9190 // Context sets the context to be used in this call's Do method.
9191 func (c *ProjectsLocationsApisVersionsSpecsRollbackCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsRollbackCall {
9192 c.ctx_ = ctx
9193 return c
9194 }
9195
9196 // Header returns a http.Header that can be modified by the caller to add
9197 // headers to the request.
9198 func (c *ProjectsLocationsApisVersionsSpecsRollbackCall) Header() http.Header {
9199 if c.header_ == nil {
9200 c.header_ = make(http.Header)
9201 }
9202 return c.header_
9203 }
9204
9205 func (c *ProjectsLocationsApisVersionsSpecsRollbackCall) doRequest(alt string) (*http.Response, error) {
9206 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9207 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollbackapispecrequest)
9208 if err != nil {
9209 return nil, err
9210 }
9211 c.urlParams_.Set("alt", alt)
9212 c.urlParams_.Set("prettyPrint", "false")
9213 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:rollback")
9214 urls += "?" + c.urlParams_.Encode()
9215 req, err := http.NewRequest("POST", urls, body)
9216 if err != nil {
9217 return nil, err
9218 }
9219 req.Header = reqHeaders
9220 googleapi.Expand(req.URL, map[string]string{
9221 "name": c.name,
9222 })
9223 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.rollback", "request", internallog.HTTPRequest(req, body.Bytes()))
9224 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9225 }
9226
9227 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.rollback" call.
9228 // Any non-2xx status code is an error. Response headers are in either
9229 // *ApiSpec.ServerResponse.Header or (if a response was returned at all) in
9230 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9231 // whether the returned error was because http.StatusNotModified was returned.
9232 func (c *ProjectsLocationsApisVersionsSpecsRollbackCall) Do(opts ...googleapi.CallOption) (*ApiSpec, error) {
9233 gensupport.SetOptions(c.urlParams_, opts...)
9234 res, err := c.doRequest("json")
9235 if res != nil && res.StatusCode == http.StatusNotModified {
9236 if res.Body != nil {
9237 res.Body.Close()
9238 }
9239 return nil, gensupport.WrapError(&googleapi.Error{
9240 Code: res.StatusCode,
9241 Header: res.Header,
9242 })
9243 }
9244 if err != nil {
9245 return nil, err
9246 }
9247 defer googleapi.CloseBody(res)
9248 if err := googleapi.CheckResponse(res); err != nil {
9249 return nil, gensupport.WrapError(err)
9250 }
9251 ret := &ApiSpec{
9252 ServerResponse: googleapi.ServerResponse{
9253 Header: res.Header,
9254 HTTPStatusCode: res.StatusCode,
9255 },
9256 }
9257 target := &ret
9258 b, err := gensupport.DecodeResponseBytes(target, res)
9259 if err != nil {
9260 return nil, err
9261 }
9262 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.rollback", "response", internallog.HTTPResponse(res, b))
9263 return ret, nil
9264 }
9265
9266 type ProjectsLocationsApisVersionsSpecsSetIamPolicyCall struct {
9267 s *Service
9268 resource string
9269 setiampolicyrequest *SetIamPolicyRequest
9270 urlParams_ gensupport.URLParams
9271 ctx_ context.Context
9272 header_ http.Header
9273 }
9274
9275 // SetIamPolicy: Sets the access control policy on the specified resource.
9276 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
9277 // and `PERMISSION_DENIED` errors.
9278 //
9279 // - resource: REQUIRED: The resource for which the policy is being specified.
9280 // See Resource names (https://cloud.google.com/apis/design/resource_names)
9281 // for the appropriate value for this field.
9282 func (r *ProjectsLocationsApisVersionsSpecsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall {
9283 c := &ProjectsLocationsApisVersionsSpecsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9284 c.resource = resource
9285 c.setiampolicyrequest = setiampolicyrequest
9286 return c
9287 }
9288
9289 // Fields allows partial responses to be retrieved. See
9290 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9291 // details.
9292 func (c *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall {
9293 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9294 return c
9295 }
9296
9297 // Context sets the context to be used in this call's Do method.
9298 func (c *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall {
9299 c.ctx_ = ctx
9300 return c
9301 }
9302
9303 // Header returns a http.Header that can be modified by the caller to add
9304 // headers to the request.
9305 func (c *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall) Header() http.Header {
9306 if c.header_ == nil {
9307 c.header_ = make(http.Header)
9308 }
9309 return c.header_
9310 }
9311
9312 func (c *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
9313 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9314 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
9315 if err != nil {
9316 return nil, err
9317 }
9318 c.urlParams_.Set("alt", alt)
9319 c.urlParams_.Set("prettyPrint", "false")
9320 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
9321 urls += "?" + c.urlParams_.Encode()
9322 req, err := http.NewRequest("POST", urls, body)
9323 if err != nil {
9324 return nil, err
9325 }
9326 req.Header = reqHeaders
9327 googleapi.Expand(req.URL, map[string]string{
9328 "resource": c.resource,
9329 })
9330 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
9331 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9332 }
9333
9334 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.setIamPolicy" call.
9335 // Any non-2xx status code is an error. Response headers are in either
9336 // *Policy.ServerResponse.Header or (if a response was returned at all) in
9337 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9338 // whether the returned error was because http.StatusNotModified was returned.
9339 func (c *ProjectsLocationsApisVersionsSpecsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
9340 gensupport.SetOptions(c.urlParams_, opts...)
9341 res, err := c.doRequest("json")
9342 if res != nil && res.StatusCode == http.StatusNotModified {
9343 if res.Body != nil {
9344 res.Body.Close()
9345 }
9346 return nil, gensupport.WrapError(&googleapi.Error{
9347 Code: res.StatusCode,
9348 Header: res.Header,
9349 })
9350 }
9351 if err != nil {
9352 return nil, err
9353 }
9354 defer googleapi.CloseBody(res)
9355 if err := googleapi.CheckResponse(res); err != nil {
9356 return nil, gensupport.WrapError(err)
9357 }
9358 ret := &Policy{
9359 ServerResponse: googleapi.ServerResponse{
9360 Header: res.Header,
9361 HTTPStatusCode: res.StatusCode,
9362 },
9363 }
9364 target := &ret
9365 b, err := gensupport.DecodeResponseBytes(target, res)
9366 if err != nil {
9367 return nil, err
9368 }
9369 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.setIamPolicy", "response", internallog.HTTPResponse(res, b))
9370 return ret, nil
9371 }
9372
9373 type ProjectsLocationsApisVersionsSpecsTagRevisionCall struct {
9374 s *Service
9375 name string
9376 tagapispecrevisionrequest *TagApiSpecRevisionRequest
9377 urlParams_ gensupport.URLParams
9378 ctx_ context.Context
9379 header_ http.Header
9380 }
9381
9382 // TagRevision: Adds a tag to a specified revision of a spec.
9383 //
9384 // - name: The name of the spec to be tagged, including the revision ID is
9385 // optional. If a revision is not specified, it will tag the latest revision.
9386 func (r *ProjectsLocationsApisVersionsSpecsService) TagRevision(name string, tagapispecrevisionrequest *TagApiSpecRevisionRequest) *ProjectsLocationsApisVersionsSpecsTagRevisionCall {
9387 c := &ProjectsLocationsApisVersionsSpecsTagRevisionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9388 c.name = name
9389 c.tagapispecrevisionrequest = tagapispecrevisionrequest
9390 return c
9391 }
9392
9393 // Fields allows partial responses to be retrieved. See
9394 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9395 // details.
9396 func (c *ProjectsLocationsApisVersionsSpecsTagRevisionCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsTagRevisionCall {
9397 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9398 return c
9399 }
9400
9401 // Context sets the context to be used in this call's Do method.
9402 func (c *ProjectsLocationsApisVersionsSpecsTagRevisionCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsTagRevisionCall {
9403 c.ctx_ = ctx
9404 return c
9405 }
9406
9407 // Header returns a http.Header that can be modified by the caller to add
9408 // headers to the request.
9409 func (c *ProjectsLocationsApisVersionsSpecsTagRevisionCall) Header() http.Header {
9410 if c.header_ == nil {
9411 c.header_ = make(http.Header)
9412 }
9413 return c.header_
9414 }
9415
9416 func (c *ProjectsLocationsApisVersionsSpecsTagRevisionCall) doRequest(alt string) (*http.Response, error) {
9417 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9418 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tagapispecrevisionrequest)
9419 if err != nil {
9420 return nil, err
9421 }
9422 c.urlParams_.Set("alt", alt)
9423 c.urlParams_.Set("prettyPrint", "false")
9424 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:tagRevision")
9425 urls += "?" + c.urlParams_.Encode()
9426 req, err := http.NewRequest("POST", urls, body)
9427 if err != nil {
9428 return nil, err
9429 }
9430 req.Header = reqHeaders
9431 googleapi.Expand(req.URL, map[string]string{
9432 "name": c.name,
9433 })
9434 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.tagRevision", "request", internallog.HTTPRequest(req, body.Bytes()))
9435 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9436 }
9437
9438 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.tagRevision" call.
9439 // Any non-2xx status code is an error. Response headers are in either
9440 // *ApiSpec.ServerResponse.Header or (if a response was returned at all) in
9441 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9442 // whether the returned error was because http.StatusNotModified was returned.
9443 func (c *ProjectsLocationsApisVersionsSpecsTagRevisionCall) Do(opts ...googleapi.CallOption) (*ApiSpec, error) {
9444 gensupport.SetOptions(c.urlParams_, opts...)
9445 res, err := c.doRequest("json")
9446 if res != nil && res.StatusCode == http.StatusNotModified {
9447 if res.Body != nil {
9448 res.Body.Close()
9449 }
9450 return nil, gensupport.WrapError(&googleapi.Error{
9451 Code: res.StatusCode,
9452 Header: res.Header,
9453 })
9454 }
9455 if err != nil {
9456 return nil, err
9457 }
9458 defer googleapi.CloseBody(res)
9459 if err := googleapi.CheckResponse(res); err != nil {
9460 return nil, gensupport.WrapError(err)
9461 }
9462 ret := &ApiSpec{
9463 ServerResponse: googleapi.ServerResponse{
9464 Header: res.Header,
9465 HTTPStatusCode: res.StatusCode,
9466 },
9467 }
9468 target := &ret
9469 b, err := gensupport.DecodeResponseBytes(target, res)
9470 if err != nil {
9471 return nil, err
9472 }
9473 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.tagRevision", "response", internallog.HTTPResponse(res, b))
9474 return ret, nil
9475 }
9476
9477 type ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall struct {
9478 s *Service
9479 resource string
9480 testiampermissionsrequest *TestIamPermissionsRequest
9481 urlParams_ gensupport.URLParams
9482 ctx_ context.Context
9483 header_ http.Header
9484 }
9485
9486 // TestIamPermissions: Returns permissions that a caller has on the specified
9487 // resource. If the resource does not exist, this will return an empty set of
9488 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
9489 // used for building permission-aware UIs and command-line tools, not for
9490 // authorization checking. This operation may "fail open" without warning.
9491 //
9492 // - resource: REQUIRED: The resource for which the policy detail is being
9493 // requested. See Resource names
9494 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
9495 // value for this field.
9496 func (r *ProjectsLocationsApisVersionsSpecsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall {
9497 c := &ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9498 c.resource = resource
9499 c.testiampermissionsrequest = testiampermissionsrequest
9500 return c
9501 }
9502
9503 // Fields allows partial responses to be retrieved. See
9504 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9505 // details.
9506 func (c *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall {
9507 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9508 return c
9509 }
9510
9511 // Context sets the context to be used in this call's Do method.
9512 func (c *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall {
9513 c.ctx_ = ctx
9514 return c
9515 }
9516
9517 // Header returns a http.Header that can be modified by the caller to add
9518 // headers to the request.
9519 func (c *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall) Header() http.Header {
9520 if c.header_ == nil {
9521 c.header_ = make(http.Header)
9522 }
9523 return c.header_
9524 }
9525
9526 func (c *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
9527 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9528 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
9529 if err != nil {
9530 return nil, err
9531 }
9532 c.urlParams_.Set("alt", alt)
9533 c.urlParams_.Set("prettyPrint", "false")
9534 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
9535 urls += "?" + c.urlParams_.Encode()
9536 req, err := http.NewRequest("POST", urls, body)
9537 if err != nil {
9538 return nil, err
9539 }
9540 req.Header = reqHeaders
9541 googleapi.Expand(req.URL, map[string]string{
9542 "resource": c.resource,
9543 })
9544 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
9545 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9546 }
9547
9548 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.testIamPermissions" call.
9549 // Any non-2xx status code is an error. Response headers are in either
9550 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
9551 // returned at all) in error.(*googleapi.Error).Header. Use
9552 // googleapi.IsNotModified to check whether the returned error was because
9553 // http.StatusNotModified was returned.
9554 func (c *ProjectsLocationsApisVersionsSpecsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
9555 gensupport.SetOptions(c.urlParams_, opts...)
9556 res, err := c.doRequest("json")
9557 if res != nil && res.StatusCode == http.StatusNotModified {
9558 if res.Body != nil {
9559 res.Body.Close()
9560 }
9561 return nil, gensupport.WrapError(&googleapi.Error{
9562 Code: res.StatusCode,
9563 Header: res.Header,
9564 })
9565 }
9566 if err != nil {
9567 return nil, err
9568 }
9569 defer googleapi.CloseBody(res)
9570 if err := googleapi.CheckResponse(res); err != nil {
9571 return nil, gensupport.WrapError(err)
9572 }
9573 ret := &TestIamPermissionsResponse{
9574 ServerResponse: googleapi.ServerResponse{
9575 Header: res.Header,
9576 HTTPStatusCode: res.StatusCode,
9577 },
9578 }
9579 target := &ret
9580 b, err := gensupport.DecodeResponseBytes(target, res)
9581 if err != nil {
9582 return nil, err
9583 }
9584 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.testIamPermissions", "response", internallog.HTTPResponse(res, b))
9585 return ret, nil
9586 }
9587
9588 type ProjectsLocationsApisVersionsSpecsArtifactsCreateCall struct {
9589 s *Service
9590 parent string
9591 artifact *Artifact
9592 urlParams_ gensupport.URLParams
9593 ctx_ context.Context
9594 header_ http.Header
9595 }
9596
9597 // Create: Creates a specified artifact.
9598 //
9599 // - parent: The parent, which owns this collection of artifacts. Format:
9600 // `{parent}`.
9601 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) Create(parent string, artifact *Artifact) *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall {
9602 c := &ProjectsLocationsApisVersionsSpecsArtifactsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9603 c.parent = parent
9604 c.artifact = artifact
9605 return c
9606 }
9607
9608 // ArtifactId sets the optional parameter "artifactId": Required. The ID to use
9609 // for the artifact, which will become the final component of the artifact's
9610 // resource name. This value should be 4-63 characters, and valid characters
9611 // are /a-z-/. Following AIP-162, IDs must not have the form of a UUID.
9612 func (c *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall) ArtifactId(artifactId string) *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall {
9613 c.urlParams_.Set("artifactId", artifactId)
9614 return c
9615 }
9616
9617 // Fields allows partial responses to be retrieved. See
9618 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9619 // details.
9620 func (c *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall {
9621 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9622 return c
9623 }
9624
9625 // Context sets the context to be used in this call's Do method.
9626 func (c *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall {
9627 c.ctx_ = ctx
9628 return c
9629 }
9630
9631 // Header returns a http.Header that can be modified by the caller to add
9632 // headers to the request.
9633 func (c *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall) Header() http.Header {
9634 if c.header_ == nil {
9635 c.header_ = make(http.Header)
9636 }
9637 return c.header_
9638 }
9639
9640 func (c *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall) doRequest(alt string) (*http.Response, error) {
9641 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9642 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact)
9643 if err != nil {
9644 return nil, err
9645 }
9646 c.urlParams_.Set("alt", alt)
9647 c.urlParams_.Set("prettyPrint", "false")
9648 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
9649 urls += "?" + c.urlParams_.Encode()
9650 req, err := http.NewRequest("POST", urls, body)
9651 if err != nil {
9652 return nil, err
9653 }
9654 req.Header = reqHeaders
9655 googleapi.Expand(req.URL, map[string]string{
9656 "parent": c.parent,
9657 })
9658 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.create", "request", internallog.HTTPRequest(req, body.Bytes()))
9659 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9660 }
9661
9662 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.artifacts.create" call.
9663 // Any non-2xx status code is an error. Response headers are in either
9664 // *Artifact.ServerResponse.Header or (if a response was returned at all) in
9665 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9666 // whether the returned error was because http.StatusNotModified was returned.
9667 func (c *ProjectsLocationsApisVersionsSpecsArtifactsCreateCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
9668 gensupport.SetOptions(c.urlParams_, opts...)
9669 res, err := c.doRequest("json")
9670 if res != nil && res.StatusCode == http.StatusNotModified {
9671 if res.Body != nil {
9672 res.Body.Close()
9673 }
9674 return nil, gensupport.WrapError(&googleapi.Error{
9675 Code: res.StatusCode,
9676 Header: res.Header,
9677 })
9678 }
9679 if err != nil {
9680 return nil, err
9681 }
9682 defer googleapi.CloseBody(res)
9683 if err := googleapi.CheckResponse(res); err != nil {
9684 return nil, gensupport.WrapError(err)
9685 }
9686 ret := &Artifact{
9687 ServerResponse: googleapi.ServerResponse{
9688 Header: res.Header,
9689 HTTPStatusCode: res.StatusCode,
9690 },
9691 }
9692 target := &ret
9693 b, err := gensupport.DecodeResponseBytes(target, res)
9694 if err != nil {
9695 return nil, err
9696 }
9697 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.create", "response", internallog.HTTPResponse(res, b))
9698 return ret, nil
9699 }
9700
9701 type ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall struct {
9702 s *Service
9703 name string
9704 urlParams_ gensupport.URLParams
9705 ctx_ context.Context
9706 header_ http.Header
9707 }
9708
9709 // Delete: Removes a specified artifact.
9710 //
9711 // - name: The name of the artifact to delete. Format: `{parent}/artifacts/*`.
9712 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) Delete(name string) *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall {
9713 c := &ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9714 c.name = name
9715 return c
9716 }
9717
9718 // Fields allows partial responses to be retrieved. See
9719 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9720 // details.
9721 func (c *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall {
9722 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9723 return c
9724 }
9725
9726 // Context sets the context to be used in this call's Do method.
9727 func (c *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall {
9728 c.ctx_ = ctx
9729 return c
9730 }
9731
9732 // Header returns a http.Header that can be modified by the caller to add
9733 // headers to the request.
9734 func (c *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall) Header() http.Header {
9735 if c.header_ == nil {
9736 c.header_ = make(http.Header)
9737 }
9738 return c.header_
9739 }
9740
9741 func (c *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) {
9742 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9743 c.urlParams_.Set("alt", alt)
9744 c.urlParams_.Set("prettyPrint", "false")
9745 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
9746 urls += "?" + c.urlParams_.Encode()
9747 req, err := http.NewRequest("DELETE", urls, nil)
9748 if err != nil {
9749 return nil, err
9750 }
9751 req.Header = reqHeaders
9752 googleapi.Expand(req.URL, map[string]string{
9753 "name": c.name,
9754 })
9755 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.delete", "request", internallog.HTTPRequest(req, nil))
9756 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9757 }
9758
9759 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.artifacts.delete" call.
9760 // Any non-2xx status code is an error. Response headers are in either
9761 // *Empty.ServerResponse.Header or (if a response was returned at all) in
9762 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9763 // whether the returned error was because http.StatusNotModified was returned.
9764 func (c *ProjectsLocationsApisVersionsSpecsArtifactsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
9765 gensupport.SetOptions(c.urlParams_, opts...)
9766 res, err := c.doRequest("json")
9767 if res != nil && res.StatusCode == http.StatusNotModified {
9768 if res.Body != nil {
9769 res.Body.Close()
9770 }
9771 return nil, gensupport.WrapError(&googleapi.Error{
9772 Code: res.StatusCode,
9773 Header: res.Header,
9774 })
9775 }
9776 if err != nil {
9777 return nil, err
9778 }
9779 defer googleapi.CloseBody(res)
9780 if err := googleapi.CheckResponse(res); err != nil {
9781 return nil, gensupport.WrapError(err)
9782 }
9783 ret := &Empty{
9784 ServerResponse: googleapi.ServerResponse{
9785 Header: res.Header,
9786 HTTPStatusCode: res.StatusCode,
9787 },
9788 }
9789 target := &ret
9790 b, err := gensupport.DecodeResponseBytes(target, res)
9791 if err != nil {
9792 return nil, err
9793 }
9794 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.delete", "response", internallog.HTTPResponse(res, b))
9795 return ret, nil
9796 }
9797
9798 type ProjectsLocationsApisVersionsSpecsArtifactsGetCall struct {
9799 s *Service
9800 name string
9801 urlParams_ gensupport.URLParams
9802 ifNoneMatch_ string
9803 ctx_ context.Context
9804 header_ http.Header
9805 }
9806
9807 // Get: Returns a specified artifact.
9808 //
9809 // - name: The name of the artifact to retrieve. Format: `{parent}/artifacts/*`.
9810 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) Get(name string) *ProjectsLocationsApisVersionsSpecsArtifactsGetCall {
9811 c := &ProjectsLocationsApisVersionsSpecsArtifactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9812 c.name = name
9813 return c
9814 }
9815
9816 // Fields allows partial responses to be retrieved. See
9817 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9818 // details.
9819 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsGetCall {
9820 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9821 return c
9822 }
9823
9824 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9825 // object's ETag matches the given value. This is useful for getting updates
9826 // only after the object has changed since the last request.
9827 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsArtifactsGetCall {
9828 c.ifNoneMatch_ = entityTag
9829 return c
9830 }
9831
9832 // Context sets the context to be used in this call's Do method.
9833 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsGetCall {
9834 c.ctx_ = ctx
9835 return c
9836 }
9837
9838 // Header returns a http.Header that can be modified by the caller to add
9839 // headers to the request.
9840 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetCall) Header() http.Header {
9841 if c.header_ == nil {
9842 c.header_ = make(http.Header)
9843 }
9844 return c.header_
9845 }
9846
9847 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetCall) doRequest(alt string) (*http.Response, error) {
9848 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9849 if c.ifNoneMatch_ != "" {
9850 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9851 }
9852 c.urlParams_.Set("alt", alt)
9853 c.urlParams_.Set("prettyPrint", "false")
9854 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
9855 urls += "?" + c.urlParams_.Encode()
9856 req, err := http.NewRequest("GET", urls, nil)
9857 if err != nil {
9858 return nil, err
9859 }
9860 req.Header = reqHeaders
9861 googleapi.Expand(req.URL, map[string]string{
9862 "name": c.name,
9863 })
9864 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.get", "request", internallog.HTTPRequest(req, nil))
9865 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9866 }
9867
9868 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.artifacts.get" call.
9869 // Any non-2xx status code is an error. Response headers are in either
9870 // *Artifact.ServerResponse.Header or (if a response was returned at all) in
9871 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9872 // whether the returned error was because http.StatusNotModified was returned.
9873 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
9874 gensupport.SetOptions(c.urlParams_, opts...)
9875 res, err := c.doRequest("json")
9876 if res != nil && res.StatusCode == http.StatusNotModified {
9877 if res.Body != nil {
9878 res.Body.Close()
9879 }
9880 return nil, gensupport.WrapError(&googleapi.Error{
9881 Code: res.StatusCode,
9882 Header: res.Header,
9883 })
9884 }
9885 if err != nil {
9886 return nil, err
9887 }
9888 defer googleapi.CloseBody(res)
9889 if err := googleapi.CheckResponse(res); err != nil {
9890 return nil, gensupport.WrapError(err)
9891 }
9892 ret := &Artifact{
9893 ServerResponse: googleapi.ServerResponse{
9894 Header: res.Header,
9895 HTTPStatusCode: res.StatusCode,
9896 },
9897 }
9898 target := &ret
9899 b, err := gensupport.DecodeResponseBytes(target, res)
9900 if err != nil {
9901 return nil, err
9902 }
9903 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.get", "response", internallog.HTTPResponse(res, b))
9904 return ret, nil
9905 }
9906
9907 type ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall struct {
9908 s *Service
9909 name string
9910 urlParams_ gensupport.URLParams
9911 ifNoneMatch_ string
9912 ctx_ context.Context
9913 header_ http.Header
9914 }
9915
9916 // GetContents: Returns the contents of a specified artifact. If artifacts are
9917 // stored with GZip compression, the default behavior is to return the artifact
9918 // uncompressed (the mime_type response field indicates the exact format
9919 // returned).
9920 //
9921 // - name: The name of the artifact whose contents should be retrieved. Format:
9922 // `{parent}/artifacts/*`.
9923 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) GetContents(name string) *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall {
9924 c := &ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9925 c.name = name
9926 return c
9927 }
9928
9929 // Fields allows partial responses to be retrieved. See
9930 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9931 // details.
9932 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall {
9933 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9934 return c
9935 }
9936
9937 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9938 // object's ETag matches the given value. This is useful for getting updates
9939 // only after the object has changed since the last request.
9940 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall {
9941 c.ifNoneMatch_ = entityTag
9942 return c
9943 }
9944
9945 // Context sets the context to be used in this call's Do method.
9946 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall {
9947 c.ctx_ = ctx
9948 return c
9949 }
9950
9951 // Header returns a http.Header that can be modified by the caller to add
9952 // headers to the request.
9953 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall) Header() http.Header {
9954 if c.header_ == nil {
9955 c.header_ = make(http.Header)
9956 }
9957 return c.header_
9958 }
9959
9960 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall) doRequest(alt string) (*http.Response, error) {
9961 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9962 if c.ifNoneMatch_ != "" {
9963 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9964 }
9965 c.urlParams_.Set("alt", alt)
9966 c.urlParams_.Set("prettyPrint", "false")
9967 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents")
9968 urls += "?" + c.urlParams_.Encode()
9969 req, err := http.NewRequest("GET", urls, nil)
9970 if err != nil {
9971 return nil, err
9972 }
9973 req.Header = reqHeaders
9974 googleapi.Expand(req.URL, map[string]string{
9975 "name": c.name,
9976 })
9977 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.getContents", "request", internallog.HTTPRequest(req, nil))
9978 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9979 }
9980
9981 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.artifacts.getContents" call.
9982 // Any non-2xx status code is an error. Response headers are in either
9983 // *HttpBody.ServerResponse.Header or (if a response was returned at all) in
9984 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9985 // whether the returned error was because http.StatusNotModified was returned.
9986 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetContentsCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
9987 gensupport.SetOptions(c.urlParams_, opts...)
9988 res, err := c.doRequest("json")
9989 if res != nil && res.StatusCode == http.StatusNotModified {
9990 if res.Body != nil {
9991 res.Body.Close()
9992 }
9993 return nil, gensupport.WrapError(&googleapi.Error{
9994 Code: res.StatusCode,
9995 Header: res.Header,
9996 })
9997 }
9998 if err != nil {
9999 return nil, err
10000 }
10001 defer googleapi.CloseBody(res)
10002 if err := googleapi.CheckResponse(res); err != nil {
10003 return nil, gensupport.WrapError(err)
10004 }
10005 ret := &HttpBody{
10006 ServerResponse: googleapi.ServerResponse{
10007 Header: res.Header,
10008 HTTPStatusCode: res.StatusCode,
10009 },
10010 }
10011 target := &ret
10012 b, err := gensupport.DecodeResponseBytes(target, res)
10013 if err != nil {
10014 return nil, err
10015 }
10016 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.getContents", "response", internallog.HTTPResponse(res, b))
10017 return ret, nil
10018 }
10019
10020 type ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall struct {
10021 s *Service
10022 resource string
10023 urlParams_ gensupport.URLParams
10024 ifNoneMatch_ string
10025 ctx_ context.Context
10026 header_ http.Header
10027 }
10028
10029 // GetIamPolicy: Gets the access control policy for a resource. Returns an
10030 // empty policy if the resource exists and does not have a policy set.
10031 //
10032 // - resource: REQUIRED: The resource for which the policy is being requested.
10033 // See Resource names (https://cloud.google.com/apis/design/resource_names)
10034 // for the appropriate value for this field.
10035 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) GetIamPolicy(resource string) *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall {
10036 c := &ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10037 c.resource = resource
10038 return c
10039 }
10040
10041 // OptionsRequestedPolicyVersion sets the optional parameter
10042 // "options.requestedPolicyVersion": The maximum policy version that will be
10043 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
10044 // an invalid value will be rejected. Requests for policies with any
10045 // conditional role bindings must specify version 3. Policies with no
10046 // conditional role bindings may specify any valid value or leave the field
10047 // unset. The policy in the response might use the policy version that you
10048 // specified, or it might use a lower policy version. For example, if you
10049 // specify version 3, but the policy has no conditional role bindings, the
10050 // response uses version 1. To learn which resources support conditions in
10051 // their IAM policies, see the IAM documentation
10052 // (https://cloud.google.com/iam/help/conditions/resource-policies).
10053 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall {
10054 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
10055 return c
10056 }
10057
10058 // Fields allows partial responses to be retrieved. See
10059 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10060 // details.
10061 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall {
10062 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10063 return c
10064 }
10065
10066 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10067 // object's ETag matches the given value. This is useful for getting updates
10068 // only after the object has changed since the last request.
10069 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall {
10070 c.ifNoneMatch_ = entityTag
10071 return c
10072 }
10073
10074 // Context sets the context to be used in this call's Do method.
10075 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall {
10076 c.ctx_ = ctx
10077 return c
10078 }
10079
10080 // Header returns a http.Header that can be modified by the caller to add
10081 // headers to the request.
10082 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall) Header() http.Header {
10083 if c.header_ == nil {
10084 c.header_ = make(http.Header)
10085 }
10086 return c.header_
10087 }
10088
10089 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
10090 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10091 if c.ifNoneMatch_ != "" {
10092 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10093 }
10094 c.urlParams_.Set("alt", alt)
10095 c.urlParams_.Set("prettyPrint", "false")
10096 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
10097 urls += "?" + c.urlParams_.Encode()
10098 req, err := http.NewRequest("GET", urls, nil)
10099 if err != nil {
10100 return nil, err
10101 }
10102 req.Header = reqHeaders
10103 googleapi.Expand(req.URL, map[string]string{
10104 "resource": c.resource,
10105 })
10106 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
10107 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10108 }
10109
10110 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.artifacts.getIamPolicy" call.
10111 // Any non-2xx status code is an error. Response headers are in either
10112 // *Policy.ServerResponse.Header or (if a response was returned at all) in
10113 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10114 // whether the returned error was because http.StatusNotModified was returned.
10115 func (c *ProjectsLocationsApisVersionsSpecsArtifactsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
10116 gensupport.SetOptions(c.urlParams_, opts...)
10117 res, err := c.doRequest("json")
10118 if res != nil && res.StatusCode == http.StatusNotModified {
10119 if res.Body != nil {
10120 res.Body.Close()
10121 }
10122 return nil, gensupport.WrapError(&googleapi.Error{
10123 Code: res.StatusCode,
10124 Header: res.Header,
10125 })
10126 }
10127 if err != nil {
10128 return nil, err
10129 }
10130 defer googleapi.CloseBody(res)
10131 if err := googleapi.CheckResponse(res); err != nil {
10132 return nil, gensupport.WrapError(err)
10133 }
10134 ret := &Policy{
10135 ServerResponse: googleapi.ServerResponse{
10136 Header: res.Header,
10137 HTTPStatusCode: res.StatusCode,
10138 },
10139 }
10140 target := &ret
10141 b, err := gensupport.DecodeResponseBytes(target, res)
10142 if err != nil {
10143 return nil, err
10144 }
10145 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.getIamPolicy", "response", internallog.HTTPResponse(res, b))
10146 return ret, nil
10147 }
10148
10149 type ProjectsLocationsApisVersionsSpecsArtifactsListCall struct {
10150 s *Service
10151 parent string
10152 urlParams_ gensupport.URLParams
10153 ifNoneMatch_ string
10154 ctx_ context.Context
10155 header_ http.Header
10156 }
10157
10158 // List: Returns matching artifacts.
10159 //
10160 // - parent: The parent, which owns this collection of artifacts. Format:
10161 // `{parent}`.
10162 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) List(parent string) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10163 c := &ProjectsLocationsApisVersionsSpecsArtifactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10164 c.parent = parent
10165 return c
10166 }
10167
10168 // Filter sets the optional parameter "filter": An expression that can be used
10169 // to filter the list. Filters use the Common Expression Language and can refer
10170 // to all message fields except contents.
10171 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) Filter(filter string) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10172 c.urlParams_.Set("filter", filter)
10173 return c
10174 }
10175
10176 // OrderBy sets the optional parameter "orderBy": A comma-separated list of
10177 // fields, e.g. "foo,bar" Fields can be sorted in descending order using the
10178 // "desc" identifier, e.g. "foo desc,bar"
10179 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) OrderBy(orderBy string) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10180 c.urlParams_.Set("orderBy", orderBy)
10181 return c
10182 }
10183
10184 // PageSize sets the optional parameter "pageSize": The maximum number of
10185 // artifacts to return. The service may return fewer than this value. If
10186 // unspecified, at most 50 values will be returned. The maximum is 1000; values
10187 // above 1000 will be coerced to 1000.
10188 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) PageSize(pageSize int64) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10189 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
10190 return c
10191 }
10192
10193 // PageToken sets the optional parameter "pageToken": A page token, received
10194 // from a previous `ListArtifacts` call. Provide this to retrieve the
10195 // subsequent page. When paginating, all other parameters provided to
10196 // `ListArtifacts` must match the call that provided the page token.
10197 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) PageToken(pageToken string) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10198 c.urlParams_.Set("pageToken", pageToken)
10199 return c
10200 }
10201
10202 // Fields allows partial responses to be retrieved. See
10203 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10204 // details.
10205 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10206 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10207 return c
10208 }
10209
10210 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10211 // object's ETag matches the given value. This is useful for getting updates
10212 // only after the object has changed since the last request.
10213 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10214 c.ifNoneMatch_ = entityTag
10215 return c
10216 }
10217
10218 // Context sets the context to be used in this call's Do method.
10219 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsListCall {
10220 c.ctx_ = ctx
10221 return c
10222 }
10223
10224 // Header returns a http.Header that can be modified by the caller to add
10225 // headers to the request.
10226 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) Header() http.Header {
10227 if c.header_ == nil {
10228 c.header_ = make(http.Header)
10229 }
10230 return c.header_
10231 }
10232
10233 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) doRequest(alt string) (*http.Response, error) {
10234 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10235 if c.ifNoneMatch_ != "" {
10236 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10237 }
10238 c.urlParams_.Set("alt", alt)
10239 c.urlParams_.Set("prettyPrint", "false")
10240 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
10241 urls += "?" + c.urlParams_.Encode()
10242 req, err := http.NewRequest("GET", urls, nil)
10243 if err != nil {
10244 return nil, err
10245 }
10246 req.Header = reqHeaders
10247 googleapi.Expand(req.URL, map[string]string{
10248 "parent": c.parent,
10249 })
10250 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.list", "request", internallog.HTTPRequest(req, nil))
10251 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10252 }
10253
10254 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.artifacts.list" call.
10255 // Any non-2xx status code is an error. Response headers are in either
10256 // *ListArtifactsResponse.ServerResponse.Header or (if a response was returned
10257 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10258 // check whether the returned error was because http.StatusNotModified was
10259 // returned.
10260 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) Do(opts ...googleapi.CallOption) (*ListArtifactsResponse, error) {
10261 gensupport.SetOptions(c.urlParams_, opts...)
10262 res, err := c.doRequest("json")
10263 if res != nil && res.StatusCode == http.StatusNotModified {
10264 if res.Body != nil {
10265 res.Body.Close()
10266 }
10267 return nil, gensupport.WrapError(&googleapi.Error{
10268 Code: res.StatusCode,
10269 Header: res.Header,
10270 })
10271 }
10272 if err != nil {
10273 return nil, err
10274 }
10275 defer googleapi.CloseBody(res)
10276 if err := googleapi.CheckResponse(res); err != nil {
10277 return nil, gensupport.WrapError(err)
10278 }
10279 ret := &ListArtifactsResponse{
10280 ServerResponse: googleapi.ServerResponse{
10281 Header: res.Header,
10282 HTTPStatusCode: res.StatusCode,
10283 },
10284 }
10285 target := &ret
10286 b, err := gensupport.DecodeResponseBytes(target, res)
10287 if err != nil {
10288 return nil, err
10289 }
10290 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.list", "response", internallog.HTTPResponse(res, b))
10291 return ret, nil
10292 }
10293
10294 // Pages invokes f for each page of results.
10295 // A non-nil error returned from f will halt the iteration.
10296 // The provided context supersedes any context provided to the Context method.
10297 func (c *ProjectsLocationsApisVersionsSpecsArtifactsListCall) Pages(ctx context.Context, f func(*ListArtifactsResponse) error) error {
10298 c.ctx_ = ctx
10299 defer c.PageToken(c.urlParams_.Get("pageToken"))
10300 for {
10301 x, err := c.Do()
10302 if err != nil {
10303 return err
10304 }
10305 if err := f(x); err != nil {
10306 return err
10307 }
10308 if x.NextPageToken == "" {
10309 return nil
10310 }
10311 c.PageToken(x.NextPageToken)
10312 }
10313 }
10314
10315 type ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall struct {
10316 s *Service
10317 name string
10318 artifact *Artifact
10319 urlParams_ gensupport.URLParams
10320 ctx_ context.Context
10321 header_ http.Header
10322 }
10323
10324 // ReplaceArtifact: Used to replace a specified artifact.
10325 //
10326 // - name: Resource name.
10327 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) ReplaceArtifact(name string, artifact *Artifact) *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall {
10328 c := &ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10329 c.name = name
10330 c.artifact = artifact
10331 return c
10332 }
10333
10334 // Fields allows partial responses to be retrieved. See
10335 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10336 // details.
10337 func (c *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall {
10338 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10339 return c
10340 }
10341
10342 // Context sets the context to be used in this call's Do method.
10343 func (c *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall {
10344 c.ctx_ = ctx
10345 return c
10346 }
10347
10348 // Header returns a http.Header that can be modified by the caller to add
10349 // headers to the request.
10350 func (c *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall) Header() http.Header {
10351 if c.header_ == nil {
10352 c.header_ = make(http.Header)
10353 }
10354 return c.header_
10355 }
10356
10357 func (c *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall) doRequest(alt string) (*http.Response, error) {
10358 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10359 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact)
10360 if err != nil {
10361 return nil, err
10362 }
10363 c.urlParams_.Set("alt", alt)
10364 c.urlParams_.Set("prettyPrint", "false")
10365 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
10366 urls += "?" + c.urlParams_.Encode()
10367 req, err := http.NewRequest("PUT", urls, body)
10368 if err != nil {
10369 return nil, err
10370 }
10371 req.Header = reqHeaders
10372 googleapi.Expand(req.URL, map[string]string{
10373 "name": c.name,
10374 })
10375 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.replaceArtifact", "request", internallog.HTTPRequest(req, body.Bytes()))
10376 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10377 }
10378
10379 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.artifacts.replaceArtifact" call.
10380 // Any non-2xx status code is an error. Response headers are in either
10381 // *Artifact.ServerResponse.Header or (if a response was returned at all) in
10382 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10383 // whether the returned error was because http.StatusNotModified was returned.
10384 func (c *ProjectsLocationsApisVersionsSpecsArtifactsReplaceArtifactCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
10385 gensupport.SetOptions(c.urlParams_, opts...)
10386 res, err := c.doRequest("json")
10387 if res != nil && res.StatusCode == http.StatusNotModified {
10388 if res.Body != nil {
10389 res.Body.Close()
10390 }
10391 return nil, gensupport.WrapError(&googleapi.Error{
10392 Code: res.StatusCode,
10393 Header: res.Header,
10394 })
10395 }
10396 if err != nil {
10397 return nil, err
10398 }
10399 defer googleapi.CloseBody(res)
10400 if err := googleapi.CheckResponse(res); err != nil {
10401 return nil, gensupport.WrapError(err)
10402 }
10403 ret := &Artifact{
10404 ServerResponse: googleapi.ServerResponse{
10405 Header: res.Header,
10406 HTTPStatusCode: res.StatusCode,
10407 },
10408 }
10409 target := &ret
10410 b, err := gensupport.DecodeResponseBytes(target, res)
10411 if err != nil {
10412 return nil, err
10413 }
10414 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.replaceArtifact", "response", internallog.HTTPResponse(res, b))
10415 return ret, nil
10416 }
10417
10418 type ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall struct {
10419 s *Service
10420 resource string
10421 setiampolicyrequest *SetIamPolicyRequest
10422 urlParams_ gensupport.URLParams
10423 ctx_ context.Context
10424 header_ http.Header
10425 }
10426
10427 // SetIamPolicy: Sets the access control policy on the specified resource.
10428 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
10429 // and `PERMISSION_DENIED` errors.
10430 //
10431 // - resource: REQUIRED: The resource for which the policy is being specified.
10432 // See Resource names (https://cloud.google.com/apis/design/resource_names)
10433 // for the appropriate value for this field.
10434 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall {
10435 c := &ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10436 c.resource = resource
10437 c.setiampolicyrequest = setiampolicyrequest
10438 return c
10439 }
10440
10441 // Fields allows partial responses to be retrieved. See
10442 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10443 // details.
10444 func (c *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall {
10445 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10446 return c
10447 }
10448
10449 // Context sets the context to be used in this call's Do method.
10450 func (c *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall {
10451 c.ctx_ = ctx
10452 return c
10453 }
10454
10455 // Header returns a http.Header that can be modified by the caller to add
10456 // headers to the request.
10457 func (c *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall) Header() http.Header {
10458 if c.header_ == nil {
10459 c.header_ = make(http.Header)
10460 }
10461 return c.header_
10462 }
10463
10464 func (c *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
10465 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10466 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
10467 if err != nil {
10468 return nil, err
10469 }
10470 c.urlParams_.Set("alt", alt)
10471 c.urlParams_.Set("prettyPrint", "false")
10472 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
10473 urls += "?" + c.urlParams_.Encode()
10474 req, err := http.NewRequest("POST", urls, body)
10475 if err != nil {
10476 return nil, err
10477 }
10478 req.Header = reqHeaders
10479 googleapi.Expand(req.URL, map[string]string{
10480 "resource": c.resource,
10481 })
10482 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
10483 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10484 }
10485
10486 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.artifacts.setIamPolicy" call.
10487 // Any non-2xx status code is an error. Response headers are in either
10488 // *Policy.ServerResponse.Header or (if a response was returned at all) in
10489 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10490 // whether the returned error was because http.StatusNotModified was returned.
10491 func (c *ProjectsLocationsApisVersionsSpecsArtifactsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
10492 gensupport.SetOptions(c.urlParams_, opts...)
10493 res, err := c.doRequest("json")
10494 if res != nil && res.StatusCode == http.StatusNotModified {
10495 if res.Body != nil {
10496 res.Body.Close()
10497 }
10498 return nil, gensupport.WrapError(&googleapi.Error{
10499 Code: res.StatusCode,
10500 Header: res.Header,
10501 })
10502 }
10503 if err != nil {
10504 return nil, err
10505 }
10506 defer googleapi.CloseBody(res)
10507 if err := googleapi.CheckResponse(res); err != nil {
10508 return nil, gensupport.WrapError(err)
10509 }
10510 ret := &Policy{
10511 ServerResponse: googleapi.ServerResponse{
10512 Header: res.Header,
10513 HTTPStatusCode: res.StatusCode,
10514 },
10515 }
10516 target := &ret
10517 b, err := gensupport.DecodeResponseBytes(target, res)
10518 if err != nil {
10519 return nil, err
10520 }
10521 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.setIamPolicy", "response", internallog.HTTPResponse(res, b))
10522 return ret, nil
10523 }
10524
10525 type ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall struct {
10526 s *Service
10527 resource string
10528 testiampermissionsrequest *TestIamPermissionsRequest
10529 urlParams_ gensupport.URLParams
10530 ctx_ context.Context
10531 header_ http.Header
10532 }
10533
10534 // TestIamPermissions: Returns permissions that a caller has on the specified
10535 // resource. If the resource does not exist, this will return an empty set of
10536 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
10537 // used for building permission-aware UIs and command-line tools, not for
10538 // authorization checking. This operation may "fail open" without warning.
10539 //
10540 // - resource: REQUIRED: The resource for which the policy detail is being
10541 // requested. See Resource names
10542 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
10543 // value for this field.
10544 func (r *ProjectsLocationsApisVersionsSpecsArtifactsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall {
10545 c := &ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10546 c.resource = resource
10547 c.testiampermissionsrequest = testiampermissionsrequest
10548 return c
10549 }
10550
10551 // Fields allows partial responses to be retrieved. See
10552 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10553 // details.
10554 func (c *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall {
10555 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10556 return c
10557 }
10558
10559 // Context sets the context to be used in this call's Do method.
10560 func (c *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall {
10561 c.ctx_ = ctx
10562 return c
10563 }
10564
10565 // Header returns a http.Header that can be modified by the caller to add
10566 // headers to the request.
10567 func (c *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall) Header() http.Header {
10568 if c.header_ == nil {
10569 c.header_ = make(http.Header)
10570 }
10571 return c.header_
10572 }
10573
10574 func (c *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
10575 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10576 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
10577 if err != nil {
10578 return nil, err
10579 }
10580 c.urlParams_.Set("alt", alt)
10581 c.urlParams_.Set("prettyPrint", "false")
10582 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
10583 urls += "?" + c.urlParams_.Encode()
10584 req, err := http.NewRequest("POST", urls, body)
10585 if err != nil {
10586 return nil, err
10587 }
10588 req.Header = reqHeaders
10589 googleapi.Expand(req.URL, map[string]string{
10590 "resource": c.resource,
10591 })
10592 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
10593 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10594 }
10595
10596 // Do executes the "apigeeregistry.projects.locations.apis.versions.specs.artifacts.testIamPermissions" call.
10597 // Any non-2xx status code is an error. Response headers are in either
10598 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
10599 // returned at all) in error.(*googleapi.Error).Header. Use
10600 // googleapi.IsNotModified to check whether the returned error was because
10601 // http.StatusNotModified was returned.
10602 func (c *ProjectsLocationsApisVersionsSpecsArtifactsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
10603 gensupport.SetOptions(c.urlParams_, opts...)
10604 res, err := c.doRequest("json")
10605 if res != nil && res.StatusCode == http.StatusNotModified {
10606 if res.Body != nil {
10607 res.Body.Close()
10608 }
10609 return nil, gensupport.WrapError(&googleapi.Error{
10610 Code: res.StatusCode,
10611 Header: res.Header,
10612 })
10613 }
10614 if err != nil {
10615 return nil, err
10616 }
10617 defer googleapi.CloseBody(res)
10618 if err := googleapi.CheckResponse(res); err != nil {
10619 return nil, gensupport.WrapError(err)
10620 }
10621 ret := &TestIamPermissionsResponse{
10622 ServerResponse: googleapi.ServerResponse{
10623 Header: res.Header,
10624 HTTPStatusCode: res.StatusCode,
10625 },
10626 }
10627 target := &ret
10628 b, err := gensupport.DecodeResponseBytes(target, res)
10629 if err != nil {
10630 return nil, err
10631 }
10632 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.apis.versions.specs.artifacts.testIamPermissions", "response", internallog.HTTPResponse(res, b))
10633 return ret, nil
10634 }
10635
10636 type ProjectsLocationsArtifactsCreateCall struct {
10637 s *Service
10638 parent string
10639 artifact *Artifact
10640 urlParams_ gensupport.URLParams
10641 ctx_ context.Context
10642 header_ http.Header
10643 }
10644
10645 // Create: Creates a specified artifact.
10646 //
10647 // - parent: The parent, which owns this collection of artifacts. Format:
10648 // `{parent}`.
10649 func (r *ProjectsLocationsArtifactsService) Create(parent string, artifact *Artifact) *ProjectsLocationsArtifactsCreateCall {
10650 c := &ProjectsLocationsArtifactsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10651 c.parent = parent
10652 c.artifact = artifact
10653 return c
10654 }
10655
10656 // ArtifactId sets the optional parameter "artifactId": Required. The ID to use
10657 // for the artifact, which will become the final component of the artifact's
10658 // resource name. This value should be 4-63 characters, and valid characters
10659 // are /a-z-/. Following AIP-162, IDs must not have the form of a UUID.
10660 func (c *ProjectsLocationsArtifactsCreateCall) ArtifactId(artifactId string) *ProjectsLocationsArtifactsCreateCall {
10661 c.urlParams_.Set("artifactId", artifactId)
10662 return c
10663 }
10664
10665 // Fields allows partial responses to be retrieved. See
10666 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10667 // details.
10668 func (c *ProjectsLocationsArtifactsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsCreateCall {
10669 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10670 return c
10671 }
10672
10673 // Context sets the context to be used in this call's Do method.
10674 func (c *ProjectsLocationsArtifactsCreateCall) Context(ctx context.Context) *ProjectsLocationsArtifactsCreateCall {
10675 c.ctx_ = ctx
10676 return c
10677 }
10678
10679 // Header returns a http.Header that can be modified by the caller to add
10680 // headers to the request.
10681 func (c *ProjectsLocationsArtifactsCreateCall) Header() http.Header {
10682 if c.header_ == nil {
10683 c.header_ = make(http.Header)
10684 }
10685 return c.header_
10686 }
10687
10688 func (c *ProjectsLocationsArtifactsCreateCall) doRequest(alt string) (*http.Response, error) {
10689 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10690 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact)
10691 if err != nil {
10692 return nil, err
10693 }
10694 c.urlParams_.Set("alt", alt)
10695 c.urlParams_.Set("prettyPrint", "false")
10696 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
10697 urls += "?" + c.urlParams_.Encode()
10698 req, err := http.NewRequest("POST", urls, body)
10699 if err != nil {
10700 return nil, err
10701 }
10702 req.Header = reqHeaders
10703 googleapi.Expand(req.URL, map[string]string{
10704 "parent": c.parent,
10705 })
10706 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.create", "request", internallog.HTTPRequest(req, body.Bytes()))
10707 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10708 }
10709
10710 // Do executes the "apigeeregistry.projects.locations.artifacts.create" call.
10711 // Any non-2xx status code is an error. Response headers are in either
10712 // *Artifact.ServerResponse.Header or (if a response was returned at all) in
10713 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10714 // whether the returned error was because http.StatusNotModified was returned.
10715 func (c *ProjectsLocationsArtifactsCreateCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
10716 gensupport.SetOptions(c.urlParams_, opts...)
10717 res, err := c.doRequest("json")
10718 if res != nil && res.StatusCode == http.StatusNotModified {
10719 if res.Body != nil {
10720 res.Body.Close()
10721 }
10722 return nil, gensupport.WrapError(&googleapi.Error{
10723 Code: res.StatusCode,
10724 Header: res.Header,
10725 })
10726 }
10727 if err != nil {
10728 return nil, err
10729 }
10730 defer googleapi.CloseBody(res)
10731 if err := googleapi.CheckResponse(res); err != nil {
10732 return nil, gensupport.WrapError(err)
10733 }
10734 ret := &Artifact{
10735 ServerResponse: googleapi.ServerResponse{
10736 Header: res.Header,
10737 HTTPStatusCode: res.StatusCode,
10738 },
10739 }
10740 target := &ret
10741 b, err := gensupport.DecodeResponseBytes(target, res)
10742 if err != nil {
10743 return nil, err
10744 }
10745 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.create", "response", internallog.HTTPResponse(res, b))
10746 return ret, nil
10747 }
10748
10749 type ProjectsLocationsArtifactsDeleteCall struct {
10750 s *Service
10751 name string
10752 urlParams_ gensupport.URLParams
10753 ctx_ context.Context
10754 header_ http.Header
10755 }
10756
10757 // Delete: Removes a specified artifact.
10758 //
10759 // - name: The name of the artifact to delete. Format: `{parent}/artifacts/*`.
10760 func (r *ProjectsLocationsArtifactsService) Delete(name string) *ProjectsLocationsArtifactsDeleteCall {
10761 c := &ProjectsLocationsArtifactsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10762 c.name = name
10763 return c
10764 }
10765
10766 // Fields allows partial responses to be retrieved. See
10767 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10768 // details.
10769 func (c *ProjectsLocationsArtifactsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsDeleteCall {
10770 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10771 return c
10772 }
10773
10774 // Context sets the context to be used in this call's Do method.
10775 func (c *ProjectsLocationsArtifactsDeleteCall) Context(ctx context.Context) *ProjectsLocationsArtifactsDeleteCall {
10776 c.ctx_ = ctx
10777 return c
10778 }
10779
10780 // Header returns a http.Header that can be modified by the caller to add
10781 // headers to the request.
10782 func (c *ProjectsLocationsArtifactsDeleteCall) Header() http.Header {
10783 if c.header_ == nil {
10784 c.header_ = make(http.Header)
10785 }
10786 return c.header_
10787 }
10788
10789 func (c *ProjectsLocationsArtifactsDeleteCall) doRequest(alt string) (*http.Response, error) {
10790 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10791 c.urlParams_.Set("alt", alt)
10792 c.urlParams_.Set("prettyPrint", "false")
10793 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
10794 urls += "?" + c.urlParams_.Encode()
10795 req, err := http.NewRequest("DELETE", urls, nil)
10796 if err != nil {
10797 return nil, err
10798 }
10799 req.Header = reqHeaders
10800 googleapi.Expand(req.URL, map[string]string{
10801 "name": c.name,
10802 })
10803 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.delete", "request", internallog.HTTPRequest(req, nil))
10804 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10805 }
10806
10807 // Do executes the "apigeeregistry.projects.locations.artifacts.delete" call.
10808 // Any non-2xx status code is an error. Response headers are in either
10809 // *Empty.ServerResponse.Header or (if a response was returned at all) in
10810 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10811 // whether the returned error was because http.StatusNotModified was returned.
10812 func (c *ProjectsLocationsArtifactsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
10813 gensupport.SetOptions(c.urlParams_, opts...)
10814 res, err := c.doRequest("json")
10815 if res != nil && res.StatusCode == http.StatusNotModified {
10816 if res.Body != nil {
10817 res.Body.Close()
10818 }
10819 return nil, gensupport.WrapError(&googleapi.Error{
10820 Code: res.StatusCode,
10821 Header: res.Header,
10822 })
10823 }
10824 if err != nil {
10825 return nil, err
10826 }
10827 defer googleapi.CloseBody(res)
10828 if err := googleapi.CheckResponse(res); err != nil {
10829 return nil, gensupport.WrapError(err)
10830 }
10831 ret := &Empty{
10832 ServerResponse: googleapi.ServerResponse{
10833 Header: res.Header,
10834 HTTPStatusCode: res.StatusCode,
10835 },
10836 }
10837 target := &ret
10838 b, err := gensupport.DecodeResponseBytes(target, res)
10839 if err != nil {
10840 return nil, err
10841 }
10842 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.delete", "response", internallog.HTTPResponse(res, b))
10843 return ret, nil
10844 }
10845
10846 type ProjectsLocationsArtifactsGetCall struct {
10847 s *Service
10848 name string
10849 urlParams_ gensupport.URLParams
10850 ifNoneMatch_ string
10851 ctx_ context.Context
10852 header_ http.Header
10853 }
10854
10855 // Get: Returns a specified artifact.
10856 //
10857 // - name: The name of the artifact to retrieve. Format: `{parent}/artifacts/*`.
10858 func (r *ProjectsLocationsArtifactsService) Get(name string) *ProjectsLocationsArtifactsGetCall {
10859 c := &ProjectsLocationsArtifactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10860 c.name = name
10861 return c
10862 }
10863
10864 // Fields allows partial responses to be retrieved. See
10865 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10866 // details.
10867 func (c *ProjectsLocationsArtifactsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsGetCall {
10868 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10869 return c
10870 }
10871
10872 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10873 // object's ETag matches the given value. This is useful for getting updates
10874 // only after the object has changed since the last request.
10875 func (c *ProjectsLocationsArtifactsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsArtifactsGetCall {
10876 c.ifNoneMatch_ = entityTag
10877 return c
10878 }
10879
10880 // Context sets the context to be used in this call's Do method.
10881 func (c *ProjectsLocationsArtifactsGetCall) Context(ctx context.Context) *ProjectsLocationsArtifactsGetCall {
10882 c.ctx_ = ctx
10883 return c
10884 }
10885
10886 // Header returns a http.Header that can be modified by the caller to add
10887 // headers to the request.
10888 func (c *ProjectsLocationsArtifactsGetCall) Header() http.Header {
10889 if c.header_ == nil {
10890 c.header_ = make(http.Header)
10891 }
10892 return c.header_
10893 }
10894
10895 func (c *ProjectsLocationsArtifactsGetCall) doRequest(alt string) (*http.Response, error) {
10896 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10897 if c.ifNoneMatch_ != "" {
10898 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10899 }
10900 c.urlParams_.Set("alt", alt)
10901 c.urlParams_.Set("prettyPrint", "false")
10902 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
10903 urls += "?" + c.urlParams_.Encode()
10904 req, err := http.NewRequest("GET", urls, nil)
10905 if err != nil {
10906 return nil, err
10907 }
10908 req.Header = reqHeaders
10909 googleapi.Expand(req.URL, map[string]string{
10910 "name": c.name,
10911 })
10912 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.get", "request", internallog.HTTPRequest(req, nil))
10913 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10914 }
10915
10916 // Do executes the "apigeeregistry.projects.locations.artifacts.get" call.
10917 // Any non-2xx status code is an error. Response headers are in either
10918 // *Artifact.ServerResponse.Header or (if a response was returned at all) in
10919 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10920 // whether the returned error was because http.StatusNotModified was returned.
10921 func (c *ProjectsLocationsArtifactsGetCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
10922 gensupport.SetOptions(c.urlParams_, opts...)
10923 res, err := c.doRequest("json")
10924 if res != nil && res.StatusCode == http.StatusNotModified {
10925 if res.Body != nil {
10926 res.Body.Close()
10927 }
10928 return nil, gensupport.WrapError(&googleapi.Error{
10929 Code: res.StatusCode,
10930 Header: res.Header,
10931 })
10932 }
10933 if err != nil {
10934 return nil, err
10935 }
10936 defer googleapi.CloseBody(res)
10937 if err := googleapi.CheckResponse(res); err != nil {
10938 return nil, gensupport.WrapError(err)
10939 }
10940 ret := &Artifact{
10941 ServerResponse: googleapi.ServerResponse{
10942 Header: res.Header,
10943 HTTPStatusCode: res.StatusCode,
10944 },
10945 }
10946 target := &ret
10947 b, err := gensupport.DecodeResponseBytes(target, res)
10948 if err != nil {
10949 return nil, err
10950 }
10951 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.get", "response", internallog.HTTPResponse(res, b))
10952 return ret, nil
10953 }
10954
10955 type ProjectsLocationsArtifactsGetContentsCall struct {
10956 s *Service
10957 name string
10958 urlParams_ gensupport.URLParams
10959 ifNoneMatch_ string
10960 ctx_ context.Context
10961 header_ http.Header
10962 }
10963
10964 // GetContents: Returns the contents of a specified artifact. If artifacts are
10965 // stored with GZip compression, the default behavior is to return the artifact
10966 // uncompressed (the mime_type response field indicates the exact format
10967 // returned).
10968 //
10969 // - name: The name of the artifact whose contents should be retrieved. Format:
10970 // `{parent}/artifacts/*`.
10971 func (r *ProjectsLocationsArtifactsService) GetContents(name string) *ProjectsLocationsArtifactsGetContentsCall {
10972 c := &ProjectsLocationsArtifactsGetContentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10973 c.name = name
10974 return c
10975 }
10976
10977 // Fields allows partial responses to be retrieved. See
10978 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10979 // details.
10980 func (c *ProjectsLocationsArtifactsGetContentsCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsGetContentsCall {
10981 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10982 return c
10983 }
10984
10985 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10986 // object's ETag matches the given value. This is useful for getting updates
10987 // only after the object has changed since the last request.
10988 func (c *ProjectsLocationsArtifactsGetContentsCall) IfNoneMatch(entityTag string) *ProjectsLocationsArtifactsGetContentsCall {
10989 c.ifNoneMatch_ = entityTag
10990 return c
10991 }
10992
10993 // Context sets the context to be used in this call's Do method.
10994 func (c *ProjectsLocationsArtifactsGetContentsCall) Context(ctx context.Context) *ProjectsLocationsArtifactsGetContentsCall {
10995 c.ctx_ = ctx
10996 return c
10997 }
10998
10999 // Header returns a http.Header that can be modified by the caller to add
11000 // headers to the request.
11001 func (c *ProjectsLocationsArtifactsGetContentsCall) Header() http.Header {
11002 if c.header_ == nil {
11003 c.header_ = make(http.Header)
11004 }
11005 return c.header_
11006 }
11007
11008 func (c *ProjectsLocationsArtifactsGetContentsCall) doRequest(alt string) (*http.Response, error) {
11009 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11010 if c.ifNoneMatch_ != "" {
11011 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11012 }
11013 c.urlParams_.Set("alt", alt)
11014 c.urlParams_.Set("prettyPrint", "false")
11015 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getContents")
11016 urls += "?" + c.urlParams_.Encode()
11017 req, err := http.NewRequest("GET", urls, nil)
11018 if err != nil {
11019 return nil, err
11020 }
11021 req.Header = reqHeaders
11022 googleapi.Expand(req.URL, map[string]string{
11023 "name": c.name,
11024 })
11025 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.getContents", "request", internallog.HTTPRequest(req, nil))
11026 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11027 }
11028
11029 // Do executes the "apigeeregistry.projects.locations.artifacts.getContents" call.
11030 // Any non-2xx status code is an error. Response headers are in either
11031 // *HttpBody.ServerResponse.Header or (if a response was returned at all) in
11032 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11033 // whether the returned error was because http.StatusNotModified was returned.
11034 func (c *ProjectsLocationsArtifactsGetContentsCall) Do(opts ...googleapi.CallOption) (*HttpBody, error) {
11035 gensupport.SetOptions(c.urlParams_, opts...)
11036 res, err := c.doRequest("json")
11037 if res != nil && res.StatusCode == http.StatusNotModified {
11038 if res.Body != nil {
11039 res.Body.Close()
11040 }
11041 return nil, gensupport.WrapError(&googleapi.Error{
11042 Code: res.StatusCode,
11043 Header: res.Header,
11044 })
11045 }
11046 if err != nil {
11047 return nil, err
11048 }
11049 defer googleapi.CloseBody(res)
11050 if err := googleapi.CheckResponse(res); err != nil {
11051 return nil, gensupport.WrapError(err)
11052 }
11053 ret := &HttpBody{
11054 ServerResponse: googleapi.ServerResponse{
11055 Header: res.Header,
11056 HTTPStatusCode: res.StatusCode,
11057 },
11058 }
11059 target := &ret
11060 b, err := gensupport.DecodeResponseBytes(target, res)
11061 if err != nil {
11062 return nil, err
11063 }
11064 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.getContents", "response", internallog.HTTPResponse(res, b))
11065 return ret, nil
11066 }
11067
11068 type ProjectsLocationsArtifactsGetIamPolicyCall struct {
11069 s *Service
11070 resource string
11071 urlParams_ gensupport.URLParams
11072 ifNoneMatch_ string
11073 ctx_ context.Context
11074 header_ http.Header
11075 }
11076
11077 // GetIamPolicy: Gets the access control policy for a resource. Returns an
11078 // empty policy if the resource exists and does not have a policy set.
11079 //
11080 // - resource: REQUIRED: The resource for which the policy is being requested.
11081 // See Resource names (https://cloud.google.com/apis/design/resource_names)
11082 // for the appropriate value for this field.
11083 func (r *ProjectsLocationsArtifactsService) GetIamPolicy(resource string) *ProjectsLocationsArtifactsGetIamPolicyCall {
11084 c := &ProjectsLocationsArtifactsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11085 c.resource = resource
11086 return c
11087 }
11088
11089 // OptionsRequestedPolicyVersion sets the optional parameter
11090 // "options.requestedPolicyVersion": The maximum policy version that will be
11091 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
11092 // an invalid value will be rejected. Requests for policies with any
11093 // conditional role bindings must specify version 3. Policies with no
11094 // conditional role bindings may specify any valid value or leave the field
11095 // unset. The policy in the response might use the policy version that you
11096 // specified, or it might use a lower policy version. For example, if you
11097 // specify version 3, but the policy has no conditional role bindings, the
11098 // response uses version 1. To learn which resources support conditions in
11099 // their IAM policies, see the IAM documentation
11100 // (https://cloud.google.com/iam/help/conditions/resource-policies).
11101 func (c *ProjectsLocationsArtifactsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsArtifactsGetIamPolicyCall {
11102 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
11103 return c
11104 }
11105
11106 // Fields allows partial responses to be retrieved. See
11107 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11108 // details.
11109 func (c *ProjectsLocationsArtifactsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsGetIamPolicyCall {
11110 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11111 return c
11112 }
11113
11114 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11115 // object's ETag matches the given value. This is useful for getting updates
11116 // only after the object has changed since the last request.
11117 func (c *ProjectsLocationsArtifactsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsArtifactsGetIamPolicyCall {
11118 c.ifNoneMatch_ = entityTag
11119 return c
11120 }
11121
11122 // Context sets the context to be used in this call's Do method.
11123 func (c *ProjectsLocationsArtifactsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsArtifactsGetIamPolicyCall {
11124 c.ctx_ = ctx
11125 return c
11126 }
11127
11128 // Header returns a http.Header that can be modified by the caller to add
11129 // headers to the request.
11130 func (c *ProjectsLocationsArtifactsGetIamPolicyCall) Header() http.Header {
11131 if c.header_ == nil {
11132 c.header_ = make(http.Header)
11133 }
11134 return c.header_
11135 }
11136
11137 func (c *ProjectsLocationsArtifactsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
11138 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11139 if c.ifNoneMatch_ != "" {
11140 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11141 }
11142 c.urlParams_.Set("alt", alt)
11143 c.urlParams_.Set("prettyPrint", "false")
11144 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
11145 urls += "?" + c.urlParams_.Encode()
11146 req, err := http.NewRequest("GET", urls, nil)
11147 if err != nil {
11148 return nil, err
11149 }
11150 req.Header = reqHeaders
11151 googleapi.Expand(req.URL, map[string]string{
11152 "resource": c.resource,
11153 })
11154 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
11155 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11156 }
11157
11158 // Do executes the "apigeeregistry.projects.locations.artifacts.getIamPolicy" call.
11159 // Any non-2xx status code is an error. Response headers are in either
11160 // *Policy.ServerResponse.Header or (if a response was returned at all) in
11161 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11162 // whether the returned error was because http.StatusNotModified was returned.
11163 func (c *ProjectsLocationsArtifactsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
11164 gensupport.SetOptions(c.urlParams_, opts...)
11165 res, err := c.doRequest("json")
11166 if res != nil && res.StatusCode == http.StatusNotModified {
11167 if res.Body != nil {
11168 res.Body.Close()
11169 }
11170 return nil, gensupport.WrapError(&googleapi.Error{
11171 Code: res.StatusCode,
11172 Header: res.Header,
11173 })
11174 }
11175 if err != nil {
11176 return nil, err
11177 }
11178 defer googleapi.CloseBody(res)
11179 if err := googleapi.CheckResponse(res); err != nil {
11180 return nil, gensupport.WrapError(err)
11181 }
11182 ret := &Policy{
11183 ServerResponse: googleapi.ServerResponse{
11184 Header: res.Header,
11185 HTTPStatusCode: res.StatusCode,
11186 },
11187 }
11188 target := &ret
11189 b, err := gensupport.DecodeResponseBytes(target, res)
11190 if err != nil {
11191 return nil, err
11192 }
11193 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.getIamPolicy", "response", internallog.HTTPResponse(res, b))
11194 return ret, nil
11195 }
11196
11197 type ProjectsLocationsArtifactsListCall struct {
11198 s *Service
11199 parent string
11200 urlParams_ gensupport.URLParams
11201 ifNoneMatch_ string
11202 ctx_ context.Context
11203 header_ http.Header
11204 }
11205
11206 // List: Returns matching artifacts.
11207 //
11208 // - parent: The parent, which owns this collection of artifacts. Format:
11209 // `{parent}`.
11210 func (r *ProjectsLocationsArtifactsService) List(parent string) *ProjectsLocationsArtifactsListCall {
11211 c := &ProjectsLocationsArtifactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11212 c.parent = parent
11213 return c
11214 }
11215
11216 // Filter sets the optional parameter "filter": An expression that can be used
11217 // to filter the list. Filters use the Common Expression Language and can refer
11218 // to all message fields except contents.
11219 func (c *ProjectsLocationsArtifactsListCall) Filter(filter string) *ProjectsLocationsArtifactsListCall {
11220 c.urlParams_.Set("filter", filter)
11221 return c
11222 }
11223
11224 // OrderBy sets the optional parameter "orderBy": A comma-separated list of
11225 // fields, e.g. "foo,bar" Fields can be sorted in descending order using the
11226 // "desc" identifier, e.g. "foo desc,bar"
11227 func (c *ProjectsLocationsArtifactsListCall) OrderBy(orderBy string) *ProjectsLocationsArtifactsListCall {
11228 c.urlParams_.Set("orderBy", orderBy)
11229 return c
11230 }
11231
11232 // PageSize sets the optional parameter "pageSize": The maximum number of
11233 // artifacts to return. The service may return fewer than this value. If
11234 // unspecified, at most 50 values will be returned. The maximum is 1000; values
11235 // above 1000 will be coerced to 1000.
11236 func (c *ProjectsLocationsArtifactsListCall) PageSize(pageSize int64) *ProjectsLocationsArtifactsListCall {
11237 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
11238 return c
11239 }
11240
11241 // PageToken sets the optional parameter "pageToken": A page token, received
11242 // from a previous `ListArtifacts` call. Provide this to retrieve the
11243 // subsequent page. When paginating, all other parameters provided to
11244 // `ListArtifacts` must match the call that provided the page token.
11245 func (c *ProjectsLocationsArtifactsListCall) PageToken(pageToken string) *ProjectsLocationsArtifactsListCall {
11246 c.urlParams_.Set("pageToken", pageToken)
11247 return c
11248 }
11249
11250 // Fields allows partial responses to be retrieved. See
11251 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11252 // details.
11253 func (c *ProjectsLocationsArtifactsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsListCall {
11254 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11255 return c
11256 }
11257
11258 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11259 // object's ETag matches the given value. This is useful for getting updates
11260 // only after the object has changed since the last request.
11261 func (c *ProjectsLocationsArtifactsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsArtifactsListCall {
11262 c.ifNoneMatch_ = entityTag
11263 return c
11264 }
11265
11266 // Context sets the context to be used in this call's Do method.
11267 func (c *ProjectsLocationsArtifactsListCall) Context(ctx context.Context) *ProjectsLocationsArtifactsListCall {
11268 c.ctx_ = ctx
11269 return c
11270 }
11271
11272 // Header returns a http.Header that can be modified by the caller to add
11273 // headers to the request.
11274 func (c *ProjectsLocationsArtifactsListCall) Header() http.Header {
11275 if c.header_ == nil {
11276 c.header_ = make(http.Header)
11277 }
11278 return c.header_
11279 }
11280
11281 func (c *ProjectsLocationsArtifactsListCall) doRequest(alt string) (*http.Response, error) {
11282 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11283 if c.ifNoneMatch_ != "" {
11284 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11285 }
11286 c.urlParams_.Set("alt", alt)
11287 c.urlParams_.Set("prettyPrint", "false")
11288 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/artifacts")
11289 urls += "?" + c.urlParams_.Encode()
11290 req, err := http.NewRequest("GET", urls, nil)
11291 if err != nil {
11292 return nil, err
11293 }
11294 req.Header = reqHeaders
11295 googleapi.Expand(req.URL, map[string]string{
11296 "parent": c.parent,
11297 })
11298 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.list", "request", internallog.HTTPRequest(req, nil))
11299 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11300 }
11301
11302 // Do executes the "apigeeregistry.projects.locations.artifacts.list" call.
11303 // Any non-2xx status code is an error. Response headers are in either
11304 // *ListArtifactsResponse.ServerResponse.Header or (if a response was returned
11305 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11306 // check whether the returned error was because http.StatusNotModified was
11307 // returned.
11308 func (c *ProjectsLocationsArtifactsListCall) Do(opts ...googleapi.CallOption) (*ListArtifactsResponse, error) {
11309 gensupport.SetOptions(c.urlParams_, opts...)
11310 res, err := c.doRequest("json")
11311 if res != nil && res.StatusCode == http.StatusNotModified {
11312 if res.Body != nil {
11313 res.Body.Close()
11314 }
11315 return nil, gensupport.WrapError(&googleapi.Error{
11316 Code: res.StatusCode,
11317 Header: res.Header,
11318 })
11319 }
11320 if err != nil {
11321 return nil, err
11322 }
11323 defer googleapi.CloseBody(res)
11324 if err := googleapi.CheckResponse(res); err != nil {
11325 return nil, gensupport.WrapError(err)
11326 }
11327 ret := &ListArtifactsResponse{
11328 ServerResponse: googleapi.ServerResponse{
11329 Header: res.Header,
11330 HTTPStatusCode: res.StatusCode,
11331 },
11332 }
11333 target := &ret
11334 b, err := gensupport.DecodeResponseBytes(target, res)
11335 if err != nil {
11336 return nil, err
11337 }
11338 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.list", "response", internallog.HTTPResponse(res, b))
11339 return ret, nil
11340 }
11341
11342 // Pages invokes f for each page of results.
11343 // A non-nil error returned from f will halt the iteration.
11344 // The provided context supersedes any context provided to the Context method.
11345 func (c *ProjectsLocationsArtifactsListCall) Pages(ctx context.Context, f func(*ListArtifactsResponse) error) error {
11346 c.ctx_ = ctx
11347 defer c.PageToken(c.urlParams_.Get("pageToken"))
11348 for {
11349 x, err := c.Do()
11350 if err != nil {
11351 return err
11352 }
11353 if err := f(x); err != nil {
11354 return err
11355 }
11356 if x.NextPageToken == "" {
11357 return nil
11358 }
11359 c.PageToken(x.NextPageToken)
11360 }
11361 }
11362
11363 type ProjectsLocationsArtifactsReplaceArtifactCall struct {
11364 s *Service
11365 name string
11366 artifact *Artifact
11367 urlParams_ gensupport.URLParams
11368 ctx_ context.Context
11369 header_ http.Header
11370 }
11371
11372 // ReplaceArtifact: Used to replace a specified artifact.
11373 //
11374 // - name: Resource name.
11375 func (r *ProjectsLocationsArtifactsService) ReplaceArtifact(name string, artifact *Artifact) *ProjectsLocationsArtifactsReplaceArtifactCall {
11376 c := &ProjectsLocationsArtifactsReplaceArtifactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11377 c.name = name
11378 c.artifact = artifact
11379 return c
11380 }
11381
11382 // Fields allows partial responses to be retrieved. See
11383 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11384 // details.
11385 func (c *ProjectsLocationsArtifactsReplaceArtifactCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsReplaceArtifactCall {
11386 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11387 return c
11388 }
11389
11390 // Context sets the context to be used in this call's Do method.
11391 func (c *ProjectsLocationsArtifactsReplaceArtifactCall) Context(ctx context.Context) *ProjectsLocationsArtifactsReplaceArtifactCall {
11392 c.ctx_ = ctx
11393 return c
11394 }
11395
11396 // Header returns a http.Header that can be modified by the caller to add
11397 // headers to the request.
11398 func (c *ProjectsLocationsArtifactsReplaceArtifactCall) Header() http.Header {
11399 if c.header_ == nil {
11400 c.header_ = make(http.Header)
11401 }
11402 return c.header_
11403 }
11404
11405 func (c *ProjectsLocationsArtifactsReplaceArtifactCall) doRequest(alt string) (*http.Response, error) {
11406 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11407 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.artifact)
11408 if err != nil {
11409 return nil, err
11410 }
11411 c.urlParams_.Set("alt", alt)
11412 c.urlParams_.Set("prettyPrint", "false")
11413 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
11414 urls += "?" + c.urlParams_.Encode()
11415 req, err := http.NewRequest("PUT", urls, body)
11416 if err != nil {
11417 return nil, err
11418 }
11419 req.Header = reqHeaders
11420 googleapi.Expand(req.URL, map[string]string{
11421 "name": c.name,
11422 })
11423 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.replaceArtifact", "request", internallog.HTTPRequest(req, body.Bytes()))
11424 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11425 }
11426
11427 // Do executes the "apigeeregistry.projects.locations.artifacts.replaceArtifact" call.
11428 // Any non-2xx status code is an error. Response headers are in either
11429 // *Artifact.ServerResponse.Header or (if a response was returned at all) in
11430 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11431 // whether the returned error was because http.StatusNotModified was returned.
11432 func (c *ProjectsLocationsArtifactsReplaceArtifactCall) Do(opts ...googleapi.CallOption) (*Artifact, error) {
11433 gensupport.SetOptions(c.urlParams_, opts...)
11434 res, err := c.doRequest("json")
11435 if res != nil && res.StatusCode == http.StatusNotModified {
11436 if res.Body != nil {
11437 res.Body.Close()
11438 }
11439 return nil, gensupport.WrapError(&googleapi.Error{
11440 Code: res.StatusCode,
11441 Header: res.Header,
11442 })
11443 }
11444 if err != nil {
11445 return nil, err
11446 }
11447 defer googleapi.CloseBody(res)
11448 if err := googleapi.CheckResponse(res); err != nil {
11449 return nil, gensupport.WrapError(err)
11450 }
11451 ret := &Artifact{
11452 ServerResponse: googleapi.ServerResponse{
11453 Header: res.Header,
11454 HTTPStatusCode: res.StatusCode,
11455 },
11456 }
11457 target := &ret
11458 b, err := gensupport.DecodeResponseBytes(target, res)
11459 if err != nil {
11460 return nil, err
11461 }
11462 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.replaceArtifact", "response", internallog.HTTPResponse(res, b))
11463 return ret, nil
11464 }
11465
11466 type ProjectsLocationsArtifactsSetIamPolicyCall struct {
11467 s *Service
11468 resource string
11469 setiampolicyrequest *SetIamPolicyRequest
11470 urlParams_ gensupport.URLParams
11471 ctx_ context.Context
11472 header_ http.Header
11473 }
11474
11475 // SetIamPolicy: Sets the access control policy on the specified resource.
11476 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
11477 // and `PERMISSION_DENIED` errors.
11478 //
11479 // - resource: REQUIRED: The resource for which the policy is being specified.
11480 // See Resource names (https://cloud.google.com/apis/design/resource_names)
11481 // for the appropriate value for this field.
11482 func (r *ProjectsLocationsArtifactsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsArtifactsSetIamPolicyCall {
11483 c := &ProjectsLocationsArtifactsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11484 c.resource = resource
11485 c.setiampolicyrequest = setiampolicyrequest
11486 return c
11487 }
11488
11489 // Fields allows partial responses to be retrieved. See
11490 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11491 // details.
11492 func (c *ProjectsLocationsArtifactsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsSetIamPolicyCall {
11493 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11494 return c
11495 }
11496
11497 // Context sets the context to be used in this call's Do method.
11498 func (c *ProjectsLocationsArtifactsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsArtifactsSetIamPolicyCall {
11499 c.ctx_ = ctx
11500 return c
11501 }
11502
11503 // Header returns a http.Header that can be modified by the caller to add
11504 // headers to the request.
11505 func (c *ProjectsLocationsArtifactsSetIamPolicyCall) Header() http.Header {
11506 if c.header_ == nil {
11507 c.header_ = make(http.Header)
11508 }
11509 return c.header_
11510 }
11511
11512 func (c *ProjectsLocationsArtifactsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
11513 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11514 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
11515 if err != nil {
11516 return nil, err
11517 }
11518 c.urlParams_.Set("alt", alt)
11519 c.urlParams_.Set("prettyPrint", "false")
11520 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
11521 urls += "?" + c.urlParams_.Encode()
11522 req, err := http.NewRequest("POST", urls, body)
11523 if err != nil {
11524 return nil, err
11525 }
11526 req.Header = reqHeaders
11527 googleapi.Expand(req.URL, map[string]string{
11528 "resource": c.resource,
11529 })
11530 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
11531 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11532 }
11533
11534 // Do executes the "apigeeregistry.projects.locations.artifacts.setIamPolicy" call.
11535 // Any non-2xx status code is an error. Response headers are in either
11536 // *Policy.ServerResponse.Header or (if a response was returned at all) in
11537 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11538 // whether the returned error was because http.StatusNotModified was returned.
11539 func (c *ProjectsLocationsArtifactsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
11540 gensupport.SetOptions(c.urlParams_, opts...)
11541 res, err := c.doRequest("json")
11542 if res != nil && res.StatusCode == http.StatusNotModified {
11543 if res.Body != nil {
11544 res.Body.Close()
11545 }
11546 return nil, gensupport.WrapError(&googleapi.Error{
11547 Code: res.StatusCode,
11548 Header: res.Header,
11549 })
11550 }
11551 if err != nil {
11552 return nil, err
11553 }
11554 defer googleapi.CloseBody(res)
11555 if err := googleapi.CheckResponse(res); err != nil {
11556 return nil, gensupport.WrapError(err)
11557 }
11558 ret := &Policy{
11559 ServerResponse: googleapi.ServerResponse{
11560 Header: res.Header,
11561 HTTPStatusCode: res.StatusCode,
11562 },
11563 }
11564 target := &ret
11565 b, err := gensupport.DecodeResponseBytes(target, res)
11566 if err != nil {
11567 return nil, err
11568 }
11569 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.setIamPolicy", "response", internallog.HTTPResponse(res, b))
11570 return ret, nil
11571 }
11572
11573 type ProjectsLocationsArtifactsTestIamPermissionsCall struct {
11574 s *Service
11575 resource string
11576 testiampermissionsrequest *TestIamPermissionsRequest
11577 urlParams_ gensupport.URLParams
11578 ctx_ context.Context
11579 header_ http.Header
11580 }
11581
11582 // TestIamPermissions: Returns permissions that a caller has on the specified
11583 // resource. If the resource does not exist, this will return an empty set of
11584 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
11585 // used for building permission-aware UIs and command-line tools, not for
11586 // authorization checking. This operation may "fail open" without warning.
11587 //
11588 // - resource: REQUIRED: The resource for which the policy detail is being
11589 // requested. See Resource names
11590 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
11591 // value for this field.
11592 func (r *ProjectsLocationsArtifactsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsArtifactsTestIamPermissionsCall {
11593 c := &ProjectsLocationsArtifactsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11594 c.resource = resource
11595 c.testiampermissionsrequest = testiampermissionsrequest
11596 return c
11597 }
11598
11599 // Fields allows partial responses to be retrieved. See
11600 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11601 // details.
11602 func (c *ProjectsLocationsArtifactsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsArtifactsTestIamPermissionsCall {
11603 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11604 return c
11605 }
11606
11607 // Context sets the context to be used in this call's Do method.
11608 func (c *ProjectsLocationsArtifactsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsArtifactsTestIamPermissionsCall {
11609 c.ctx_ = ctx
11610 return c
11611 }
11612
11613 // Header returns a http.Header that can be modified by the caller to add
11614 // headers to the request.
11615 func (c *ProjectsLocationsArtifactsTestIamPermissionsCall) Header() http.Header {
11616 if c.header_ == nil {
11617 c.header_ = make(http.Header)
11618 }
11619 return c.header_
11620 }
11621
11622 func (c *ProjectsLocationsArtifactsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
11623 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11624 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
11625 if err != nil {
11626 return nil, err
11627 }
11628 c.urlParams_.Set("alt", alt)
11629 c.urlParams_.Set("prettyPrint", "false")
11630 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
11631 urls += "?" + c.urlParams_.Encode()
11632 req, err := http.NewRequest("POST", urls, body)
11633 if err != nil {
11634 return nil, err
11635 }
11636 req.Header = reqHeaders
11637 googleapi.Expand(req.URL, map[string]string{
11638 "resource": c.resource,
11639 })
11640 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
11641 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11642 }
11643
11644 // Do executes the "apigeeregistry.projects.locations.artifacts.testIamPermissions" call.
11645 // Any non-2xx status code is an error. Response headers are in either
11646 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
11647 // returned at all) in error.(*googleapi.Error).Header. Use
11648 // googleapi.IsNotModified to check whether the returned error was because
11649 // http.StatusNotModified was returned.
11650 func (c *ProjectsLocationsArtifactsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
11651 gensupport.SetOptions(c.urlParams_, opts...)
11652 res, err := c.doRequest("json")
11653 if res != nil && res.StatusCode == http.StatusNotModified {
11654 if res.Body != nil {
11655 res.Body.Close()
11656 }
11657 return nil, gensupport.WrapError(&googleapi.Error{
11658 Code: res.StatusCode,
11659 Header: res.Header,
11660 })
11661 }
11662 if err != nil {
11663 return nil, err
11664 }
11665 defer googleapi.CloseBody(res)
11666 if err := googleapi.CheckResponse(res); err != nil {
11667 return nil, gensupport.WrapError(err)
11668 }
11669 ret := &TestIamPermissionsResponse{
11670 ServerResponse: googleapi.ServerResponse{
11671 Header: res.Header,
11672 HTTPStatusCode: res.StatusCode,
11673 },
11674 }
11675 target := &ret
11676 b, err := gensupport.DecodeResponseBytes(target, res)
11677 if err != nil {
11678 return nil, err
11679 }
11680 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.artifacts.testIamPermissions", "response", internallog.HTTPResponse(res, b))
11681 return ret, nil
11682 }
11683
11684 type ProjectsLocationsDocumentsGetIamPolicyCall struct {
11685 s *Service
11686 resource string
11687 urlParams_ gensupport.URLParams
11688 ifNoneMatch_ string
11689 ctx_ context.Context
11690 header_ http.Header
11691 }
11692
11693 // GetIamPolicy: Gets the access control policy for a resource. Returns an
11694 // empty policy if the resource exists and does not have a policy set.
11695 //
11696 // - resource: REQUIRED: The resource for which the policy is being requested.
11697 // See Resource names (https://cloud.google.com/apis/design/resource_names)
11698 // for the appropriate value for this field.
11699 func (r *ProjectsLocationsDocumentsService) GetIamPolicy(resource string) *ProjectsLocationsDocumentsGetIamPolicyCall {
11700 c := &ProjectsLocationsDocumentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11701 c.resource = resource
11702 return c
11703 }
11704
11705 // OptionsRequestedPolicyVersion sets the optional parameter
11706 // "options.requestedPolicyVersion": The maximum policy version that will be
11707 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
11708 // an invalid value will be rejected. Requests for policies with any
11709 // conditional role bindings must specify version 3. Policies with no
11710 // conditional role bindings may specify any valid value or leave the field
11711 // unset. The policy in the response might use the policy version that you
11712 // specified, or it might use a lower policy version. For example, if you
11713 // specify version 3, but the policy has no conditional role bindings, the
11714 // response uses version 1. To learn which resources support conditions in
11715 // their IAM policies, see the IAM documentation
11716 // (https://cloud.google.com/iam/help/conditions/resource-policies).
11717 func (c *ProjectsLocationsDocumentsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsDocumentsGetIamPolicyCall {
11718 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
11719 return c
11720 }
11721
11722 // Fields allows partial responses to be retrieved. See
11723 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11724 // details.
11725 func (c *ProjectsLocationsDocumentsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsDocumentsGetIamPolicyCall {
11726 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11727 return c
11728 }
11729
11730 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11731 // object's ETag matches the given value. This is useful for getting updates
11732 // only after the object has changed since the last request.
11733 func (c *ProjectsLocationsDocumentsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsDocumentsGetIamPolicyCall {
11734 c.ifNoneMatch_ = entityTag
11735 return c
11736 }
11737
11738 // Context sets the context to be used in this call's Do method.
11739 func (c *ProjectsLocationsDocumentsGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsDocumentsGetIamPolicyCall {
11740 c.ctx_ = ctx
11741 return c
11742 }
11743
11744 // Header returns a http.Header that can be modified by the caller to add
11745 // headers to the request.
11746 func (c *ProjectsLocationsDocumentsGetIamPolicyCall) Header() http.Header {
11747 if c.header_ == nil {
11748 c.header_ = make(http.Header)
11749 }
11750 return c.header_
11751 }
11752
11753 func (c *ProjectsLocationsDocumentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
11754 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11755 if c.ifNoneMatch_ != "" {
11756 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11757 }
11758 c.urlParams_.Set("alt", alt)
11759 c.urlParams_.Set("prettyPrint", "false")
11760 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
11761 urls += "?" + c.urlParams_.Encode()
11762 req, err := http.NewRequest("GET", urls, nil)
11763 if err != nil {
11764 return nil, err
11765 }
11766 req.Header = reqHeaders
11767 googleapi.Expand(req.URL, map[string]string{
11768 "resource": c.resource,
11769 })
11770 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.documents.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
11771 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11772 }
11773
11774 // Do executes the "apigeeregistry.projects.locations.documents.getIamPolicy" call.
11775 // Any non-2xx status code is an error. Response headers are in either
11776 // *Policy.ServerResponse.Header or (if a response was returned at all) in
11777 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11778 // whether the returned error was because http.StatusNotModified was returned.
11779 func (c *ProjectsLocationsDocumentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
11780 gensupport.SetOptions(c.urlParams_, opts...)
11781 res, err := c.doRequest("json")
11782 if res != nil && res.StatusCode == http.StatusNotModified {
11783 if res.Body != nil {
11784 res.Body.Close()
11785 }
11786 return nil, gensupport.WrapError(&googleapi.Error{
11787 Code: res.StatusCode,
11788 Header: res.Header,
11789 })
11790 }
11791 if err != nil {
11792 return nil, err
11793 }
11794 defer googleapi.CloseBody(res)
11795 if err := googleapi.CheckResponse(res); err != nil {
11796 return nil, gensupport.WrapError(err)
11797 }
11798 ret := &Policy{
11799 ServerResponse: googleapi.ServerResponse{
11800 Header: res.Header,
11801 HTTPStatusCode: res.StatusCode,
11802 },
11803 }
11804 target := &ret
11805 b, err := gensupport.DecodeResponseBytes(target, res)
11806 if err != nil {
11807 return nil, err
11808 }
11809 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.documents.getIamPolicy", "response", internallog.HTTPResponse(res, b))
11810 return ret, nil
11811 }
11812
11813 type ProjectsLocationsDocumentsSetIamPolicyCall struct {
11814 s *Service
11815 resource string
11816 setiampolicyrequest *SetIamPolicyRequest
11817 urlParams_ gensupport.URLParams
11818 ctx_ context.Context
11819 header_ http.Header
11820 }
11821
11822 // SetIamPolicy: Sets the access control policy on the specified resource.
11823 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
11824 // and `PERMISSION_DENIED` errors.
11825 //
11826 // - resource: REQUIRED: The resource for which the policy is being specified.
11827 // See Resource names (https://cloud.google.com/apis/design/resource_names)
11828 // for the appropriate value for this field.
11829 func (r *ProjectsLocationsDocumentsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsDocumentsSetIamPolicyCall {
11830 c := &ProjectsLocationsDocumentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11831 c.resource = resource
11832 c.setiampolicyrequest = setiampolicyrequest
11833 return c
11834 }
11835
11836 // Fields allows partial responses to be retrieved. See
11837 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11838 // details.
11839 func (c *ProjectsLocationsDocumentsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsDocumentsSetIamPolicyCall {
11840 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11841 return c
11842 }
11843
11844 // Context sets the context to be used in this call's Do method.
11845 func (c *ProjectsLocationsDocumentsSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsDocumentsSetIamPolicyCall {
11846 c.ctx_ = ctx
11847 return c
11848 }
11849
11850 // Header returns a http.Header that can be modified by the caller to add
11851 // headers to the request.
11852 func (c *ProjectsLocationsDocumentsSetIamPolicyCall) Header() http.Header {
11853 if c.header_ == nil {
11854 c.header_ = make(http.Header)
11855 }
11856 return c.header_
11857 }
11858
11859 func (c *ProjectsLocationsDocumentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
11860 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11861 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
11862 if err != nil {
11863 return nil, err
11864 }
11865 c.urlParams_.Set("alt", alt)
11866 c.urlParams_.Set("prettyPrint", "false")
11867 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
11868 urls += "?" + c.urlParams_.Encode()
11869 req, err := http.NewRequest("POST", urls, body)
11870 if err != nil {
11871 return nil, err
11872 }
11873 req.Header = reqHeaders
11874 googleapi.Expand(req.URL, map[string]string{
11875 "resource": c.resource,
11876 })
11877 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.documents.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
11878 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11879 }
11880
11881 // Do executes the "apigeeregistry.projects.locations.documents.setIamPolicy" call.
11882 // Any non-2xx status code is an error. Response headers are in either
11883 // *Policy.ServerResponse.Header or (if a response was returned at all) in
11884 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11885 // whether the returned error was because http.StatusNotModified was returned.
11886 func (c *ProjectsLocationsDocumentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
11887 gensupport.SetOptions(c.urlParams_, opts...)
11888 res, err := c.doRequest("json")
11889 if res != nil && res.StatusCode == http.StatusNotModified {
11890 if res.Body != nil {
11891 res.Body.Close()
11892 }
11893 return nil, gensupport.WrapError(&googleapi.Error{
11894 Code: res.StatusCode,
11895 Header: res.Header,
11896 })
11897 }
11898 if err != nil {
11899 return nil, err
11900 }
11901 defer googleapi.CloseBody(res)
11902 if err := googleapi.CheckResponse(res); err != nil {
11903 return nil, gensupport.WrapError(err)
11904 }
11905 ret := &Policy{
11906 ServerResponse: googleapi.ServerResponse{
11907 Header: res.Header,
11908 HTTPStatusCode: res.StatusCode,
11909 },
11910 }
11911 target := &ret
11912 b, err := gensupport.DecodeResponseBytes(target, res)
11913 if err != nil {
11914 return nil, err
11915 }
11916 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.documents.setIamPolicy", "response", internallog.HTTPResponse(res, b))
11917 return ret, nil
11918 }
11919
11920 type ProjectsLocationsDocumentsTestIamPermissionsCall struct {
11921 s *Service
11922 resource string
11923 testiampermissionsrequest *TestIamPermissionsRequest
11924 urlParams_ gensupport.URLParams
11925 ctx_ context.Context
11926 header_ http.Header
11927 }
11928
11929 // TestIamPermissions: Returns permissions that a caller has on the specified
11930 // resource. If the resource does not exist, this will return an empty set of
11931 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
11932 // used for building permission-aware UIs and command-line tools, not for
11933 // authorization checking. This operation may "fail open" without warning.
11934 //
11935 // - resource: REQUIRED: The resource for which the policy detail is being
11936 // requested. See Resource names
11937 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
11938 // value for this field.
11939 func (r *ProjectsLocationsDocumentsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsDocumentsTestIamPermissionsCall {
11940 c := &ProjectsLocationsDocumentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11941 c.resource = resource
11942 c.testiampermissionsrequest = testiampermissionsrequest
11943 return c
11944 }
11945
11946 // Fields allows partial responses to be retrieved. See
11947 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11948 // details.
11949 func (c *ProjectsLocationsDocumentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsDocumentsTestIamPermissionsCall {
11950 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11951 return c
11952 }
11953
11954 // Context sets the context to be used in this call's Do method.
11955 func (c *ProjectsLocationsDocumentsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsDocumentsTestIamPermissionsCall {
11956 c.ctx_ = ctx
11957 return c
11958 }
11959
11960 // Header returns a http.Header that can be modified by the caller to add
11961 // headers to the request.
11962 func (c *ProjectsLocationsDocumentsTestIamPermissionsCall) Header() http.Header {
11963 if c.header_ == nil {
11964 c.header_ = make(http.Header)
11965 }
11966 return c.header_
11967 }
11968
11969 func (c *ProjectsLocationsDocumentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
11970 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11971 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
11972 if err != nil {
11973 return nil, err
11974 }
11975 c.urlParams_.Set("alt", alt)
11976 c.urlParams_.Set("prettyPrint", "false")
11977 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
11978 urls += "?" + c.urlParams_.Encode()
11979 req, err := http.NewRequest("POST", urls, body)
11980 if err != nil {
11981 return nil, err
11982 }
11983 req.Header = reqHeaders
11984 googleapi.Expand(req.URL, map[string]string{
11985 "resource": c.resource,
11986 })
11987 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.documents.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
11988 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11989 }
11990
11991 // Do executes the "apigeeregistry.projects.locations.documents.testIamPermissions" call.
11992 // Any non-2xx status code is an error. Response headers are in either
11993 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
11994 // returned at all) in error.(*googleapi.Error).Header. Use
11995 // googleapi.IsNotModified to check whether the returned error was because
11996 // http.StatusNotModified was returned.
11997 func (c *ProjectsLocationsDocumentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
11998 gensupport.SetOptions(c.urlParams_, opts...)
11999 res, err := c.doRequest("json")
12000 if res != nil && res.StatusCode == http.StatusNotModified {
12001 if res.Body != nil {
12002 res.Body.Close()
12003 }
12004 return nil, gensupport.WrapError(&googleapi.Error{
12005 Code: res.StatusCode,
12006 Header: res.Header,
12007 })
12008 }
12009 if err != nil {
12010 return nil, err
12011 }
12012 defer googleapi.CloseBody(res)
12013 if err := googleapi.CheckResponse(res); err != nil {
12014 return nil, gensupport.WrapError(err)
12015 }
12016 ret := &TestIamPermissionsResponse{
12017 ServerResponse: googleapi.ServerResponse{
12018 Header: res.Header,
12019 HTTPStatusCode: res.StatusCode,
12020 },
12021 }
12022 target := &ret
12023 b, err := gensupport.DecodeResponseBytes(target, res)
12024 if err != nil {
12025 return nil, err
12026 }
12027 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.documents.testIamPermissions", "response", internallog.HTTPResponse(res, b))
12028 return ret, nil
12029 }
12030
12031 type ProjectsLocationsInstancesCreateCall struct {
12032 s *Service
12033 parent string
12034 instance *Instance
12035 urlParams_ gensupport.URLParams
12036 ctx_ context.Context
12037 header_ http.Header
12038 }
12039
12040 // Create: Provisions instance resources for the Registry.
12041 //
12042 // - parent: Parent resource of the Instance, of the form:
12043 // `projects/*/locations/*`.
12044 func (r *ProjectsLocationsInstancesService) Create(parent string, instance *Instance) *ProjectsLocationsInstancesCreateCall {
12045 c := &ProjectsLocationsInstancesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12046 c.parent = parent
12047 c.instance = instance
12048 return c
12049 }
12050
12051 // InstanceId sets the optional parameter "instanceId": Required. Identifier to
12052 // assign to the Instance. Must be unique within scope of the parent resource.
12053 func (c *ProjectsLocationsInstancesCreateCall) InstanceId(instanceId string) *ProjectsLocationsInstancesCreateCall {
12054 c.urlParams_.Set("instanceId", instanceId)
12055 return c
12056 }
12057
12058 // Fields allows partial responses to be retrieved. See
12059 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12060 // details.
12061 func (c *ProjectsLocationsInstancesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesCreateCall {
12062 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12063 return c
12064 }
12065
12066 // Context sets the context to be used in this call's Do method.
12067 func (c *ProjectsLocationsInstancesCreateCall) Context(ctx context.Context) *ProjectsLocationsInstancesCreateCall {
12068 c.ctx_ = ctx
12069 return c
12070 }
12071
12072 // Header returns a http.Header that can be modified by the caller to add
12073 // headers to the request.
12074 func (c *ProjectsLocationsInstancesCreateCall) Header() http.Header {
12075 if c.header_ == nil {
12076 c.header_ = make(http.Header)
12077 }
12078 return c.header_
12079 }
12080
12081 func (c *ProjectsLocationsInstancesCreateCall) doRequest(alt string) (*http.Response, error) {
12082 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12083 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.instance)
12084 if err != nil {
12085 return nil, err
12086 }
12087 c.urlParams_.Set("alt", alt)
12088 c.urlParams_.Set("prettyPrint", "false")
12089 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/instances")
12090 urls += "?" + c.urlParams_.Encode()
12091 req, err := http.NewRequest("POST", urls, body)
12092 if err != nil {
12093 return nil, err
12094 }
12095 req.Header = reqHeaders
12096 googleapi.Expand(req.URL, map[string]string{
12097 "parent": c.parent,
12098 })
12099 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.instances.create", "request", internallog.HTTPRequest(req, body.Bytes()))
12100 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12101 }
12102
12103 // Do executes the "apigeeregistry.projects.locations.instances.create" call.
12104 // Any non-2xx status code is an error. Response headers are in either
12105 // *Operation.ServerResponse.Header or (if a response was returned at all) in
12106 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12107 // whether the returned error was because http.StatusNotModified was returned.
12108 func (c *ProjectsLocationsInstancesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
12109 gensupport.SetOptions(c.urlParams_, opts...)
12110 res, err := c.doRequest("json")
12111 if res != nil && res.StatusCode == http.StatusNotModified {
12112 if res.Body != nil {
12113 res.Body.Close()
12114 }
12115 return nil, gensupport.WrapError(&googleapi.Error{
12116 Code: res.StatusCode,
12117 Header: res.Header,
12118 })
12119 }
12120 if err != nil {
12121 return nil, err
12122 }
12123 defer googleapi.CloseBody(res)
12124 if err := googleapi.CheckResponse(res); err != nil {
12125 return nil, gensupport.WrapError(err)
12126 }
12127 ret := &Operation{
12128 ServerResponse: googleapi.ServerResponse{
12129 Header: res.Header,
12130 HTTPStatusCode: res.StatusCode,
12131 },
12132 }
12133 target := &ret
12134 b, err := gensupport.DecodeResponseBytes(target, res)
12135 if err != nil {
12136 return nil, err
12137 }
12138 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.instances.create", "response", internallog.HTTPResponse(res, b))
12139 return ret, nil
12140 }
12141
12142 type ProjectsLocationsInstancesDeleteCall struct {
12143 s *Service
12144 name string
12145 urlParams_ gensupport.URLParams
12146 ctx_ context.Context
12147 header_ http.Header
12148 }
12149
12150 // Delete: Deletes the Registry instance.
12151 //
12152 // - name: The name of the Instance to delete. Format:
12153 // `projects/*/locations/*/instances/*`.
12154 func (r *ProjectsLocationsInstancesService) Delete(name string) *ProjectsLocationsInstancesDeleteCall {
12155 c := &ProjectsLocationsInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12156 c.name = name
12157 return c
12158 }
12159
12160 // Fields allows partial responses to be retrieved. See
12161 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12162 // details.
12163 func (c *ProjectsLocationsInstancesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesDeleteCall {
12164 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12165 return c
12166 }
12167
12168 // Context sets the context to be used in this call's Do method.
12169 func (c *ProjectsLocationsInstancesDeleteCall) Context(ctx context.Context) *ProjectsLocationsInstancesDeleteCall {
12170 c.ctx_ = ctx
12171 return c
12172 }
12173
12174 // Header returns a http.Header that can be modified by the caller to add
12175 // headers to the request.
12176 func (c *ProjectsLocationsInstancesDeleteCall) Header() http.Header {
12177 if c.header_ == nil {
12178 c.header_ = make(http.Header)
12179 }
12180 return c.header_
12181 }
12182
12183 func (c *ProjectsLocationsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
12184 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12185 c.urlParams_.Set("alt", alt)
12186 c.urlParams_.Set("prettyPrint", "false")
12187 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
12188 urls += "?" + c.urlParams_.Encode()
12189 req, err := http.NewRequest("DELETE", urls, nil)
12190 if err != nil {
12191 return nil, err
12192 }
12193 req.Header = reqHeaders
12194 googleapi.Expand(req.URL, map[string]string{
12195 "name": c.name,
12196 })
12197 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.instances.delete", "request", internallog.HTTPRequest(req, nil))
12198 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12199 }
12200
12201 // Do executes the "apigeeregistry.projects.locations.instances.delete" call.
12202 // Any non-2xx status code is an error. Response headers are in either
12203 // *Operation.ServerResponse.Header or (if a response was returned at all) in
12204 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12205 // whether the returned error was because http.StatusNotModified was returned.
12206 func (c *ProjectsLocationsInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
12207 gensupport.SetOptions(c.urlParams_, opts...)
12208 res, err := c.doRequest("json")
12209 if res != nil && res.StatusCode == http.StatusNotModified {
12210 if res.Body != nil {
12211 res.Body.Close()
12212 }
12213 return nil, gensupport.WrapError(&googleapi.Error{
12214 Code: res.StatusCode,
12215 Header: res.Header,
12216 })
12217 }
12218 if err != nil {
12219 return nil, err
12220 }
12221 defer googleapi.CloseBody(res)
12222 if err := googleapi.CheckResponse(res); err != nil {
12223 return nil, gensupport.WrapError(err)
12224 }
12225 ret := &Operation{
12226 ServerResponse: googleapi.ServerResponse{
12227 Header: res.Header,
12228 HTTPStatusCode: res.StatusCode,
12229 },
12230 }
12231 target := &ret
12232 b, err := gensupport.DecodeResponseBytes(target, res)
12233 if err != nil {
12234 return nil, err
12235 }
12236 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.instances.delete", "response", internallog.HTTPResponse(res, b))
12237 return ret, nil
12238 }
12239
12240 type ProjectsLocationsInstancesGetCall struct {
12241 s *Service
12242 name string
12243 urlParams_ gensupport.URLParams
12244 ifNoneMatch_ string
12245 ctx_ context.Context
12246 header_ http.Header
12247 }
12248
12249 // Get: Gets details of a single Instance.
12250 //
12251 // - name: The name of the Instance to retrieve. Format:
12252 // `projects/*/locations/*/instances/*`.
12253 func (r *ProjectsLocationsInstancesService) Get(name string) *ProjectsLocationsInstancesGetCall {
12254 c := &ProjectsLocationsInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12255 c.name = name
12256 return c
12257 }
12258
12259 // Fields allows partial responses to be retrieved. See
12260 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12261 // details.
12262 func (c *ProjectsLocationsInstancesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetCall {
12263 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12264 return c
12265 }
12266
12267 // IfNoneMatch sets an optional parameter which makes the operation fail if the
12268 // object's ETag matches the given value. This is useful for getting updates
12269 // only after the object has changed since the last request.
12270 func (c *ProjectsLocationsInstancesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetCall {
12271 c.ifNoneMatch_ = entityTag
12272 return c
12273 }
12274
12275 // Context sets the context to be used in this call's Do method.
12276 func (c *ProjectsLocationsInstancesGetCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetCall {
12277 c.ctx_ = ctx
12278 return c
12279 }
12280
12281 // Header returns a http.Header that can be modified by the caller to add
12282 // headers to the request.
12283 func (c *ProjectsLocationsInstancesGetCall) Header() http.Header {
12284 if c.header_ == nil {
12285 c.header_ = make(http.Header)
12286 }
12287 return c.header_
12288 }
12289
12290 func (c *ProjectsLocationsInstancesGetCall) doRequest(alt string) (*http.Response, error) {
12291 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12292 if c.ifNoneMatch_ != "" {
12293 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12294 }
12295 c.urlParams_.Set("alt", alt)
12296 c.urlParams_.Set("prettyPrint", "false")
12297 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
12298 urls += "?" + c.urlParams_.Encode()
12299 req, err := http.NewRequest("GET", urls, nil)
12300 if err != nil {
12301 return nil, err
12302 }
12303 req.Header = reqHeaders
12304 googleapi.Expand(req.URL, map[string]string{
12305 "name": c.name,
12306 })
12307 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.instances.get", "request", internallog.HTTPRequest(req, nil))
12308 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12309 }
12310
12311 // Do executes the "apigeeregistry.projects.locations.instances.get" call.
12312 // Any non-2xx status code is an error. Response headers are in either
12313 // *Instance.ServerResponse.Header or (if a response was returned at all) in
12314 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12315 // whether the returned error was because http.StatusNotModified was returned.
12316 func (c *ProjectsLocationsInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
12317 gensupport.SetOptions(c.urlParams_, opts...)
12318 res, err := c.doRequest("json")
12319 if res != nil && res.StatusCode == http.StatusNotModified {
12320 if res.Body != nil {
12321 res.Body.Close()
12322 }
12323 return nil, gensupport.WrapError(&googleapi.Error{
12324 Code: res.StatusCode,
12325 Header: res.Header,
12326 })
12327 }
12328 if err != nil {
12329 return nil, err
12330 }
12331 defer googleapi.CloseBody(res)
12332 if err := googleapi.CheckResponse(res); err != nil {
12333 return nil, gensupport.WrapError(err)
12334 }
12335 ret := &Instance{
12336 ServerResponse: googleapi.ServerResponse{
12337 Header: res.Header,
12338 HTTPStatusCode: res.StatusCode,
12339 },
12340 }
12341 target := &ret
12342 b, err := gensupport.DecodeResponseBytes(target, res)
12343 if err != nil {
12344 return nil, err
12345 }
12346 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.instances.get", "response", internallog.HTTPResponse(res, b))
12347 return ret, nil
12348 }
12349
12350 type ProjectsLocationsInstancesGetIamPolicyCall struct {
12351 s *Service
12352 resource string
12353 urlParams_ gensupport.URLParams
12354 ifNoneMatch_ string
12355 ctx_ context.Context
12356 header_ http.Header
12357 }
12358
12359 // GetIamPolicy: Gets the access control policy for a resource. Returns an
12360 // empty policy if the resource exists and does not have a policy set.
12361 //
12362 // - resource: REQUIRED: The resource for which the policy is being requested.
12363 // See Resource names (https://cloud.google.com/apis/design/resource_names)
12364 // for the appropriate value for this field.
12365 func (r *ProjectsLocationsInstancesService) GetIamPolicy(resource string) *ProjectsLocationsInstancesGetIamPolicyCall {
12366 c := &ProjectsLocationsInstancesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12367 c.resource = resource
12368 return c
12369 }
12370
12371 // OptionsRequestedPolicyVersion sets the optional parameter
12372 // "options.requestedPolicyVersion": The maximum policy version that will be
12373 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
12374 // an invalid value will be rejected. Requests for policies with any
12375 // conditional role bindings must specify version 3. Policies with no
12376 // conditional role bindings may specify any valid value or leave the field
12377 // unset. The policy in the response might use the policy version that you
12378 // specified, or it might use a lower policy version. For example, if you
12379 // specify version 3, but the policy has no conditional role bindings, the
12380 // response uses version 1. To learn which resources support conditions in
12381 // their IAM policies, see the IAM documentation
12382 // (https://cloud.google.com/iam/help/conditions/resource-policies).
12383 func (c *ProjectsLocationsInstancesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsInstancesGetIamPolicyCall {
12384 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
12385 return c
12386 }
12387
12388 // Fields allows partial responses to be retrieved. See
12389 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12390 // details.
12391 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesGetIamPolicyCall {
12392 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12393 return c
12394 }
12395
12396 // IfNoneMatch sets an optional parameter which makes the operation fail if the
12397 // object's ETag matches the given value. This is useful for getting updates
12398 // only after the object has changed since the last request.
12399 func (c *ProjectsLocationsInstancesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsInstancesGetIamPolicyCall {
12400 c.ifNoneMatch_ = entityTag
12401 return c
12402 }
12403
12404 // Context sets the context to be used in this call's Do method.
12405 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInstancesGetIamPolicyCall {
12406 c.ctx_ = ctx
12407 return c
12408 }
12409
12410 // Header returns a http.Header that can be modified by the caller to add
12411 // headers to the request.
12412 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Header() http.Header {
12413 if c.header_ == nil {
12414 c.header_ = make(http.Header)
12415 }
12416 return c.header_
12417 }
12418
12419 func (c *ProjectsLocationsInstancesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
12420 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12421 if c.ifNoneMatch_ != "" {
12422 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12423 }
12424 c.urlParams_.Set("alt", alt)
12425 c.urlParams_.Set("prettyPrint", "false")
12426 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
12427 urls += "?" + c.urlParams_.Encode()
12428 req, err := http.NewRequest("GET", urls, nil)
12429 if err != nil {
12430 return nil, err
12431 }
12432 req.Header = reqHeaders
12433 googleapi.Expand(req.URL, map[string]string{
12434 "resource": c.resource,
12435 })
12436 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.instances.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
12437 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12438 }
12439
12440 // Do executes the "apigeeregistry.projects.locations.instances.getIamPolicy" call.
12441 // Any non-2xx status code is an error. Response headers are in either
12442 // *Policy.ServerResponse.Header or (if a response was returned at all) in
12443 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12444 // whether the returned error was because http.StatusNotModified was returned.
12445 func (c *ProjectsLocationsInstancesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
12446 gensupport.SetOptions(c.urlParams_, opts...)
12447 res, err := c.doRequest("json")
12448 if res != nil && res.StatusCode == http.StatusNotModified {
12449 if res.Body != nil {
12450 res.Body.Close()
12451 }
12452 return nil, gensupport.WrapError(&googleapi.Error{
12453 Code: res.StatusCode,
12454 Header: res.Header,
12455 })
12456 }
12457 if err != nil {
12458 return nil, err
12459 }
12460 defer googleapi.CloseBody(res)
12461 if err := googleapi.CheckResponse(res); err != nil {
12462 return nil, gensupport.WrapError(err)
12463 }
12464 ret := &Policy{
12465 ServerResponse: googleapi.ServerResponse{
12466 Header: res.Header,
12467 HTTPStatusCode: res.StatusCode,
12468 },
12469 }
12470 target := &ret
12471 b, err := gensupport.DecodeResponseBytes(target, res)
12472 if err != nil {
12473 return nil, err
12474 }
12475 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.instances.getIamPolicy", "response", internallog.HTTPResponse(res, b))
12476 return ret, nil
12477 }
12478
12479 type ProjectsLocationsInstancesSetIamPolicyCall struct {
12480 s *Service
12481 resource string
12482 setiampolicyrequest *SetIamPolicyRequest
12483 urlParams_ gensupport.URLParams
12484 ctx_ context.Context
12485 header_ http.Header
12486 }
12487
12488 // SetIamPolicy: Sets the access control policy on the specified resource.
12489 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
12490 // and `PERMISSION_DENIED` errors.
12491 //
12492 // - resource: REQUIRED: The resource for which the policy is being specified.
12493 // See Resource names (https://cloud.google.com/apis/design/resource_names)
12494 // for the appropriate value for this field.
12495 func (r *ProjectsLocationsInstancesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsInstancesSetIamPolicyCall {
12496 c := &ProjectsLocationsInstancesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12497 c.resource = resource
12498 c.setiampolicyrequest = setiampolicyrequest
12499 return c
12500 }
12501
12502 // Fields allows partial responses to be retrieved. See
12503 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12504 // details.
12505 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesSetIamPolicyCall {
12506 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12507 return c
12508 }
12509
12510 // Context sets the context to be used in this call's Do method.
12511 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsInstancesSetIamPolicyCall {
12512 c.ctx_ = ctx
12513 return c
12514 }
12515
12516 // Header returns a http.Header that can be modified by the caller to add
12517 // headers to the request.
12518 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Header() http.Header {
12519 if c.header_ == nil {
12520 c.header_ = make(http.Header)
12521 }
12522 return c.header_
12523 }
12524
12525 func (c *ProjectsLocationsInstancesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
12526 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12527 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
12528 if err != nil {
12529 return nil, err
12530 }
12531 c.urlParams_.Set("alt", alt)
12532 c.urlParams_.Set("prettyPrint", "false")
12533 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
12534 urls += "?" + c.urlParams_.Encode()
12535 req, err := http.NewRequest("POST", urls, body)
12536 if err != nil {
12537 return nil, err
12538 }
12539 req.Header = reqHeaders
12540 googleapi.Expand(req.URL, map[string]string{
12541 "resource": c.resource,
12542 })
12543 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.instances.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
12544 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12545 }
12546
12547 // Do executes the "apigeeregistry.projects.locations.instances.setIamPolicy" call.
12548 // Any non-2xx status code is an error. Response headers are in either
12549 // *Policy.ServerResponse.Header or (if a response was returned at all) in
12550 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12551 // whether the returned error was because http.StatusNotModified was returned.
12552 func (c *ProjectsLocationsInstancesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
12553 gensupport.SetOptions(c.urlParams_, opts...)
12554 res, err := c.doRequest("json")
12555 if res != nil && res.StatusCode == http.StatusNotModified {
12556 if res.Body != nil {
12557 res.Body.Close()
12558 }
12559 return nil, gensupport.WrapError(&googleapi.Error{
12560 Code: res.StatusCode,
12561 Header: res.Header,
12562 })
12563 }
12564 if err != nil {
12565 return nil, err
12566 }
12567 defer googleapi.CloseBody(res)
12568 if err := googleapi.CheckResponse(res); err != nil {
12569 return nil, gensupport.WrapError(err)
12570 }
12571 ret := &Policy{
12572 ServerResponse: googleapi.ServerResponse{
12573 Header: res.Header,
12574 HTTPStatusCode: res.StatusCode,
12575 },
12576 }
12577 target := &ret
12578 b, err := gensupport.DecodeResponseBytes(target, res)
12579 if err != nil {
12580 return nil, err
12581 }
12582 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.instances.setIamPolicy", "response", internallog.HTTPResponse(res, b))
12583 return ret, nil
12584 }
12585
12586 type ProjectsLocationsInstancesTestIamPermissionsCall struct {
12587 s *Service
12588 resource string
12589 testiampermissionsrequest *TestIamPermissionsRequest
12590 urlParams_ gensupport.URLParams
12591 ctx_ context.Context
12592 header_ http.Header
12593 }
12594
12595 // TestIamPermissions: Returns permissions that a caller has on the specified
12596 // resource. If the resource does not exist, this will return an empty set of
12597 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
12598 // used for building permission-aware UIs and command-line tools, not for
12599 // authorization checking. This operation may "fail open" without warning.
12600 //
12601 // - resource: REQUIRED: The resource for which the policy detail is being
12602 // requested. See Resource names
12603 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
12604 // value for this field.
12605 func (r *ProjectsLocationsInstancesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsInstancesTestIamPermissionsCall {
12606 c := &ProjectsLocationsInstancesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12607 c.resource = resource
12608 c.testiampermissionsrequest = testiampermissionsrequest
12609 return c
12610 }
12611
12612 // Fields allows partial responses to be retrieved. See
12613 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12614 // details.
12615 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsInstancesTestIamPermissionsCall {
12616 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12617 return c
12618 }
12619
12620 // Context sets the context to be used in this call's Do method.
12621 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsInstancesTestIamPermissionsCall {
12622 c.ctx_ = ctx
12623 return c
12624 }
12625
12626 // Header returns a http.Header that can be modified by the caller to add
12627 // headers to the request.
12628 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Header() http.Header {
12629 if c.header_ == nil {
12630 c.header_ = make(http.Header)
12631 }
12632 return c.header_
12633 }
12634
12635 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
12636 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12637 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
12638 if err != nil {
12639 return nil, err
12640 }
12641 c.urlParams_.Set("alt", alt)
12642 c.urlParams_.Set("prettyPrint", "false")
12643 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
12644 urls += "?" + c.urlParams_.Encode()
12645 req, err := http.NewRequest("POST", urls, body)
12646 if err != nil {
12647 return nil, err
12648 }
12649 req.Header = reqHeaders
12650 googleapi.Expand(req.URL, map[string]string{
12651 "resource": c.resource,
12652 })
12653 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.instances.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
12654 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12655 }
12656
12657 // Do executes the "apigeeregistry.projects.locations.instances.testIamPermissions" call.
12658 // Any non-2xx status code is an error. Response headers are in either
12659 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
12660 // returned at all) in error.(*googleapi.Error).Header. Use
12661 // googleapi.IsNotModified to check whether the returned error was because
12662 // http.StatusNotModified was returned.
12663 func (c *ProjectsLocationsInstancesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
12664 gensupport.SetOptions(c.urlParams_, opts...)
12665 res, err := c.doRequest("json")
12666 if res != nil && res.StatusCode == http.StatusNotModified {
12667 if res.Body != nil {
12668 res.Body.Close()
12669 }
12670 return nil, gensupport.WrapError(&googleapi.Error{
12671 Code: res.StatusCode,
12672 Header: res.Header,
12673 })
12674 }
12675 if err != nil {
12676 return nil, err
12677 }
12678 defer googleapi.CloseBody(res)
12679 if err := googleapi.CheckResponse(res); err != nil {
12680 return nil, gensupport.WrapError(err)
12681 }
12682 ret := &TestIamPermissionsResponse{
12683 ServerResponse: googleapi.ServerResponse{
12684 Header: res.Header,
12685 HTTPStatusCode: res.StatusCode,
12686 },
12687 }
12688 target := &ret
12689 b, err := gensupport.DecodeResponseBytes(target, res)
12690 if err != nil {
12691 return nil, err
12692 }
12693 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.instances.testIamPermissions", "response", internallog.HTTPResponse(res, b))
12694 return ret, nil
12695 }
12696
12697 type ProjectsLocationsOperationsCancelCall struct {
12698 s *Service
12699 name string
12700 canceloperationrequest *CancelOperationRequest
12701 urlParams_ gensupport.URLParams
12702 ctx_ context.Context
12703 header_ http.Header
12704 }
12705
12706 // Cancel: Starts asynchronous cancellation on a long-running operation. The
12707 // server makes a best effort to cancel the operation, but success is not
12708 // guaranteed. If the server doesn't support this method, it returns
12709 // `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or
12710 // other methods to check whether the cancellation succeeded or whether the
12711 // operation completed despite cancellation. On successful cancellation, the
12712 // operation is not deleted; instead, it becomes an operation with an
12713 // Operation.error value with a google.rpc.Status.code of 1, corresponding to
12714 // `Code.CANCELLED`.
12715 //
12716 // - name: The name of the operation resource to be cancelled.
12717 func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
12718 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12719 c.name = name
12720 c.canceloperationrequest = canceloperationrequest
12721 return c
12722 }
12723
12724 // Fields allows partial responses to be retrieved. See
12725 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12726 // details.
12727 func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
12728 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12729 return c
12730 }
12731
12732 // Context sets the context to be used in this call's Do method.
12733 func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
12734 c.ctx_ = ctx
12735 return c
12736 }
12737
12738 // Header returns a http.Header that can be modified by the caller to add
12739 // headers to the request.
12740 func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
12741 if c.header_ == nil {
12742 c.header_ = make(http.Header)
12743 }
12744 return c.header_
12745 }
12746
12747 func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
12748 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12749 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.canceloperationrequest)
12750 if err != nil {
12751 return nil, err
12752 }
12753 c.urlParams_.Set("alt", alt)
12754 c.urlParams_.Set("prettyPrint", "false")
12755 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
12756 urls += "?" + c.urlParams_.Encode()
12757 req, err := http.NewRequest("POST", urls, body)
12758 if err != nil {
12759 return nil, err
12760 }
12761 req.Header = reqHeaders
12762 googleapi.Expand(req.URL, map[string]string{
12763 "name": c.name,
12764 })
12765 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.operations.cancel", "request", internallog.HTTPRequest(req, body.Bytes()))
12766 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12767 }
12768
12769 // Do executes the "apigeeregistry.projects.locations.operations.cancel" call.
12770 // Any non-2xx status code is an error. Response headers are in either
12771 // *Empty.ServerResponse.Header or (if a response was returned at all) in
12772 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12773 // whether the returned error was because http.StatusNotModified was returned.
12774 func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
12775 gensupport.SetOptions(c.urlParams_, opts...)
12776 res, err := c.doRequest("json")
12777 if res != nil && res.StatusCode == http.StatusNotModified {
12778 if res.Body != nil {
12779 res.Body.Close()
12780 }
12781 return nil, gensupport.WrapError(&googleapi.Error{
12782 Code: res.StatusCode,
12783 Header: res.Header,
12784 })
12785 }
12786 if err != nil {
12787 return nil, err
12788 }
12789 defer googleapi.CloseBody(res)
12790 if err := googleapi.CheckResponse(res); err != nil {
12791 return nil, gensupport.WrapError(err)
12792 }
12793 ret := &Empty{
12794 ServerResponse: googleapi.ServerResponse{
12795 Header: res.Header,
12796 HTTPStatusCode: res.StatusCode,
12797 },
12798 }
12799 target := &ret
12800 b, err := gensupport.DecodeResponseBytes(target, res)
12801 if err != nil {
12802 return nil, err
12803 }
12804 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.operations.cancel", "response", internallog.HTTPResponse(res, b))
12805 return ret, nil
12806 }
12807
12808 type ProjectsLocationsOperationsDeleteCall struct {
12809 s *Service
12810 name string
12811 urlParams_ gensupport.URLParams
12812 ctx_ context.Context
12813 header_ http.Header
12814 }
12815
12816 // Delete: Deletes a long-running operation. This method indicates that the
12817 // client is no longer interested in the operation result. It does not cancel
12818 // the operation. If the server doesn't support this method, it returns
12819 // `google.rpc.Code.UNIMPLEMENTED`.
12820 //
12821 // - name: The name of the operation resource to be deleted.
12822 func (r *ProjectsLocationsOperationsService) Delete(name string) *ProjectsLocationsOperationsDeleteCall {
12823 c := &ProjectsLocationsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12824 c.name = name
12825 return c
12826 }
12827
12828 // Fields allows partial responses to be retrieved. See
12829 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12830 // details.
12831 func (c *ProjectsLocationsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsDeleteCall {
12832 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12833 return c
12834 }
12835
12836 // Context sets the context to be used in this call's Do method.
12837 func (c *ProjectsLocationsOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsOperationsDeleteCall {
12838 c.ctx_ = ctx
12839 return c
12840 }
12841
12842 // Header returns a http.Header that can be modified by the caller to add
12843 // headers to the request.
12844 func (c *ProjectsLocationsOperationsDeleteCall) Header() http.Header {
12845 if c.header_ == nil {
12846 c.header_ = make(http.Header)
12847 }
12848 return c.header_
12849 }
12850
12851 func (c *ProjectsLocationsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
12852 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12853 c.urlParams_.Set("alt", alt)
12854 c.urlParams_.Set("prettyPrint", "false")
12855 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
12856 urls += "?" + c.urlParams_.Encode()
12857 req, err := http.NewRequest("DELETE", urls, nil)
12858 if err != nil {
12859 return nil, err
12860 }
12861 req.Header = reqHeaders
12862 googleapi.Expand(req.URL, map[string]string{
12863 "name": c.name,
12864 })
12865 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.operations.delete", "request", internallog.HTTPRequest(req, nil))
12866 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12867 }
12868
12869 // Do executes the "apigeeregistry.projects.locations.operations.delete" call.
12870 // Any non-2xx status code is an error. Response headers are in either
12871 // *Empty.ServerResponse.Header or (if a response was returned at all) in
12872 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12873 // whether the returned error was because http.StatusNotModified was returned.
12874 func (c *ProjectsLocationsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
12875 gensupport.SetOptions(c.urlParams_, opts...)
12876 res, err := c.doRequest("json")
12877 if res != nil && res.StatusCode == http.StatusNotModified {
12878 if res.Body != nil {
12879 res.Body.Close()
12880 }
12881 return nil, gensupport.WrapError(&googleapi.Error{
12882 Code: res.StatusCode,
12883 Header: res.Header,
12884 })
12885 }
12886 if err != nil {
12887 return nil, err
12888 }
12889 defer googleapi.CloseBody(res)
12890 if err := googleapi.CheckResponse(res); err != nil {
12891 return nil, gensupport.WrapError(err)
12892 }
12893 ret := &Empty{
12894 ServerResponse: googleapi.ServerResponse{
12895 Header: res.Header,
12896 HTTPStatusCode: res.StatusCode,
12897 },
12898 }
12899 target := &ret
12900 b, err := gensupport.DecodeResponseBytes(target, res)
12901 if err != nil {
12902 return nil, err
12903 }
12904 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.operations.delete", "response", internallog.HTTPResponse(res, b))
12905 return ret, nil
12906 }
12907
12908 type ProjectsLocationsOperationsGetCall struct {
12909 s *Service
12910 name string
12911 urlParams_ gensupport.URLParams
12912 ifNoneMatch_ string
12913 ctx_ context.Context
12914 header_ http.Header
12915 }
12916
12917 // Get: Gets the latest state of a long-running operation. Clients can use this
12918 // method to poll the operation result at intervals as recommended by the API
12919 // service.
12920 //
12921 // - name: The name of the operation resource.
12922 func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
12923 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12924 c.name = name
12925 return c
12926 }
12927
12928 // Fields allows partial responses to be retrieved. See
12929 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12930 // details.
12931 func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
12932 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12933 return c
12934 }
12935
12936 // IfNoneMatch sets an optional parameter which makes the operation fail if the
12937 // object's ETag matches the given value. This is useful for getting updates
12938 // only after the object has changed since the last request.
12939 func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
12940 c.ifNoneMatch_ = entityTag
12941 return c
12942 }
12943
12944 // Context sets the context to be used in this call's Do method.
12945 func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
12946 c.ctx_ = ctx
12947 return c
12948 }
12949
12950 // Header returns a http.Header that can be modified by the caller to add
12951 // headers to the request.
12952 func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
12953 if c.header_ == nil {
12954 c.header_ = make(http.Header)
12955 }
12956 return c.header_
12957 }
12958
12959 func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
12960 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12961 if c.ifNoneMatch_ != "" {
12962 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12963 }
12964 c.urlParams_.Set("alt", alt)
12965 c.urlParams_.Set("prettyPrint", "false")
12966 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
12967 urls += "?" + c.urlParams_.Encode()
12968 req, err := http.NewRequest("GET", urls, nil)
12969 if err != nil {
12970 return nil, err
12971 }
12972 req.Header = reqHeaders
12973 googleapi.Expand(req.URL, map[string]string{
12974 "name": c.name,
12975 })
12976 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.operations.get", "request", internallog.HTTPRequest(req, nil))
12977 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12978 }
12979
12980 // Do executes the "apigeeregistry.projects.locations.operations.get" call.
12981 // Any non-2xx status code is an error. Response headers are in either
12982 // *Operation.ServerResponse.Header or (if a response was returned at all) in
12983 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12984 // whether the returned error was because http.StatusNotModified was returned.
12985 func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
12986 gensupport.SetOptions(c.urlParams_, opts...)
12987 res, err := c.doRequest("json")
12988 if res != nil && res.StatusCode == http.StatusNotModified {
12989 if res.Body != nil {
12990 res.Body.Close()
12991 }
12992 return nil, gensupport.WrapError(&googleapi.Error{
12993 Code: res.StatusCode,
12994 Header: res.Header,
12995 })
12996 }
12997 if err != nil {
12998 return nil, err
12999 }
13000 defer googleapi.CloseBody(res)
13001 if err := googleapi.CheckResponse(res); err != nil {
13002 return nil, gensupport.WrapError(err)
13003 }
13004 ret := &Operation{
13005 ServerResponse: googleapi.ServerResponse{
13006 Header: res.Header,
13007 HTTPStatusCode: res.StatusCode,
13008 },
13009 }
13010 target := &ret
13011 b, err := gensupport.DecodeResponseBytes(target, res)
13012 if err != nil {
13013 return nil, err
13014 }
13015 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.operations.get", "response", internallog.HTTPResponse(res, b))
13016 return ret, nil
13017 }
13018
13019 type ProjectsLocationsOperationsListCall struct {
13020 s *Service
13021 name string
13022 urlParams_ gensupport.URLParams
13023 ifNoneMatch_ string
13024 ctx_ context.Context
13025 header_ http.Header
13026 }
13027
13028 // List: Lists operations that match the specified filter in the request. If
13029 // the server doesn't support this method, it returns `UNIMPLEMENTED`.
13030 //
13031 // - name: The name of the operation's parent resource.
13032 func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
13033 c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13034 c.name = name
13035 return c
13036 }
13037
13038 // Filter sets the optional parameter "filter": The standard list filter.
13039 func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
13040 c.urlParams_.Set("filter", filter)
13041 return c
13042 }
13043
13044 // PageSize sets the optional parameter "pageSize": The standard list page
13045 // size.
13046 func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
13047 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
13048 return c
13049 }
13050
13051 // PageToken sets the optional parameter "pageToken": The standard list page
13052 // token.
13053 func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
13054 c.urlParams_.Set("pageToken", pageToken)
13055 return c
13056 }
13057
13058 // Fields allows partial responses to be retrieved. See
13059 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13060 // details.
13061 func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
13062 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13063 return c
13064 }
13065
13066 // IfNoneMatch sets an optional parameter which makes the operation fail if the
13067 // object's ETag matches the given value. This is useful for getting updates
13068 // only after the object has changed since the last request.
13069 func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
13070 c.ifNoneMatch_ = entityTag
13071 return c
13072 }
13073
13074 // Context sets the context to be used in this call's Do method.
13075 func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
13076 c.ctx_ = ctx
13077 return c
13078 }
13079
13080 // Header returns a http.Header that can be modified by the caller to add
13081 // headers to the request.
13082 func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
13083 if c.header_ == nil {
13084 c.header_ = make(http.Header)
13085 }
13086 return c.header_
13087 }
13088
13089 func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
13090 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13091 if c.ifNoneMatch_ != "" {
13092 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13093 }
13094 c.urlParams_.Set("alt", alt)
13095 c.urlParams_.Set("prettyPrint", "false")
13096 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
13097 urls += "?" + c.urlParams_.Encode()
13098 req, err := http.NewRequest("GET", urls, nil)
13099 if err != nil {
13100 return nil, err
13101 }
13102 req.Header = reqHeaders
13103 googleapi.Expand(req.URL, map[string]string{
13104 "name": c.name,
13105 })
13106 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.operations.list", "request", internallog.HTTPRequest(req, nil))
13107 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13108 }
13109
13110 // Do executes the "apigeeregistry.projects.locations.operations.list" call.
13111 // Any non-2xx status code is an error. Response headers are in either
13112 // *ListOperationsResponse.ServerResponse.Header or (if a response was returned
13113 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
13114 // check whether the returned error was because http.StatusNotModified was
13115 // returned.
13116 func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
13117 gensupport.SetOptions(c.urlParams_, opts...)
13118 res, err := c.doRequest("json")
13119 if res != nil && res.StatusCode == http.StatusNotModified {
13120 if res.Body != nil {
13121 res.Body.Close()
13122 }
13123 return nil, gensupport.WrapError(&googleapi.Error{
13124 Code: res.StatusCode,
13125 Header: res.Header,
13126 })
13127 }
13128 if err != nil {
13129 return nil, err
13130 }
13131 defer googleapi.CloseBody(res)
13132 if err := googleapi.CheckResponse(res); err != nil {
13133 return nil, gensupport.WrapError(err)
13134 }
13135 ret := &ListOperationsResponse{
13136 ServerResponse: googleapi.ServerResponse{
13137 Header: res.Header,
13138 HTTPStatusCode: res.StatusCode,
13139 },
13140 }
13141 target := &ret
13142 b, err := gensupport.DecodeResponseBytes(target, res)
13143 if err != nil {
13144 return nil, err
13145 }
13146 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.operations.list", "response", internallog.HTTPResponse(res, b))
13147 return ret, nil
13148 }
13149
13150 // Pages invokes f for each page of results.
13151 // A non-nil error returned from f will halt the iteration.
13152 // The provided context supersedes any context provided to the Context method.
13153 func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
13154 c.ctx_ = ctx
13155 defer c.PageToken(c.urlParams_.Get("pageToken"))
13156 for {
13157 x, err := c.Do()
13158 if err != nil {
13159 return err
13160 }
13161 if err := f(x); err != nil {
13162 return err
13163 }
13164 if x.NextPageToken == "" {
13165 return nil
13166 }
13167 c.PageToken(x.NextPageToken)
13168 }
13169 }
13170
13171 type ProjectsLocationsRuntimeGetIamPolicyCall struct {
13172 s *Service
13173 resource string
13174 urlParams_ gensupport.URLParams
13175 ifNoneMatch_ string
13176 ctx_ context.Context
13177 header_ http.Header
13178 }
13179
13180 // GetIamPolicy: Gets the access control policy for a resource. Returns an
13181 // empty policy if the resource exists and does not have a policy set.
13182 //
13183 // - resource: REQUIRED: The resource for which the policy is being requested.
13184 // See Resource names (https://cloud.google.com/apis/design/resource_names)
13185 // for the appropriate value for this field.
13186 func (r *ProjectsLocationsRuntimeService) GetIamPolicy(resource string) *ProjectsLocationsRuntimeGetIamPolicyCall {
13187 c := &ProjectsLocationsRuntimeGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13188 c.resource = resource
13189 return c
13190 }
13191
13192 // OptionsRequestedPolicyVersion sets the optional parameter
13193 // "options.requestedPolicyVersion": The maximum policy version that will be
13194 // used to format the policy. Valid values are 0, 1, and 3. Requests specifying
13195 // an invalid value will be rejected. Requests for policies with any
13196 // conditional role bindings must specify version 3. Policies with no
13197 // conditional role bindings may specify any valid value or leave the field
13198 // unset. The policy in the response might use the policy version that you
13199 // specified, or it might use a lower policy version. For example, if you
13200 // specify version 3, but the policy has no conditional role bindings, the
13201 // response uses version 1. To learn which resources support conditions in
13202 // their IAM policies, see the IAM documentation
13203 // (https://cloud.google.com/iam/help/conditions/resource-policies).
13204 func (c *ProjectsLocationsRuntimeGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsRuntimeGetIamPolicyCall {
13205 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion))
13206 return c
13207 }
13208
13209 // Fields allows partial responses to be retrieved. See
13210 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13211 // details.
13212 func (c *ProjectsLocationsRuntimeGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsRuntimeGetIamPolicyCall {
13213 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13214 return c
13215 }
13216
13217 // IfNoneMatch sets an optional parameter which makes the operation fail if the
13218 // object's ETag matches the given value. This is useful for getting updates
13219 // only after the object has changed since the last request.
13220 func (c *ProjectsLocationsRuntimeGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsRuntimeGetIamPolicyCall {
13221 c.ifNoneMatch_ = entityTag
13222 return c
13223 }
13224
13225 // Context sets the context to be used in this call's Do method.
13226 func (c *ProjectsLocationsRuntimeGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsRuntimeGetIamPolicyCall {
13227 c.ctx_ = ctx
13228 return c
13229 }
13230
13231 // Header returns a http.Header that can be modified by the caller to add
13232 // headers to the request.
13233 func (c *ProjectsLocationsRuntimeGetIamPolicyCall) Header() http.Header {
13234 if c.header_ == nil {
13235 c.header_ = make(http.Header)
13236 }
13237 return c.header_
13238 }
13239
13240 func (c *ProjectsLocationsRuntimeGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
13241 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13242 if c.ifNoneMatch_ != "" {
13243 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13244 }
13245 c.urlParams_.Set("alt", alt)
13246 c.urlParams_.Set("prettyPrint", "false")
13247 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
13248 urls += "?" + c.urlParams_.Encode()
13249 req, err := http.NewRequest("GET", urls, nil)
13250 if err != nil {
13251 return nil, err
13252 }
13253 req.Header = reqHeaders
13254 googleapi.Expand(req.URL, map[string]string{
13255 "resource": c.resource,
13256 })
13257 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.runtime.getIamPolicy", "request", internallog.HTTPRequest(req, nil))
13258 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13259 }
13260
13261 // Do executes the "apigeeregistry.projects.locations.runtime.getIamPolicy" call.
13262 // Any non-2xx status code is an error. Response headers are in either
13263 // *Policy.ServerResponse.Header or (if a response was returned at all) in
13264 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
13265 // whether the returned error was because http.StatusNotModified was returned.
13266 func (c *ProjectsLocationsRuntimeGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
13267 gensupport.SetOptions(c.urlParams_, opts...)
13268 res, err := c.doRequest("json")
13269 if res != nil && res.StatusCode == http.StatusNotModified {
13270 if res.Body != nil {
13271 res.Body.Close()
13272 }
13273 return nil, gensupport.WrapError(&googleapi.Error{
13274 Code: res.StatusCode,
13275 Header: res.Header,
13276 })
13277 }
13278 if err != nil {
13279 return nil, err
13280 }
13281 defer googleapi.CloseBody(res)
13282 if err := googleapi.CheckResponse(res); err != nil {
13283 return nil, gensupport.WrapError(err)
13284 }
13285 ret := &Policy{
13286 ServerResponse: googleapi.ServerResponse{
13287 Header: res.Header,
13288 HTTPStatusCode: res.StatusCode,
13289 },
13290 }
13291 target := &ret
13292 b, err := gensupport.DecodeResponseBytes(target, res)
13293 if err != nil {
13294 return nil, err
13295 }
13296 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.runtime.getIamPolicy", "response", internallog.HTTPResponse(res, b))
13297 return ret, nil
13298 }
13299
13300 type ProjectsLocationsRuntimeSetIamPolicyCall struct {
13301 s *Service
13302 resource string
13303 setiampolicyrequest *SetIamPolicyRequest
13304 urlParams_ gensupport.URLParams
13305 ctx_ context.Context
13306 header_ http.Header
13307 }
13308
13309 // SetIamPolicy: Sets the access control policy on the specified resource.
13310 // Replaces any existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`,
13311 // and `PERMISSION_DENIED` errors.
13312 //
13313 // - resource: REQUIRED: The resource for which the policy is being specified.
13314 // See Resource names (https://cloud.google.com/apis/design/resource_names)
13315 // for the appropriate value for this field.
13316 func (r *ProjectsLocationsRuntimeService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsRuntimeSetIamPolicyCall {
13317 c := &ProjectsLocationsRuntimeSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13318 c.resource = resource
13319 c.setiampolicyrequest = setiampolicyrequest
13320 return c
13321 }
13322
13323 // Fields allows partial responses to be retrieved. See
13324 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13325 // details.
13326 func (c *ProjectsLocationsRuntimeSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsRuntimeSetIamPolicyCall {
13327 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13328 return c
13329 }
13330
13331 // Context sets the context to be used in this call's Do method.
13332 func (c *ProjectsLocationsRuntimeSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsRuntimeSetIamPolicyCall {
13333 c.ctx_ = ctx
13334 return c
13335 }
13336
13337 // Header returns a http.Header that can be modified by the caller to add
13338 // headers to the request.
13339 func (c *ProjectsLocationsRuntimeSetIamPolicyCall) Header() http.Header {
13340 if c.header_ == nil {
13341 c.header_ = make(http.Header)
13342 }
13343 return c.header_
13344 }
13345
13346 func (c *ProjectsLocationsRuntimeSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
13347 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
13348 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.setiampolicyrequest)
13349 if err != nil {
13350 return nil, err
13351 }
13352 c.urlParams_.Set("alt", alt)
13353 c.urlParams_.Set("prettyPrint", "false")
13354 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
13355 urls += "?" + c.urlParams_.Encode()
13356 req, err := http.NewRequest("POST", urls, body)
13357 if err != nil {
13358 return nil, err
13359 }
13360 req.Header = reqHeaders
13361 googleapi.Expand(req.URL, map[string]string{
13362 "resource": c.resource,
13363 })
13364 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.runtime.setIamPolicy", "request", internallog.HTTPRequest(req, body.Bytes()))
13365 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13366 }
13367
13368 // Do executes the "apigeeregistry.projects.locations.runtime.setIamPolicy" call.
13369 // Any non-2xx status code is an error. Response headers are in either
13370 // *Policy.ServerResponse.Header or (if a response was returned at all) in
13371 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
13372 // whether the returned error was because http.StatusNotModified was returned.
13373 func (c *ProjectsLocationsRuntimeSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
13374 gensupport.SetOptions(c.urlParams_, opts...)
13375 res, err := c.doRequest("json")
13376 if res != nil && res.StatusCode == http.StatusNotModified {
13377 if res.Body != nil {
13378 res.Body.Close()
13379 }
13380 return nil, gensupport.WrapError(&googleapi.Error{
13381 Code: res.StatusCode,
13382 Header: res.Header,
13383 })
13384 }
13385 if err != nil {
13386 return nil, err
13387 }
13388 defer googleapi.CloseBody(res)
13389 if err := googleapi.CheckResponse(res); err != nil {
13390 return nil, gensupport.WrapError(err)
13391 }
13392 ret := &Policy{
13393 ServerResponse: googleapi.ServerResponse{
13394 Header: res.Header,
13395 HTTPStatusCode: res.StatusCode,
13396 },
13397 }
13398 target := &ret
13399 b, err := gensupport.DecodeResponseBytes(target, res)
13400 if err != nil {
13401 return nil, err
13402 }
13403 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.runtime.setIamPolicy", "response", internallog.HTTPResponse(res, b))
13404 return ret, nil
13405 }
13406
13407 type ProjectsLocationsRuntimeTestIamPermissionsCall struct {
13408 s *Service
13409 resource string
13410 testiampermissionsrequest *TestIamPermissionsRequest
13411 urlParams_ gensupport.URLParams
13412 ctx_ context.Context
13413 header_ http.Header
13414 }
13415
13416 // TestIamPermissions: Returns permissions that a caller has on the specified
13417 // resource. If the resource does not exist, this will return an empty set of
13418 // permissions, not a `NOT_FOUND` error. Note: This operation is designed to be
13419 // used for building permission-aware UIs and command-line tools, not for
13420 // authorization checking. This operation may "fail open" without warning.
13421 //
13422 // - resource: REQUIRED: The resource for which the policy detail is being
13423 // requested. See Resource names
13424 // (https://cloud.google.com/apis/design/resource_names) for the appropriate
13425 // value for this field.
13426 func (r *ProjectsLocationsRuntimeService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsRuntimeTestIamPermissionsCall {
13427 c := &ProjectsLocationsRuntimeTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13428 c.resource = resource
13429 c.testiampermissionsrequest = testiampermissionsrequest
13430 return c
13431 }
13432
13433 // Fields allows partial responses to be retrieved. See
13434 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13435 // details.
13436 func (c *ProjectsLocationsRuntimeTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsRuntimeTestIamPermissionsCall {
13437 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13438 return c
13439 }
13440
13441 // Context sets the context to be used in this call's Do method.
13442 func (c *ProjectsLocationsRuntimeTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsRuntimeTestIamPermissionsCall {
13443 c.ctx_ = ctx
13444 return c
13445 }
13446
13447 // Header returns a http.Header that can be modified by the caller to add
13448 // headers to the request.
13449 func (c *ProjectsLocationsRuntimeTestIamPermissionsCall) Header() http.Header {
13450 if c.header_ == nil {
13451 c.header_ = make(http.Header)
13452 }
13453 return c.header_
13454 }
13455
13456 func (c *ProjectsLocationsRuntimeTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
13457 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
13458 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testiampermissionsrequest)
13459 if err != nil {
13460 return nil, err
13461 }
13462 c.urlParams_.Set("alt", alt)
13463 c.urlParams_.Set("prettyPrint", "false")
13464 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
13465 urls += "?" + c.urlParams_.Encode()
13466 req, err := http.NewRequest("POST", urls, body)
13467 if err != nil {
13468 return nil, err
13469 }
13470 req.Header = reqHeaders
13471 googleapi.Expand(req.URL, map[string]string{
13472 "resource": c.resource,
13473 })
13474 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.runtime.testIamPermissions", "request", internallog.HTTPRequest(req, body.Bytes()))
13475 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13476 }
13477
13478 // Do executes the "apigeeregistry.projects.locations.runtime.testIamPermissions" call.
13479 // Any non-2xx status code is an error. Response headers are in either
13480 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response was
13481 // returned at all) in error.(*googleapi.Error).Header. Use
13482 // googleapi.IsNotModified to check whether the returned error was because
13483 // http.StatusNotModified was returned.
13484 func (c *ProjectsLocationsRuntimeTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
13485 gensupport.SetOptions(c.urlParams_, opts...)
13486 res, err := c.doRequest("json")
13487 if res != nil && res.StatusCode == http.StatusNotModified {
13488 if res.Body != nil {
13489 res.Body.Close()
13490 }
13491 return nil, gensupport.WrapError(&googleapi.Error{
13492 Code: res.StatusCode,
13493 Header: res.Header,
13494 })
13495 }
13496 if err != nil {
13497 return nil, err
13498 }
13499 defer googleapi.CloseBody(res)
13500 if err := googleapi.CheckResponse(res); err != nil {
13501 return nil, gensupport.WrapError(err)
13502 }
13503 ret := &TestIamPermissionsResponse{
13504 ServerResponse: googleapi.ServerResponse{
13505 Header: res.Header,
13506 HTTPStatusCode: res.StatusCode,
13507 },
13508 }
13509 target := &ret
13510 b, err := gensupport.DecodeResponseBytes(target, res)
13511 if err != nil {
13512 return nil, err
13513 }
13514 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "apigeeregistry.projects.locations.runtime.testIamPermissions", "response", internallog.HTTPResponse(res, b))
13515 return ret, nil
13516 }