Debian Codegraph @

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