From f2da582c9f6aab240d44c8ebd2dcc43f5096f896 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 6 May 2024 00:24:18 -0700 Subject: [PATCH] feat(all): auto-regenerate discovery clients (#2570) --- artifactregistry/v1/artifactregistry-api.json | 75 ++--- artifactregistry/v1/artifactregistry-gen.go | 273 +++++++++--------- .../v1beta1/artifactregistry-api.json | 13 +- .../v1beta1/artifactregistry-gen.go | 11 +- .../v1beta2/artifactregistry-api.json | 73 ++--- .../v1beta2/artifactregistry-gen.go | 271 +++++++++-------- 6 files changed, 357 insertions(+), 359 deletions(-) diff --git a/artifactregistry/v1/artifactregistry-api.json b/artifactregistry/v1/artifactregistry-api.json index d2827007f95..9febf96e0b3 100644 --- a/artifactregistry/v1/artifactregistry-api.json +++ b/artifactregistry/v1/artifactregistry-api.json @@ -115,38 +115,6 @@ }, "protocol": "rest", "resources": { - "media": { - "methods": { - "download": { - "description": "Download a file.", - "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/files/{filesId}:download", - "httpMethod": "GET", - "id": "artifactregistry.media.download", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Required. The name of the file to download.", - "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+/files/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+name}:download", - "response": { - "$ref": "DownloadFileResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "supportsMediaDownload": true, - "useMediaDownloadService": true - } - } - }, "projects": { "methods": { "getProjectSettings": { @@ -538,7 +506,7 @@ ], "parameters": { "name": { - "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`.", + "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`. For each location in a project, repository names must be unique.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+$", "required": true, @@ -767,6 +735,34 @@ }, "files": { "methods": { + "download": { + "description": "Download a file.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/files/{filesId}:download", + "httpMethod": "GET", + "id": "artifactregistry.projects.locations.repositories.files.download", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the file to download.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+/files/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:download", + "response": { + "$ref": "DownloadFileResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "supportsMediaDownload": true, + "useMediaDownloadService": true + }, "get": { "description": "Gets a file.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/files/{filesId}", @@ -1782,7 +1778,7 @@ } } }, - "revision": "20240425", + "revision": "20240501", "rootUrl": "https://artifactregistry.googleapis.com/", "schemas": { "AptArtifact": { @@ -2224,7 +2220,7 @@ "type": "array" }, "name": { - "description": "The name of the file, for example: \"projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt\". If the file ID part contains slashes, they are escaped.", + "description": "The name of the file, for example: `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`. If the file ID part contains slashes, they are escaped.", "type": "string" }, "owner": { @@ -3319,13 +3315,18 @@ "type": "string" }, "name": { - "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`.", + "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`. For each location in a project, repository names must be unique.", "type": "string" }, "remoteRepositoryConfig": { "$ref": "RemoteRepositoryConfig", "description": "Configuration specific for a Remote Repository." }, + "satisfiesPzi": { + "description": "Output only. If set, the repository satisfies physical zone isolation.", + "readOnly": true, + "type": "boolean" + }, "satisfiesPzs": { "description": "Output only. If set, the repository satisfies physical zone separation.", "readOnly": true, @@ -3754,7 +3755,7 @@ "type": "object" }, "VirtualRepositoryConfig": { - "description": "Virtual repository configuration.", + "description": "LINT.IfChange Virtual repository configuration.", "id": "VirtualRepositoryConfig", "properties": { "upstreamPolicies": { diff --git a/artifactregistry/v1/artifactregistry-gen.go b/artifactregistry/v1/artifactregistry-gen.go index b9c797cd4e4..d178b8b41bd 100644 --- a/artifactregistry/v1/artifactregistry-gen.go +++ b/artifactregistry/v1/artifactregistry-gen.go @@ -146,7 +146,6 @@ func New(client *http.Client) (*Service, error) { return nil, errors.New("client is nil") } s := &Service{client: client, BasePath: basePath} - s.Media = NewMediaService(s) s.Projects = NewProjectsService(s) return s, nil } @@ -156,8 +155,6 @@ type Service struct { BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment - Media *MediaService - Projects *ProjectsService } @@ -168,15 +165,6 @@ func (s *Service) userAgent() string { return googleapi.UserAgent + " " + s.UserAgent } -func NewMediaService(s *Service) *MediaService { - rs := &MediaService{s: s} - return rs -} - -type MediaService struct { - s *Service -} - func NewProjectsService(s *Service) *ProjectsService { rs := &ProjectsService{s: s} rs.Locations = NewProjectsLocationsService(s) @@ -981,7 +969,7 @@ type GoogleDevtoolsArtifactregistryV1File struct { // Hashes: The hashes of the file content. Hashes []*Hash `json:"hashes,omitempty"` // Name: The name of the file, for example: - // "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". + // `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`. // If the file ID part contains slashes, they are escaped. Name string `json:"name,omitempty"` // Owner: The name of the Package or Version that owns this file, if any. @@ -2477,10 +2465,14 @@ type Repository struct { // upstreams. Mode string `json:"mode,omitempty"` // Name: The name of the repository, for example: - // `projects/p1/locations/us-central1/repositories/repo1`. + // `projects/p1/locations/us-central1/repositories/repo1`. For each location in + // a project, repository names must be unique. Name string `json:"name,omitempty"` // RemoteRepositoryConfig: Configuration specific for a Remote Repository. RemoteRepositoryConfig *RemoteRepositoryConfig `json:"remoteRepositoryConfig,omitempty"` + // SatisfiesPzi: Output only. If set, the repository satisfies physical zone + // isolation. + SatisfiesPzi bool `json:"satisfiesPzi,omitempty"` // SatisfiesPzs: Output only. If set, the repository satisfies physical zone // separation. SatisfiesPzs bool `json:"satisfiesPzs,omitempty"` @@ -3156,7 +3148,7 @@ func (s *Version) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -// VirtualRepositoryConfig: Virtual repository configuration. +// VirtualRepositoryConfig: LINT.IfChange Virtual repository configuration. type VirtualRepositoryConfig struct { // UpstreamPolicies: Policies that configure the upstream artifacts distributed // by the Virtual Repository. Upstream policies cannot be set on a standard @@ -3238,130 +3230,6 @@ func (s *YumRepository) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -type MediaDownloadCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Download: Download a file. -// -// - name: The name of the file to download. -func (r *MediaService) Download(name string) *MediaDownloadCall { - c := &MediaDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *MediaDownloadCall) Fields(s ...googleapi.Field) *MediaDownloadCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *MediaDownloadCall) IfNoneMatch(entityTag string) *MediaDownloadCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do and Download methods. -func (c *MediaDownloadCall) Context(ctx context.Context) *MediaDownloadCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *MediaDownloadCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *MediaDownloadCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:download") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "name": c.name, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Download fetches the API endpoint's "media" value, instead of the normal -// API response value. If the returned error is nil, the Response is guaranteed to -// have a 2xx status code. Callers must close the Response.Body as usual. -func (c *MediaDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("media") - if err != nil { - return nil, err - } - if err := googleapi.CheckResponse(res); err != nil { - res.Body.Close() - return nil, gensupport.WrapError(err) - } - return res, nil -} - -// Do executes the "artifactregistry.media.download" call. -// Any non-2xx status code is an error. Response headers are in either -// *DownloadFileResponse.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *MediaDownloadCall) Do(opts ...googleapi.CallOption) (*DownloadFileResponse, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &DownloadFileResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - type ProjectsGetProjectSettingsCall struct { s *Service name string @@ -4762,7 +4630,8 @@ type ProjectsLocationsRepositoriesPatchCall struct { // Patch: Updates a repository. // // - name: The name of the repository, for example: -// `projects/p1/locations/us-central1/repositories/repo1`. +// `projects/p1/locations/us-central1/repositories/repo1`. For each location +// in a project, repository names must be unique. func (r *ProjectsLocationsRepositoriesService) Patch(name string, repository *Repository) *ProjectsLocationsRepositoriesPatchCall { c := &ProjectsLocationsRepositoriesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -5605,6 +5474,130 @@ func (c *ProjectsLocationsRepositoriesDockerImagesListCall) Pages(ctx context.Co } } +type ProjectsLocationsRepositoriesFilesDownloadCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Download: Download a file. +// +// - name: The name of the file to download. +func (r *ProjectsLocationsRepositoriesFilesService) Download(name string) *ProjectsLocationsRepositoriesFilesDownloadCall { + c := &ProjectsLocationsRepositoriesFilesDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsRepositoriesFilesDownloadCall) Fields(s ...googleapi.Field) *ProjectsLocationsRepositoriesFilesDownloadCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsRepositoriesFilesDownloadCall) IfNoneMatch(entityTag string) *ProjectsLocationsRepositoriesFilesDownloadCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +func (c *ProjectsLocationsRepositoriesFilesDownloadCall) Context(ctx context.Context) *ProjectsLocationsRepositoriesFilesDownloadCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsRepositoriesFilesDownloadCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsRepositoriesFilesDownloadCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:download") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ProjectsLocationsRepositoriesFilesDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + res.Body.Close() + return nil, gensupport.WrapError(err) + } + return res, nil +} + +// Do executes the "artifactregistry.projects.locations.repositories.files.download" call. +// Any non-2xx status code is an error. Response headers are in either +// *DownloadFileResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsRepositoriesFilesDownloadCall) Do(opts ...googleapi.CallOption) (*DownloadFileResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &DownloadFileResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + type ProjectsLocationsRepositoriesFilesGetCall struct { s *Service name string diff --git a/artifactregistry/v1beta1/artifactregistry-api.json b/artifactregistry/v1beta1/artifactregistry-api.json index c6b9d6fab88..304020b49e5 100644 --- a/artifactregistry/v1beta1/artifactregistry-api.json +++ b/artifactregistry/v1beta1/artifactregistry-api.json @@ -384,7 +384,7 @@ ], "parameters": { "name": { - "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`.", + "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`. For each location in a project, repository names must be unique.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+$", "required": true, @@ -936,7 +936,7 @@ } } }, - "revision": "20240122", + "revision": "20240501", "rootUrl": "https://artifactregistry.googleapis.com/", "schemas": { "Binding": { @@ -1008,7 +1008,7 @@ "type": "array" }, "name": { - "description": "The name of the file, for example: \"projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt\". If the file ID part contains slashes, they are escaped.", + "description": "The name of the file, for example: `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`. If the file ID part contains slashes, they are escaped.", "type": "string" }, "owner": { @@ -1331,9 +1331,14 @@ "type": "object" }, "name": { - "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`.", + "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`. For each location in a project, repository names must be unique.", "type": "string" }, + "satisfiesPzi": { + "description": "Output only. If set, the repository satisfies physical zone isolation.", + "readOnly": true, + "type": "boolean" + }, "satisfiesPzs": { "description": "Output only. If set, the repository satisfies physical zone separation.", "readOnly": true, diff --git a/artifactregistry/v1beta1/artifactregistry-gen.go b/artifactregistry/v1beta1/artifactregistry-gen.go index 55330229ad6..d0bc4629892 100644 --- a/artifactregistry/v1beta1/artifactregistry-gen.go +++ b/artifactregistry/v1beta1/artifactregistry-gen.go @@ -422,7 +422,7 @@ type File struct { // Hashes: The hashes of the file content. Hashes []*Hash `json:"hashes,omitempty"` // Name: The name of the file, for example: - // "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". + // `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`. // If the file ID part contains slashes, they are escaped. Name string `json:"name,omitempty"` // Owner: The name of the Package or Version that owns this file, if any. @@ -887,8 +887,12 @@ type Repository struct { // letters, numeric characters, underscores, and dashes. Labels map[string]string `json:"labels,omitempty"` // Name: The name of the repository, for example: - // `projects/p1/locations/us-central1/repositories/repo1`. + // `projects/p1/locations/us-central1/repositories/repo1`. For each location in + // a project, repository names must be unique. Name string `json:"name,omitempty"` + // SatisfiesPzi: Output only. If set, the repository satisfies physical zone + // isolation. + SatisfiesPzi bool `json:"satisfiesPzi,omitempty"` // SatisfiesPzs: Output only. If set, the repository satisfies physical zone // separation. SatisfiesPzs bool `json:"satisfiesPzs,omitempty"` @@ -2069,7 +2073,8 @@ type ProjectsLocationsRepositoriesPatchCall struct { // Patch: Updates a repository. // // - name: The name of the repository, for example: -// `projects/p1/locations/us-central1/repositories/repo1`. +// `projects/p1/locations/us-central1/repositories/repo1`. For each location +// in a project, repository names must be unique. func (r *ProjectsLocationsRepositoriesService) Patch(name string, repository *Repository) *ProjectsLocationsRepositoriesPatchCall { c := &ProjectsLocationsRepositoriesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name diff --git a/artifactregistry/v1beta2/artifactregistry-api.json b/artifactregistry/v1beta2/artifactregistry-api.json index 7c041665e24..7fc65f37550 100644 --- a/artifactregistry/v1beta2/artifactregistry-api.json +++ b/artifactregistry/v1beta2/artifactregistry-api.json @@ -115,38 +115,6 @@ }, "protocol": "rest", "resources": { - "media": { - "methods": { - "download": { - "description": "Download a file.", - "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/files/{filesId}:download", - "httpMethod": "GET", - "id": "artifactregistry.media.download", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Required. The name of the file to download.", - "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+/files/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1beta2/{+name}:download", - "response": { - "$ref": "DownloadFileResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "supportsMediaDownload": true, - "useMediaDownloadService": true - } - } - }, "projects": { "methods": { "getProjectSettings": { @@ -478,7 +446,7 @@ ], "parameters": { "name": { - "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`.", + "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`. For each location in a project, repository names must be unique.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+$", "required": true, @@ -635,6 +603,34 @@ }, "files": { "methods": { + "download": { + "description": "Download a file.", + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/files/{filesId}:download", + "httpMethod": "GET", + "id": "artifactregistry.projects.locations.repositories.files.download", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the file to download.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+/files/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta2/{+name}:download", + "response": { + "$ref": "DownloadFileResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "supportsMediaDownload": true, + "useMediaDownloadService": true + }, "get": { "description": "Gets a file.", "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/files/{filesId}", @@ -1208,7 +1204,7 @@ } } }, - "revision": "20240305", + "revision": "20240501", "rootUrl": "https://artifactregistry.googleapis.com/", "schemas": { "AptArtifact": { @@ -1334,7 +1330,7 @@ "type": "array" }, "name": { - "description": "The name of the file, for example: \"projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt\". If the file ID part contains slashes, they are escaped.", + "description": "The name of the file, for example: `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`. If the file ID part contains slashes, they are escaped.", "type": "string" }, "owner": { @@ -1877,9 +1873,14 @@ "description": "Maven repository config contains repository level configuration for the repositories of maven type." }, "name": { - "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`.", + "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`. For each location in a project, repository names must be unique.", "type": "string" }, + "satisfiesPzi": { + "description": "Output only. If set, the repository satisfies physical zone isolation.", + "readOnly": true, + "type": "boolean" + }, "satisfiesPzs": { "description": "Output only. If set, the repository satisfies physical zone separation.", "readOnly": true, diff --git a/artifactregistry/v1beta2/artifactregistry-gen.go b/artifactregistry/v1beta2/artifactregistry-gen.go index 6b435ccdf22..57743c16e87 100644 --- a/artifactregistry/v1beta2/artifactregistry-gen.go +++ b/artifactregistry/v1beta2/artifactregistry-gen.go @@ -146,7 +146,6 @@ func New(client *http.Client) (*Service, error) { return nil, errors.New("client is nil") } s := &Service{client: client, BasePath: basePath} - s.Media = NewMediaService(s) s.Projects = NewProjectsService(s) return s, nil } @@ -156,8 +155,6 @@ type Service struct { BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment - Media *MediaService - Projects *ProjectsService } @@ -168,15 +165,6 @@ func (s *Service) userAgent() string { return googleapi.UserAgent + " " + s.UserAgent } -func NewMediaService(s *Service) *MediaService { - rs := &MediaService{s: s} - return rs -} - -type MediaService struct { - s *Service -} - func NewProjectsService(s *Service) *ProjectsService { rs := &ProjectsService{s: s} rs.Locations = NewProjectsLocationsService(s) @@ -503,7 +491,7 @@ type GoogleDevtoolsArtifactregistryV1beta2File struct { // Hashes: The hashes of the file content. Hashes []*Hash `json:"hashes,omitempty"` // Name: The name of the file, for example: - // "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". + // `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`. // If the file ID part contains slashes, they are escaped. Name string `json:"name,omitempty"` // Owner: The name of the Package or Version that owns this file, if any. @@ -1256,8 +1244,12 @@ type Repository struct { // for the repositories of maven type. MavenConfig *MavenRepositoryConfig `json:"mavenConfig,omitempty"` // Name: The name of the repository, for example: - // `projects/p1/locations/us-central1/repositories/repo1`. + // `projects/p1/locations/us-central1/repositories/repo1`. For each location in + // a project, repository names must be unique. Name string `json:"name,omitempty"` + // SatisfiesPzi: Output only. If set, the repository satisfies physical zone + // isolation. + SatisfiesPzi bool `json:"satisfiesPzi,omitempty"` // SatisfiesPzs: Output only. If set, the repository satisfies physical zone // separation. SatisfiesPzs bool `json:"satisfiesPzs,omitempty"` @@ -1626,130 +1618,6 @@ func (s *YumArtifact) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) } -type MediaDownloadCall struct { - s *Service - name string - urlParams_ gensupport.URLParams - ifNoneMatch_ string - ctx_ context.Context - header_ http.Header -} - -// Download: Download a file. -// -// - name: The name of the file to download. -func (r *MediaService) Download(name string) *MediaDownloadCall { - c := &MediaDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)} - c.name = name - return c -} - -// Fields allows partial responses to be retrieved. See -// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more -// details. -func (c *MediaDownloadCall) Fields(s ...googleapi.Field) *MediaDownloadCall { - c.urlParams_.Set("fields", googleapi.CombineFields(s)) - return c -} - -// IfNoneMatch sets an optional parameter which makes the operation fail if the -// object's ETag matches the given value. This is useful for getting updates -// only after the object has changed since the last request. -func (c *MediaDownloadCall) IfNoneMatch(entityTag string) *MediaDownloadCall { - c.ifNoneMatch_ = entityTag - return c -} - -// Context sets the context to be used in this call's Do and Download methods. -func (c *MediaDownloadCall) Context(ctx context.Context) *MediaDownloadCall { - c.ctx_ = ctx - return c -} - -// Header returns a http.Header that can be modified by the caller to add -// headers to the request. -func (c *MediaDownloadCall) Header() http.Header { - if c.header_ == nil { - c.header_ = make(http.Header) - } - return c.header_ -} - -func (c *MediaDownloadCall) doRequest(alt string) (*http.Response, error) { - reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) - if c.ifNoneMatch_ != "" { - reqHeaders.Set("If-None-Match", c.ifNoneMatch_) - } - var body io.Reader = nil - c.urlParams_.Set("alt", alt) - c.urlParams_.Set("prettyPrint", "false") - urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:download") - urls += "?" + c.urlParams_.Encode() - req, err := http.NewRequest("GET", urls, body) - if err != nil { - return nil, err - } - req.Header = reqHeaders - googleapi.Expand(req.URL, map[string]string{ - "name": c.name, - }) - return gensupport.SendRequest(c.ctx_, c.s.client, req) -} - -// Download fetches the API endpoint's "media" value, instead of the normal -// API response value. If the returned error is nil, the Response is guaranteed to -// have a 2xx status code. Callers must close the Response.Body as usual. -func (c *MediaDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("media") - if err != nil { - return nil, err - } - if err := googleapi.CheckResponse(res); err != nil { - res.Body.Close() - return nil, gensupport.WrapError(err) - } - return res, nil -} - -// Do executes the "artifactregistry.media.download" call. -// Any non-2xx status code is an error. Response headers are in either -// *DownloadFileResponse.ServerResponse.Header or (if a response was returned -// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to -// check whether the returned error was because http.StatusNotModified was -// returned. -func (c *MediaDownloadCall) Do(opts ...googleapi.CallOption) (*DownloadFileResponse, error) { - gensupport.SetOptions(c.urlParams_, opts...) - res, err := c.doRequest("json") - if res != nil && res.StatusCode == http.StatusNotModified { - if res.Body != nil { - res.Body.Close() - } - return nil, gensupport.WrapError(&googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - }) - } - if err != nil { - return nil, err - } - defer googleapi.CloseBody(res) - if err := googleapi.CheckResponse(res); err != nil { - return nil, gensupport.WrapError(err) - } - ret := &DownloadFileResponse{ - ServerResponse: googleapi.ServerResponse{ - Header: res.Header, - HTTPStatusCode: res.StatusCode, - }, - } - target := &ret - if err := gensupport.DecodeResponse(target, res); err != nil { - return nil, err - } - return ret, nil -} - type ProjectsGetProjectSettingsCall struct { s *Service name string @@ -2933,7 +2801,8 @@ type ProjectsLocationsRepositoriesPatchCall struct { // Patch: Updates a repository. // // - name: The name of the repository, for example: -// `projects/p1/locations/us-central1/repositories/repo1`. +// `projects/p1/locations/us-central1/repositories/repo1`. For each location +// in a project, repository names must be unique. func (r *ProjectsLocationsRepositoriesService) Patch(name string, repository *Repository) *ProjectsLocationsRepositoriesPatchCall { c := &ProjectsLocationsRepositoriesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} c.name = name @@ -3518,6 +3387,130 @@ func (c *ProjectsLocationsRepositoriesAptArtifactsUploadCall) Do(opts ...googlea return ret, nil } +type ProjectsLocationsRepositoriesFilesDownloadCall struct { + s *Service + name string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// Download: Download a file. +// +// - name: The name of the file to download. +func (r *ProjectsLocationsRepositoriesFilesService) Download(name string) *ProjectsLocationsRepositoriesFilesDownloadCall { + c := &ProjectsLocationsRepositoriesFilesDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.name = name + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ProjectsLocationsRepositoriesFilesDownloadCall) Fields(s ...googleapi.Field) *ProjectsLocationsRepositoriesFilesDownloadCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ProjectsLocationsRepositoriesFilesDownloadCall) IfNoneMatch(entityTag string) *ProjectsLocationsRepositoriesFilesDownloadCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do and Download methods. +func (c *ProjectsLocationsRepositoriesFilesDownloadCall) Context(ctx context.Context) *ProjectsLocationsRepositoriesFilesDownloadCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ProjectsLocationsRepositoriesFilesDownloadCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ProjectsLocationsRepositoriesFilesDownloadCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + var body io.Reader = nil + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:download") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, body) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "name": c.name, + }) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Download fetches the API endpoint's "media" value, instead of the normal +// API response value. If the returned error is nil, the Response is guaranteed to +// have a 2xx status code. Callers must close the Response.Body as usual. +func (c *ProjectsLocationsRepositoriesFilesDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("media") + if err != nil { + return nil, err + } + if err := googleapi.CheckResponse(res); err != nil { + res.Body.Close() + return nil, gensupport.WrapError(err) + } + return res, nil +} + +// Do executes the "artifactregistry.projects.locations.repositories.files.download" call. +// Any non-2xx status code is an error. Response headers are in either +// *DownloadFileResponse.ServerResponse.Header or (if a response was returned +// at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ProjectsLocationsRepositoriesFilesDownloadCall) Do(opts ...googleapi.CallOption) (*DownloadFileResponse, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &DownloadFileResponse{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + if err := gensupport.DecodeResponse(target, res); err != nil { + return nil, err + } + return ret, nil +} + type ProjectsLocationsRepositoriesFilesGetCall struct { s *Service name string